-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gbmusic] Fix #3737 and a handful of other fixes #3740
base: master
Are you sure you want to change the base?
Conversation
…e to gb instead of play; allow widget clicks
This PR to fix existing issues before I submit a couple possible enhancements (config setting for pause-timeout, and adding thumbs up/down commands). Let me know if you'd prefer I combine any of these into this PR to cut down on updates. |
@rigrig if you'd like to comment since you wrote most of this app. |
Thanks for pinging me. I haven't used/looked at this app for quite some time though. It's pretty old, so I'm not surprised it bitrotted. (Does it even play nice with e.g. the Message UI app? Otherwise it might be time to mark it as deprecated.) One general comment: please delete unused code instead of commenting it out: it clutters up the file, and we have git to keep track of history. |
Deleted the commented code. I can't remember why I ended up on gbmusic.. a mix of testing random apps, and maybe it was easier to modify with my own tweaks? It's been my go-to for a few months though. The pause/inactive timeouts being so long have been my only remaining complaint -- I was going to add a settings options to tweak them. But it's been buggy so I'm holding off on that. |
apps/gbmusic/app.js
Outdated
function togglePlay() { | ||
sendCommand(stat==="play" ? "pause" : "play"); | ||
sendCommand(stat==="play" ? "pause" : "playpause"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to use "playpause"
than "play"
, I believe that's the reason for the change? I guess it handles if the recorded state on watch is out of step with the actual state on the android device?
I think this goes to .../GBMusicControlReceiver.java
in gadgetbridge, am I correct?
"playpause" should maybe be added to the list of possible values for the command
parameter for the sendCommand
function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that is correct. I prefer "playpause" but wasn't sure if there was a reason not to, so was minimizing the change.
Usually if it knows the state is play, it's correct. The issue mostly comes up when manually opening the app and it hasn't received a musicstate update yet, it gets stuck sending "play" when it's already playing.
And I've updated the jsdoc comment to list possible values.
App Link: https://thinkpoop.github.io/BangleApps/?id=gbmusic
I'll try to save way to recreate this, in case anyone wants to work on figuring out the root cause.
saved.state
being a string instead of an objectboot.js
around line 31 saves thee.state
instead ofe
.app.js
functionstate(e)
expects an object though, so it was savingstat=e.state
, andstat
was ending up undefined.This way, if
stat
is unknown/undefined, gadgetbridge can figure out what to do.gbmusic
could always sendplaypause
and that would work too.Opening message notifications was pausing music on me. I'm not sure if I should add the bottom widget bar too? (I'm assuming it'd be
pos.y <= Bangle.appRect.y2
?)globalThis
instead ofglobal
in the boot.js).