Moon-0xff / gnome-mpris-label

A music related GNOME extension.
GNU General Public License v3.0
51 stars 10 forks source link

Implement Mouse Controls (Superseded by #29 and #30) #26

Closed Batwam closed 1 year ago

Batwam commented 1 year ago

As suggested in #4, see proposed implementation to control the volume of the active mpris source by scrolling up/down on the label. image

Batwam commented 1 year ago

I like the vfunc_event trick! I saw it in the other extension but couldn't work out where is was being called as I didn't realise it was a built-in function... This is probably also why including EVENT_STOP and EVENT_PROPAGATE didn't seem to do anything...

I increased my refresh to 30s to test and it seemed to work for the label when I clicked next. It would need more testing though to see how it behaves when settings are changed impacting the label, etc...

You should add this._buildMenu() under case 'open-menu': in extension.js so the menu gets built when the user clicks. It's only built on init right now I believe.

Anyway, I'll leave you to it as I'm done with these PRs. Let me know if there is anything I can do to help.

For Gnome 44, it might be good to test and release the update around the time of the gnome release so we can update the version compatibility.

Moon-0xff commented 1 year ago

You should add this._buildMenu() under case 'open-menu': in extension.js so the menu gets built when the user clicks. It's only built on init right now I believe.

True!

Anyway, I'll leave you to it as I'm done with these PRs. Let me know if there is anything I can do to help.

No problem, I will split the PR and solve the conflict issues then. The best help right now is testing the newest main

Batwam commented 1 year ago

No problem, I have a VM with just about every media player I could get my hands on ready for testing and another one with the dev version of Ubuntu 23.04 to test gnome 44 as soon as it comes out. If they don't put it in 23.04, we can always check in a Fedora VM.

I did notice that you didn't include the error notifications in case the player doesn't accept PlayPause, isn't there a risk the user might think the extension is malfunctioning?

Moon-0xff commented 1 year ago

yes, but this update will be short lived. At most we will take a month to update it again, so I don't think we should worry about that.

Batwam commented 1 year ago

_activatePlayer() simplified to work with Amberol and Rhythmbox when the windows are closed. The .desktop identification is now very reliable since dc17bc0 and apps will be opened then the player class is initialised so this should pick up the .desktop.