washed / drempelbox

0 stars 0 forks source link

Volume buttons #30

Closed tmh-alex closed 4 months ago

tmh-alex commented 5 months ago

Not even in draft PR state, just meant to make you aware that there's finally activity on my side @washed . Some more infos in the latest commit message at the time of writing.

washed commented 5 months ago

Nice! For when you get to actually implementing the volume setting: there are already messages defined for controlling volume through the players API.

tmh-alex commented 5 months ago

@washed Volume up/down works now. Code looks terrible, I still attempt to write Python more often than not. Next step will be cleaning up before turning this into a proper PR.

washed commented 5 months ago

I think this is a good start! One idea since we already have a bunch of buttons now: abstract away all of the details of debouncing, getting the pin etc. into a separate struct (which handles a single pin) and then have a simple interface which could take a Sender and a message (or if more advanced stuff is necessary, a closure/Fn that returns a message) and then sends it when the trigger happens. But I'd also be happy to merge this as is and do a generalized button handler in a separate PR.

tmh-alex commented 5 months ago

That's the way I intended to go (hence calling the crate button without the volume_). Think I'll do it in this PR

tmh-alex commented 5 months ago

At the moment it bugs me a lot that I have to match twice over the same thing...

tmh-alex commented 4 months ago

@washed as written in #31 everything works just fine. Would propose to merge this into main.

washed commented 4 months ago

Can't approve on the mobile app, but since we don't enforce formal approvals here, let's go! @tmh-alex