-
Notifications
You must be signed in to change notification settings - Fork 251
Add Windows taskbar playback controls integration #664
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
base: main
Are you sure you want to change the base?
Conversation
Introduces a TaskbarManager for Windows that adds playback control buttons (play/pause, next, previous) to the taskbar thumbnail toolbar. Updates playback controller to initialize and update these buttons based on playback state, and adds a new PLAY_PAUSE_OR_RESUME command for unified play/pause handling. Updates dependencies to include the windows crate and related packages.
jacksongoode
left a comment
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.
This looks good. I haven't gone through it extensively, but I am curious about how the taskbar manager needs to be initialized on the first play. Is this a necessity or could we initialize it without first playing any media?
I'll review again when there's a little more time.
psst-gui/src/controller/playback.rs
Outdated
|
|
||
| if let Some(queued) = data.queued_entry(*item) { | ||
| data.start_playback(queued.item, queued.origin, progress.to_owned()); | ||
| self.setup_taskbar_buttons_on_first_play(PlaybackState::Playing); |
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.
Why do we need this here and below on line 536? This section is for the queued media?
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.
I only display the buttons once the first track has started playing. This prevents having controls that don't do anything. It also ensures that the window is fully loaded before injecting the buttons.
I'm not sure it's the right place to call the function, but it worked, so I didn't think too much about it.
Technically, we could initialize the buttons before the first track starts playing, but that would mean handling controls that are essentially useless until something is playing, plus adding an extra check to ensure the Windows window is properly loaded before interacting with it. |
|
Okay! I didn't know that you could disable a button, I'll probably do that at launch when no music is playing. |
Adds a dedicated INITIALIZE_TASKBAR command and defers taskbar button setup until after widget initialization. Refactors taskbar button update logic to update all buttons and enable/disable them based on playback state, improving reliability and consistency of taskbar controls.

Introduces a
TaskbarManagerfor Windows that adds playback control buttons (play/pause, next, previous) to the taskbar thumbnail toolbar. Updates playback controller to initialize and update these buttons based on playback state, and adds a newPLAY_PAUSE_OR_RESUMEcommand for unified play/pause handling. Updates dependencies to include the windows crate and related packages.close #659