I know it is very confusing! The discussion was about the queuing of media 
on a given Player, especially in regards with looping on some video / 
musics, etc.

Greg proposal was to allow the Player to queue either a single Source or an 
iterable of Sources. He said either we could have 2 functions or a single 
one. I implemented the version with a single function which analyse its 
attribute and figure out whether it's a Source or an iterable or Sources.

The benefit with this approach is that the iterable could be a generator 
which provides the different media depending on some conditions. Greg's 
example was:

    def my_playlist(): 
       yield intro 
       while game_is_running(): 
          yield main_theme 
       yield ending 

    player.queue(my_playlist())

So everytime the Player finishes playing a media, it asks the iterable for 
the next media until it is exhausted. The source (media) can appear as 
often as we want in that generator. The only restriction is that if the 
Source is streamed, it can only be played on one Player. This is checked 
within the code I wrote.

All of this has nothing to do with playing multiple players at the same 
time.

For something unrelated, I've been also thinking about the fire and forget 
usage of the Player, and I think I have an idea. Anyone can of course 
create a Player. When the references to it disappear, it is gone from 
memory. Done. But I would also keep the fire and forget player, which is 
used by calling .play() on a Source. To deal with it, I would add a global 
set of Players in the module player.py. The Source would both instantiate 
the player and add it to the set. Also the Player would be given a callback 
to remove itself from that list once it reaches its end-of-stream. Finally 
the module player.py would also have an atexit.register() callback to empty 
the list of Players (if any) when we exit. This should allow the program to 
gracefully exit.

Dan

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to