Event when movie loops?

Hi,

(I am new to OpenFrameworks. I’m lovin’ it. But I have lots of questions!)

Let’s say a movie is looping. But there’s something I have to do when it ends. Are there some kind of events I can hook up to? Or do I have to check movie->getPosition() == 1 in Update() on every iteration?

Thanks,
Nuno

At the moment there is no event when the movie reaches the end.
You shouldn’t check against

  
if movie->getPosition() == 1   

as depending on the length of the movie it might never = 1.0 ( instead 0.989 or something ).

Best to set looping to false and then check when the movie position has stayed the same for two frames ( end of movie ) the do your event and play the movie again.

Or if it works for you then you could do

  
if movie->getPosition() >= 0.98   

and adjust it if it is a little off.

Hope that helps!
Theo

I see. Thanks. I’ll do that.

I hope in the future events get added, though, because it would make things so much simpler. This is the first time I’m programming in C++ since 1996 and I feel quite lost so unfortunately I won’t be able to help developing the tool.

Cheers,
Nuno