Stop tracking playback state manually #234

Open
adamcik opened this Issue Nov 10, 2012 · 7 comments

Comments

Projects
None yet
2 participants
Owner

adamcik commented Nov 10, 2012

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.

Owner

jodal commented Nov 10, 2012

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.

Owner

adamcik commented Nov 10, 2012

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.

Owner

jodal commented Nov 10, 2012

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.

Owner

jodal commented Nov 10, 2012

Looking at other open bugs, I believe this would improve the situation for #202 as well.

Owner

jodal commented Nov 13, 2012

Ok, this is my suggestion for way ahead after our discussion on IRC today:

For v0.9:

  1. Add a new event AudioListener.playback_state_changed(old_state, new_state)
  2. Add a state change message callback in audio which translates from GStreamer states to Mopidy states and triggers said event. It should only trigger on state changes to the playbin itself.
  3. Listen for said even in core.
  4. If 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:

  • Extend the 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.
  • We want core's playback state to either:
    • be replaced by audio's state,
    • or make core's state always match audio's state with the help of the AudioListener.playback_state_changed() event.

jodal was assigned Dec 24, 2012

jodal added this to the v0.20 - Audio and mixer cleanup milestone Jun 22, 2014

Owner

adamcik commented Apr 5, 2015

IMO this should probably happen in whatever release gapless lands in. As doing this should greatly simplify tracking states correctly in that case.

Owner

jodal commented Apr 5, 2015

Then we change the milestone to the one with gapless in the title :-)

@jodal jodal modified the milestone: v1.2.1, v1.3 - The rest of v1.2 Feb 5, 2016

jodal removed the 0 - Backlog label Mar 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment