Ok, thanks for the fast reply. Here is the code so far:
Quote:
import JMyron.*;
import moviemaker.*;
JMyron m;
MovieMaker mm;
boolean grabar;
boolean comienzo;
int d = day();
int mo = month();
int y = year();
void setup(){
size(320,240);
m = new JMyron();
m.start(width,height);
m.findGlobs(0);
println("Myron " + m.version());
println("Forced Dimensions: " + m.getForcedWidth() + " " + m.getForcedHeight());
loadPixels();
mm = new MovieMaker(this,width,height,"Memiro.mov", MovieMaker.JPEG, MovieMaker.HIGH,30);
}
void draw() {
m.update();
m.imageCopy(pixels);
PFont font;
font = loadFont("Ziggurat-HTF-Black-32.vlw");
updatePixels();
textFont(font, 10);
String s = String.valueOf(d);
text(s, 0, 10);
s = String.valueOf(mo);
text(s, 20, 10);
s = String.valueOf(y);
text(s, 35, 10);
comienzo = true;
if(keyPressed) {
if (key == 'j' || key == 'J') {
grabar = true;
println("Grabando");
} else if (key == 'k' || key == 'K') {
grabar = false;
println("No está grabando");
} else if (key == 's' || key == 'S') {
mm.finishMovie();
stop(); // termina el programa
}
}
if (grabar) {
mm.addFrame(pixels,width,height);
comienzo = false;
}
if(comienzo){
textFont (font, 14);
text("Presione J para grabar", 100, 210);
fill(250, 250, 210);
text("Presione K para pausar", 100, 225);
fill(250, 250, 210);
text("Presione S para terminar", 100, 240);
fill(250, 250, 210);
}
}
public void stop(){
m.stop();
super.stop();
}