Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

void movieEvent() simple question

$
0
0
I made some tests and got weird results, but the question is

In reference the example says:

  1. void movieEvent(Movie m){
  2.   m.read();
  3. }
And it will work with several movies with only this m.read() called inside it, right? 
I mean I dont need to do:

void movieEvent(Movie m){
  firstVideo.read();
 secondVideo.read();
//well this would be strange, as i only have one parameter in parenthesis.. lost
//etc...
}

Do I?

So how is this working? This is a callback function right? It is called once for every movie? Why it is not just like mousePressed(), without any parameters? I've seen similar stuff in controP5. I just like to understand it.

The tests are that under 1.5.1 videos works without any call to movieEvent(), but in 2.0.b8 not, I had to use it... hummmm

this is the code of the test:
  1. import processing.video.*;

  2. Movie um, dois;

  3. void setup(){
  4.   size (800,300, P2D);
  5.   um = new Movie(this, "tet.mov");
  6.   dois = new Movie(this, "tet2.mov");
  7. um.loop();
  8. dois.loop();
  9. }

  10. void draw(){
  11.   background(0);
  12.   image(um, 10, 0);
  13.   image(dois, 400, 0);
  14. }

  15. // in 1.5.1 i can remove folowing lines and things still working... 
  16. void movieEvent(Movie m){
  17.   m.read();
  18. }

Viewing all articles
Browse latest Browse all 1768

Trending Articles