예제 #1
0
void redEyeApp::setup() {
    
    //-settings
    mListener.setup(43334);  //osc input port
    
    //--defaults
    mHide= false;       //also keydown 'i'
    mError= "";
    mOsc= "";
    mMode= 5;
    mAmplitude= 0.0f;
    mNumSamples= 512;
    mDownSample= 0;
    mWidth= 1.0f;
    mColorBack= ColorA(0.0f, 0.0f, 0.0f, 1.0f);
    
    //mVisible0= mVisible1= true;
    mScale0= mScale1= Vec3f(1.0f, 1.0f, 1.0f);
    mTranslate0= mTranslate1= Vec3f::zero();
    mColor0= ColorA(1.0f, 0.0f, 0.0f, 1.0f);
    mColor1= ColorA(0.0f, 1.0f, 0.0f, 1.0f);
    
    //--audio
    mInput= audio::Input();     //use default input device
    mInput.start();             //start capturing
    
    //--shaders
    mPathFrag= getPathDirectory(app::getAppPath().string())+"data/_default_frag.glsl";
    mPathVert= getPathDirectory(app::getAppPath().string())+"data/_default_vert.glsl";
    //loadShader();
    
    //--parameter window
    mParams= params::InterfaceGl::create(getWindow(), "redEye", toPixels(Vec2i(200, 400)));
    //mParams->addText("text", ("label=`redEye`"));
    mParams->addParam("NumSamples", &mNumSamples, "min=1 max=2048 step=1");
    mParams->addParam("DownSample", &mDownSample, "min=0 max=2047 step=1");
    mParams->addParam("Width", &mWidth, "min=0 max=1000 step=1");
    mParams->addParam("Back color", &mColorBack, "");
    mParams->addSeparator();
    //mParams->addParam("Visible", &mVisible0);
    mParams->addParam("Scale", &mScale0);
    mParams->addParam("Rotate", &mRotate0);
    mParams->addParam("Translate", &mTranslate0);
    mParams->addParam("Color", &mColor0, "");
    /*mParams->addSeparator();
    mParams->addParam("Visible1", &mVisible1);
    mParams->addParam("Scale1", &mScale1);
    mParams->addParam("Rotate1", &mRotate1);
    mParams->addParam("Translate1", &mTranslate1);
    mParams->addParam("Color1", &mColor1, "");*/
    
    //mParams->addParam("Cube Size", &mObjSize, "min=0.1 max=20.5 step=0.5 keyIncr=z keyDecr=Z");
    mParams->addSeparator();
    mParams->addParam("String00", &mNameFrag, "label=`frag (f):`");
    mParams->addParam("String01", &mNameVert, "label=`vert (v):`");
    mParams->addParam("String02", &mError, "label=`error:`");
    mParams->addParam("String03", &mOsc, "label=`osc:`");
    mParams->addParam("String04", &mMode, "label=`mode (m):`");
    mParams->addParam("String05", &mFps, "label=`fps:`");
}
예제 #2
0
void TouchAudioTestApp::setup()
{
	//mAudioSource = audio::load( loadResource( RES_BOOYAH ) );
	//initialize the audio Input, using the default input device
	mInput = audio::Input();
	
	//tell the input to start capturing audio
	mInput.start();
	
}
void shader02vertexApp::setup() {
    
    //--defaults
    mHide= false;       //also keydown 'i'
    mError= "";
    mMode= 0;
    mAmplitude= 0.0f;
    mMouse= Vec2f(0.0f, 0.0f);
    
    //--audio
    mInput= audio::Input();     //use default input device
    mInput.start();             //start capturing
    
    //--shader
    mPathFrag= getPathDirectory(app::getAppPath().string())+"data/_default_frag.glsl";
    mPathVert= getPathDirectory(app::getAppPath().string())+"data/_default_vert.glsl";
    loadShader();
}
예제 #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();
}