Skip to content

Conversation

@lediur
Copy link

@lediur lediur commented Mar 28, 2019

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.

self.spot_durations[spotnumber] = self._menus.filetimetoload

def _playspot(self, spotnumber):
self._stop()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lediur lediur changed the base branch from lediur/play-all to master April 1, 2019 05:02
lediur added 7 commits March 31, 2019 22:44
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.
@lediur lediur force-pushed the lediur/pyglet-playback branch from 5ef870b to 7d8fd30 Compare April 1, 2019 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants