import processing.video.*;
MovieMaker mm;
int numFrames = 79;
PImage[] images = new PImage[numFrames];
// variables for display-timings
int frame =0;
int frameStart =0;
int displayTime = 500;
void setup() {
size(1400, 900);
///////
mm = new MovieMaker(this,width,height,"/Documents/lindermovie.mov", 30, MovieMaker.JPEG, MovieMaker.HIGH);
///////
for (int i = 0; i <79; i++) {
if (i < 8){
String imageName = "E" + 1 + "_" + (i+1) + ".jpg";
images[i] = loadImage(imageName);}
if (i>=8 && i<16){
String imageName = "E" + 2 + "_" + (i-7) + ".jpg";
images[i] = loadImage(imageName);}
if(i>=16 && i<24){
String imageName = "E" + 3 + "_" + (i-15) + ".jpg";
images[i] = loadImage(imageName);}
if(i>=24 && i<32){
String imageName = "E" + 4 + "_" + (i-23) + ".jpg";
images[i] = loadImage(imageName);}
if(i>=32 && i<40){
String imageName = "E" + 5 + "_" + (i-31) + ".jpg";
images[i] = loadImage(imageName);}
if(i>=40 && i<48){
String imageName = "E" + 6 + "_" + (i-39) + ".jpg";
images[i] = loadImage(imageName);}
////////////ROW B//////////////////
if (i>=48 && i<56){
String imageName = "F" + 1 + "_" + (i-47) + ".jpg";
images[i] = loadImage(imageName);}
if (i>=56 && i<64){
String imageName = "F" + 2 + "_" + (i-55) + ".jpg";
images[i] = loadImage(imageName);}
if(i>=64 && i<72){
String imageName = "F" + 3 + "_" + (i-63) + ".jpg";
images[i] = loadImage(imageName);}
if(i>=72 && i<79){
String imageName = "F" + 4 + "_" + (i-71) + ".jpg";
images[i] = loadImage(imageName);}
}
}
void draw() {
if (frame <79){
image(images[frame], 0, 0);
}
else{
frame=0;
}
println(frame);
// switch to next image, after 'displayTime'
if (millis()-frameStart > displayTime) {
frameStart = millis();
frame++;
}
}
void keyPressed() { //MOVIEMAKER
if (key == ' ') { //MOVIEMAKER
// Finish the movie if space bar is pressed //MOVIEMAKER
mm.finish(); //MOVIEMAKER
// Quit running the sketch once the file is written //MOVIEMAKER
exit(); //MOVIEMAKER
} //MOVIEMAKER
} //MOVIEMAKER