コード例 #1
0
ファイル: ofxTLBangs.cpp プロジェクト: alg-a/GAmuza
void ofxTLBangs::update(){
//	if(isPlaying || timeline->getIsPlaying()){
		long thisTimelinePoint = currentTrackTime();
		for(int i = 0; i < keyframes.size(); i++){
			if(timeline->getInOutRangeMillis().contains(keyframes[i]->time) && lastTimelinePoint < keyframes[i]->time && thisTimelinePoint >= keyframes[i]->time){
//				ofLogNotice() << "fired bang with accuracy of " << (keyframes[i]->time - thisTimelinePoint) << endl;
				bangFired(keyframes[i]);
				lastBangTime = ofGetElapsedTimef();
			}
		}
		lastTimelinePoint = thisTimelinePoint;
//	}
}
コード例 #2
0
ファイル: ofxTLBangs.cpp プロジェクト: imclab/ofxTimeline
void ofxTLBangs::update(){
	if(isPlayingBack){
		long thisTimelinePoint = timeline->getCurrentTimeMillis();
		for(int i = 0; i < keyframes.size(); i++){
			if(lastTimelinePoint < keyframes[i]->time && thisTimelinePoint >= keyframes[i]->time){
				ofLogNotice() << "fired bang with accuracy of " << (keyframes[i]->time - thisTimelinePoint) << endl;
				bangFired(keyframes[i]);
				lastBangTime = ofGetElapsedTimef();
			}
		}
		lastTimelinePoint = thisTimelinePoint;
	}
}