We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › more Movie.time();
Page Index Toggle Pages: 1
more Movie.time(); (Read 381 times)
more Movie.time();
Jun 19th, 2009, 2:22pm
 
Hello

I am trying to set myMovie.time(); to a slider position using controlP5:


import controlP5.*;
import processing.video.*;

ControlP5 controlP5;

Movie myMovie;

float vitesse = 0;
float entree = 0;
float sortie = 0;
int   movie = 1;

void setup() {
  size(640, 480);
 background(0);

 myMovie = new Movie(this, "playthismovie");
 myMovie.loop();
 
 controlP5 = new ControlP5(this);
 
 Slider s = controlP5.addSlider("vitesse",0,10,1,45,470,120,10);
 
        s = controlP5.addSlider("entree",0,250,1,45,450,300,10);
         
        s = controlP5.addSlider("sortie",0,250,myMovie.duration(),45,430,300,10);
       
        s = controlP5.addSlider("lecteur",0,250,myMovie.duration(),45,440,300,10);

}
 
void movieEvent(Movie myMovie) {
 myMovie.read();
}

void draw() {

  image(myMovie, 0,0, 640,480);
 
 myMovie.speed(int(vitesse));
 float mt = myMovie.time();
 
if(mt > sortie) {
   if(sortie > entree) {
  myMovie.jump(int(entree));
  }
}
controlP5.controller("lecteur").setValue(mt);
}


but I always get this error:

Invalid memory access of location 00000010 eip=92b5e82d

Merci for suggestions,

Heiko

 

Page Index Toggle Pages: 1