Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

urgent question about video related code! help me..

$
0
0

This is the main tab for my code.

import ddf.minim.*;
import processing.video.*;

Movie mov;
Minim minim;
AudioPlayer s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, bg1, bg2, bg3, bg4, currentBackingTrack;;

PImage bg;
PFont font;
int num = 500;

// the tune
char t[] = new char[num];

int key_num = 0;

int val;
int notetime;
int currentBackingTrackDelay;

// for play
int startTime=0;
int startTimeBGM=0;
int iForPlaySong=0;
boolean playSong=false;

// for video
boolean mo = true;

int countPlaying = 0;

void setup() {
  fullScreen();

  bg = loadImage("paper.jpg");
  bg.resize(displayWidth, displayHeight);
  mov = new Movie(this, "hello.mov");
  mov.play();

  font = createFont("Albertsthal Typewriter.ttf", 64);
  textFont(font, 64);
  fill(40);

  minim = new Minim(this);

  s1 = minim.loadFile("1.mp3");
  s2 = minim.loadFile("2.mp3");
  s3 = minim.loadFile("3.mp3");
  s4 = minim.loadFile("4.mp3");
  s5 = minim.loadFile("5.mp3");
  s6 = minim.loadFile("6.mp3");
  s7 = minim.loadFile("7.mp3");
  s8 = minim.loadFile("8.mp3");
  s9 = minim.loadFile("9.mp3");
  s10 = minim.loadFile("10.mp3");
  s11 = minim.loadFile("11.mp3");
  s12 = minim.loadFile("12.mp3");
  s13 = minim.loadFile("13.mp3");
  s14 = minim.loadFile("14.mp3");

  bg1 = minim.loadFile("bg1.mp3");
  bg2 = minim.loadFile("bg2.mp3");
  bg3 = minim.loadFile("bg3.mp3");
  bg4 = minim.loadFile("bg4.mp3");
}

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


void draw() {

  // for the intro video

  if ( mo == true) {
    image(mov, 0, 0);
  }

  if (mo && mov.time() >= mov.duration()) {
    mov.stop();
    mo = false;
    background(bg);

    // two main situations

    if (playSong)
    {
      playTheSong();
    } else
    {
      readTheInputs();
    }
  }
}

Without video related codes, It works perfectly.

However when I put video codes, I can't see the readTheInputs part.

I think I had a mistake on align this code..

Can you help me to fix this?


Viewing all articles
Browse latest Browse all 2896

Trending Articles