//--------------------------------------------------------------
void testApp::newExperimentState(string & state){
#ifdef DEBUG_PRINT 
	printf("newExperimentState()\n");
#endif
	if (logData) {
		logger.lock();
		std::stringstream ss;
		ss << myGetElapsedTimeMillis() << "," << vLogFormat << "," << EXPERIMENT_STATE_CODE << 
			"," << state << ",\n";
		logger.loggerQueue.push(ss.str());
		logger.unlock();
	}
	if (state == ExperimentGovernor::getStateString(ExperimentGovernor::StimulusPresentation)) {
		if (freqOutThread.isThreadRunning()) freqOutThread.lock();
		std::vector<FreqOutThread::freqInterval> temp = settings.freqCycleExp;
		ofRandomize(temp);
		freqOutThread.setFreqCycle(temp);
		freqOutThread.resetFreqCycle();
		if (freqOutThread.isThreadRunning()) freqOutThread.unlock();
	}
	if (state == ExperimentGovernor::getStateString(ExperimentGovernor::Congratulations)) {
		if (freqOutThread.isThreadRunning()) freqOutThread.lock();
		freqOutThread.setFreqCycle(settings.freqCycle);
		freqOutThread.resetFreqCycle();
		if (freqOutThread.isThreadRunning()) freqOutThread.unlock();
	}
}
예제 #2
0
//--------------------------------------------------------------
void testApp::keyPressed  (int key){
    if(key =='e'){
		mode = "edit";
		ofSetWindowShape(1280, 900);
		reSort();
	}
	if( key == 'p' ){
		//startRender();
		mode = "play-back";
		whichVideo = 0;
		totalFrames = 0;
		framecounter = 0;		
		nextVideo();	
		ofSetWindowShape(1024, 576);

		img.setUseTexture(false);
		img.allocate(1024, 576, OF_IMAGE_COLOR);
				
	}
	if( key == 'P' ){
		//startRender();
		mode = "play";
		whichVideo = 0;
		totalFrames = 0;
		framecounter = 0;		
		nextVideo();	
		ofSetWindowShape(1024, 576);

		img.setUseTexture(false);
		img.allocate(1024, 576, OF_IMAGE_COLOR);
				
	}
	if( key == 'r' ){
		mode = "edit";
		cout << "random shuffle"<<endl;
		ofRandomize(thumbs);
	}
	if( key == 'l' ){
		loadOrder();
	}
	if( key == 'm' ){
		mode = "move";
		ofSetWindowShape(1280, 900);
		reSort();		
	}
	
}
예제 #3
0
void randomizeThumbs(){
	ofRandomize(thumbs);

	reSort();
}