Open adamcik opened 12 years ago
This should fix #232 as well. I think this is rather easy to fix, given that we emit state change events up to the core layer.
But you probably also want Gstreamer time tracking in the spotify backend for that, and at this point I'm thinking that might be more of an 0.10 thing as 0.9 has already been pushed back enough, and has enough large new stuff as is.
If we just added the playback state change events from audio to core in 0.9, and made core pause when audio pauses, that would fix #232, and would complement the switch to letting GStreamer track the state from 0.10 on.
Looking at other open bugs, I believe this would improve the situation for #202 as well.
Ok, this is my suggestion for way ahead after our discussion on IRC today:
For v0.9:
AudioListener.playback_state_changed(old_state, new_state)
audio
which translates from GStreamer states to Mopidy states and triggers said event. It should only trigger on state changes to the playbin itself.core
.new_state
is PAUSED
, check if core.playback.state
is PAUSED
, if not, set it to PAUSED
. This should fix pausing when we lose the Spotify play token (#232).For v0.10 or later:
core.playback_state_changed()
event handler to trigger the analogous events to CoreListener
subscribers. This should replace all or most _trigger_*
functions in core.playback
.core
's playback state to either:
audio
's state,core
's state always match audio
's state with the help of the AudioListener.playback_state_changed()
event.IMO this should probably happen in whatever release gapless lands in. As doing this should greatly simplify tracking states correctly in that case.
Then we change the milestone to the one with gapless in the title :-)
Currently we track the current playback state using our own state variable in the core playback code. This approach is rather cumbersome, and we should probably switch to just getting the state from Gstreamer.