Rob, I like the simplicity of the fire and forget players, but I have to agree with you. It really is a mess under the hood to make it all work. I do use them myself though, for one reason: It's nice to be able to play multiple sounds simultaniously, without thinking about rotating a list of Players to queue them on. I try to avoid this though, because I know it's messy. Instead, I often make a simple AudioPlayer class, with the following characteristics:
- One Player instance for music tracks. - A deque of many Player instances for sound effects. - A `play` method for sounds that should be played instantly, and mixed with other already playing sounds. - A `play_music` method to replace the currently playing music track. If we do deprecate the fire-and-forget functionality, perhaps we can implement a slightly higher level abstraction for simplicity. Something along the lines of the KeyStateHandler. Simple to write yourself, but so common that it's nice to have a ready made class. On Sunday, December 3, 2017 at 6:24:39 PM UTC+9, Rob wrote: > > To me the fire and forget use of players had been a resource management > headache from the first time I touched media. I am strongly in favor of > deprecating it. So if you create a player but don't hold on to it, the > player should be destroyed. > Issue 105 is an example of the trouble it causes. > > Rob > > On 2 Dec 2017 4:21 pm, "Daniel Gillet" <[email protected] <javascript:>> > wrote: > >> Benjamin, the bug was confirmed. >> >> I've corrected it (I hope) and it was not what I initially thought. The >> details are not super important and they can be found in my commit. >> I've created a new pull request for you to review. Let me know if it >> solves the problem. >> >> I don't forget the playlist feature. But I don't have the time right now. >> It will take a bit more time because I need to create some test cases for >> this new functionality. This means I need to first understand all the >> different test cases that exist for the media Player. >> >> I'll let you know once I make some progresses. :) >> >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/pyglet-users. >> For more options, visit https://groups.google.com/d/optout. >> > -- 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.
