Add playback order support to playback rewrite #2783
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
This change adds a new "playbackOrder" property to the playback state. The currently supported values are:
Changing the order property only affects the upcoming items in a queue. This means you can play the first 3 items using default order and then switch to shuffling. The queue service keeps track of this and manages the ordering.
To implement this ordering we now need to know the size of a queue, for this a new "size" property is added to the queue interface. I've implemented this properly for the queue used by the RewriteMediaManager but the other queue implementations that aren't used yet have implementations that may not work (expose size=0 until the first getItem call which will never happen because size=0). This will be fixed later, when we start using those queues.
The current playback UI only allows switching between default & shuffle. The random option is not used.
Issues
Part of #1057