The API I really want for this to support regular tracks, stream updates and
dynamic playlists is still unclear to me. As such I'm taking the KISS approach
and reducing this to just the stream title and nothing else.
If all goes as planed this will be replaced by playback_track_changed(tlid, ref)
style events and other improvements in a later version.
- Adds tests for new behaviors in core.
- Adds stream name to MPD format (fixes#944)
- Adds 'stream_changed' core event (needs a new name/event)
- Adds 'get_stream_reference' (which I'm also unsure about)
The bits I'm unsure about are mostly with respect to #270, but I'm going ahead
with this commit so we can discuss the details in PR with this code as an
example.
This commit does not try to make the events correct/perfect with regard to
GStreamer states, end-of-stream signalling, etc. It only tries to make the
events work consistently across all the methods on the playback controller.
* play(track) while already playing has changed from:
- playback_state_changed(old_state='playing', new_state='playing')
- track_playback_started(track=...)
to:
- playback_state_changed(old_state='playing', new_state='stopped')
- track_playback_ended(track=..., time_position=...)
- playback_state_changed(old_state='stopped', new_state='playing')
- track_playback_started(track=...)
* next() has changed from:
- track_playback_ended(track=..., time_position=...)
- playback_state_changed(old_state='playing', new_state='stopped')
- track_playback_ended(track=..., time_position=0)
- playback_state_changed(old_state='stopped', new_state='playing')
- track_playback_started(track=...)
to same as play() above.
* previous() has changed in the same way as next().
* on_end_of_track() has changed from:
- track_playback_ended(track=..., time_position=...)
- playback_state_changed(old_state='playing', new_state='playing')
- track_playback_started(track=...)
to same as play() above.
* stop() has reordered its events from:
- track_playback_ended(track=..., time_position=...)
- playback_state_changed(old_state='playing', new_state='stopped')
to:
- playback_state_changed(old_state='playing', new_state='stopped')
- track_playback_ended(track=..., time_position=...)
Replaces the jungle of extra dicts/lists with an OrderedDict per backend
feature type. Also makes sure that each type/scheme is unique instead of
the scheme alone.
The criterias are now a mapping between field names and one or more values.
This aligns tracklist.{filter,remove} with the API of
library.{find_exact,search}, and allows for e.g. batch removals.
An exception is raised immediately if the API is used in the old way to ease
migration and debugging.
This is required for e.g. ncmpcpp to detect that an enableoutput/disableoutput
command worked, making it possible to toggle the output back without restarting
ncmpcpp.
It was already called with the argument, and both the MPD and HTTP frontends
handled it/expected it. It was just the default implementation in CoreListener
that lacked the argument.