Conversation
lediur
commented
Mar 28, 2019
| self.spot_durations[spotnumber] = self._menus.filetimetoload | ||
|
|
||
| def _playspot(self, spotnumber): | ||
| self._stop() |
Author
There was a problem hiding this comment.
Since iTunes only has one playback queue, playing a new spot will stop playing that spot and start playing the new spot.
With the Pyglet player, it's possible to play multiple spots simultaneously, which is probably not what most people expect. Adding an explicit call to stop doesn't affect iTunes playback but explicitly implements behavior that was a side effect of iTunes mode.
Assuming you don't want to layer spots on top of each other :\
When Pyglet finishes playback, it will dequeue the source media. Calling `play` again will immediately pause, because there's no source media in the queue. This fix addresses that issue by checking the player queue state and requeueing the media if it expired out of the queue. This also addresses an issue where pressing play on two spots will allow you to play them simultaneously. Since the UI doesn't show that, I fixed the behavior to always stop playback. I also changed the behavior to make sure we start playback from the beginning, since the expected behavior of a "stop" button is to stop audio and reset the transport to the beginning of the track for future playback, not resume playback from the original timestamp.
5ef870b to
7d8fd30
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since I don't have iTunes or AppleScript on my machine, I got Pyglet playback working so I could test playback and the "play all" functionality in #3.