On 26/02/12 20:20, Dennis wrote:
> I have 4 video files (different scenes of a movie).
> 
> There's a starting scene that will be played when I run the player.
> And before that scene ends, the video player reads an int value
> (0-100) from external file (all happens at runtime), and depending on
> that int value, it has to determine which scene to play next.
> 
> pseudo example:
> 
>         if (x > 0 and x < 30)
>            videoSource = scene2
> 
>         else if (x >= 30 and x < 60)
>            videoSource = scene3
> 
>         else if (x >= 60 and x <= 100)
>             videoSource = scene 4
> 
> How can I make it change video sources at runtime, depending on that
> variable?
> 
> I don't know how to approach this problem. I've searched a lot about
> this problem, and the best solution for it seems to be PyGlet, but I'm
> still not sure how would I accomplish it.
> 
> How would I go about this? Guidance in the right direction and/or some
> sample code would be highly appreciated.
> 
> Thanks in advance.
> 

How about using pyglet.clock.schedule_once, for each source, at the
start of your program?
http://pyglet.org/doc/programming_guide/calling_functions_periodically.html

HTH,
Adam.

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to