本文整理汇总了C++中ofVideoPlayer::setPaused方法的典型用法代码示例。如果您正苦于以下问题:C++ ofVideoPlayer::setPaused方法的具体用法?C++ ofVideoPlayer::setPaused怎么用?C++ ofVideoPlayer::setPaused使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofVideoPlayer
的用法示例。
在下文中一共展示了ofVideoPlayer::setPaused方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyPressed
//--------------------------------------------------------------
void ofApp::keyPressed(int key){
ofLogVerbose() << "ON : key " << key;
// [space]: toggle pause and resume
if(key == 32){
if(video.isPlaying()){
bool paused = video.isPaused();
const char* status = (!paused)? "[pause]": "[resume]";
ofLogNotice() << "Video: " << status;
video.setPaused(!paused);
}else{
ofLogNotice() << "Video: [play]";
video.play();
}
// [e] or [s]: save frame
}else if(key == 101 || key == 115){
string path = currentDateWithCount() + ".png";
ofPixels* pix = new ofPixels();
video.setPaused(true);
pix->setFromPixels(video.getPixels(), vw, vh, OF_IMAGE_COLOR);
ofSaveImage(*pix, path, OF_IMAGE_QUALITY_MEDIUM);
ofLogWarning() << "\nSaved frame to \"" << path << "\"" << endl;
// left key: forward
}else if(key == 356){
vVector = 1.0;
applyVideoMatrix();
// right key: backward
}else if(key == 358){
vVector = -1.0;
applyVideoMatrix();
// [0]: very slow speed
}else if(key == 48){
vSpeed = 0.25;
applyVideoMatrix();
// [1]: normal speed
}else if(key == 49){
vSpeed = 1.0;
applyVideoMatrix();
// [2]: fast speed
}else if(key == 50){
vSpeed = 2.0;
applyVideoMatrix();
// [9]: slow speed
}else if(key == 57){
vSpeed = 0.5;
applyVideoMatrix();
}
}
示例2: applyVideoMatrix
void ofApp::applyVideoMatrix(){
bool stopped = video.isPaused();
video.setSpeed(vVector * vSpeed);
ofLogNotice() << "Speed: " << vSpeed << ", Vector: " << vVector;
if(stopped){
video.setPaused(true);
}
}
示例3: update
//--------------------------------------------------------------
void testApp::update(){
vid.update();
if( mode == "full" ){
fullVid.update();
if( fullVid.isPlaying() && ofGetElapsedTimef() > timer ){
fullVid.setPaused(true);
}
}
}
示例4: mouseReleased
//--------------------------------------------------------------
void testApp::mouseReleased(int x, int y, int button){
if(mode == "full" && bDown){
thumbs[selected].pos = ofMap(x, 0, ofGetWidth(), 0, 0.9999, true);
thumbs[selected].savePos();
fullVid.setPosition(thumbs[selected].pos);
fullVid.update();
fullVid.setPaused(false);
fullVid.play();
timer = ofGetElapsedTimef() + NUM_SECS;
}
if( mode == "move" ){
if( bDown ){
reorganizeThumbs();
}
}
bDown = false;
}