Пример #1
0
void QuickTimeSampleApp::loadMovieFile( const fs::path& moviePath )
{
	try {
		// load up the movie, set it to loop, and begin playing
		mMovie = qtime::MovieGl( moviePath );
		mMovie.setLoop();
		mMovie.play();
		
		// create a texture for showing some info about the movie
		TextLayout infoText;
		infoText.clear( ColorA( 0.2f, 0.2f, 0.2f, 0.5f ) );
		infoText.setColor( Color::white() );
		infoText.addCenteredLine( getPathFileName( moviePath.string() ) );
		infoText.addLine( toString( mMovie.getWidth() ) + " x " + toString( mMovie.getHeight() ) + " pixels" );
		infoText.addLine( toString( mMovie.getDuration() ) + " seconds" );
		infoText.addLine( toString( mMovie.getNumFrames() ) + " frames" );
		infoText.addLine( toString( mMovie.getFramerate() ) + " fps" );
		infoText.setBorder( 4, 2 );
		mInfoTexture = gl::Texture( infoText.render( true ) );
	}
	catch( ... ) {
		console() << "Unable to load the movie." << std::endl;
		mMovie.reset();
		mInfoTexture.reset();
	}

	mFrameTexture.reset();
}
Пример #2
0
/**
 * Increment Movie
 * Restarts and stpos current movie, then begins playing next movie in mMovieList without volumne.
 */
void svvimApp::incrementMovie () {
  mCurrentMovie.setLoop(true);
  /*
  // If movie is on, seek to start and stop
  if (mCurrentMovie) {
    mCurrentMovie.seekToStart();
    mCurrentMovie.setLoop(false);
    mCurrentMovie.stop();
  }
  
  // Increment movie index
  mMovieIndex = (mMovieIndex + 1) % 6;
  
  // Get the next movie from the list, start it from the beginning, and turn the volume off
  mCurrentMovie = mMovieList[mMovieIndex];
  mCurrentMovie.setVolume(0.);
  mCurrentMovie.play();
  mCurrentMovie.seekToStart();
   */
}
Пример #3
0
void VideoPanApp::loadMovieFile( const string &moviePath )
{
	try {
		mMovie = qtime::MovieGl( moviePath );
		
		console() << "Dimensions:" << mMovie.getWidth() << " x " << mMovie.getHeight() << std::endl;
		console() << "Duration:  " << mMovie.getDuration() << " seconds" << std::endl;
		console() << "Frames:    " << mMovie.getNumFrames() << std::endl;
		console() << "Framerate: " << mMovie.getFramerate() << std::endl;
		console() << "Alpha channel: " << mMovie.hasAlpha() << std::endl;		
		console() << "Has audio: " << mMovie.hasAudio() << " Has visuals: " << mMovie.hasVisuals() << std::endl;
		
		
		mMovie.setLoop( true, true );
		mMovie.seekToFrame(24000);
		mMovie.setVolume(0);
		mMovie.play();
		mMovie.stop();
	}
	catch( ... ) {
		console() << "Unable to load the movie." << std::endl;
	}	
}
Пример #4
0
void svvimApp::setup() {
  mLastElapsedSecondsSwitch = 0;
  mPerlinGenerator = Perlin();
  
  mBgTextureList = new gl::Texture [3];
  
  
  
  mPoolWaterMovie = qtime::MovieGl(getResourcePath("water-over.m4v"));
  mPoolWaterMovie.setLoop();
  mPoolWaterMovie.play();
  
  mMovieList = new qtime::MovieGl [13];
  
  mMovieList[ 0] = qtime::MovieGl(getResourcePath("SVVIM4_VIS_04.mov"));
  mMovieList[ 1] = qtime::MovieGl(getResourcePath("SVVIM4_VIS_08.mov"));
  mMovieList[ 2] = qtime::MovieGl(getResourcePath("SVVIM4_VIS_10.mov"));
  mMovieList[ 3] = qtime::MovieGl(getResourcePath("SVVIM4_VIS_11.mov"));
  mMovieList[ 4] = qtime::MovieGl(getResourcePath("SVVIM4_VIS_07.mov"));
  mMovieList[ 5] = qtime::MovieGl(getResourcePath("movie-006.mov"));
  mMovieList[ 6] = qtime::MovieGl(getResourcePath("movie-002.mov"));
  mMovieList[ 7] = qtime::MovieGl(getResourcePath("movie-008.mov"));
  mMovieList[ 8] = qtime::MovieGl(getResourcePath("movie-009.mov"));
  mMovieList[ 9] = qtime::MovieGl(getResourcePath("movie-010.mov"));
  mMovieList[10] = qtime::MovieGl(getResourcePath("movie-011.mov"));
  mMovieList[11] = qtime::MovieGl(getResourcePath("movie-012.mov"));
  mMovieList[12] = qtime::MovieGl(getResourcePath("movie-013.mov"));
  
  // Load Svvim Logo from PNG
  
  app::console() << "setup\n";
  
  // Compile shader
  try {
    mShader = gl::GlslProg(loadResource(RES_VERT_GLSL), loadResource(RES_FRAG_GLSL));
  }
  catch (const std::exception & e) {
    mShader = gl::GlslProg();
    console() << "Compile error in shader: " << e.what() << "\n";
  }
  
  // Begin reading MIC
  mInput = audio::Input();
  mInput.start();
  
  //
  mMovieIndex = 4;
  
  mCurrentMovie = mMovieList[mMovieIndex];
  
  mCurrentMovie.play();
  mCurrentMovie.setVolume(0.);
  
  gl::Texture::Format format;
  format.setTargetRect();
  
  mImageTexture = gl::Texture(loadImage(loadResource("saturday-night.jpg")), format);
  mSvvimLogoPng = gl::Texture(loadImage(loadResource(RES_SVVIM_LOGO_PNG)), format);
  mCurrentBgTexture = gl::Texture(loadImage(loadResource("bgMarble.png")), format);
  
  mCurrentMovie.seekToTime(82.);
  
  gl::enableAlphaBlending();
}