本文整理汇总了C++中ofVideoPlayer::setPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ ofVideoPlayer::setPosition方法的具体用法?C++ ofVideoPlayer::setPosition怎么用?C++ ofVideoPlayer::setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofVideoPlayer
的用法示例。
在下文中一共展示了ofVideoPlayer::setPosition方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mousePressed
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
if( mode == "edit" ){
for(int i = 0; i < thumbs.size(); i++){
if(thumbs[i].r.inside(x,y)){
mode = "full";
selected = i;
fullVid.loadMovie(thumbs[i].video);
fullVid.setPosition(thumbs[i].pos);
fullVid.update();
break;
}
}
}
else if(mode == "full" ){
thumbs[selected].pos = ofMap(x, 0, ofGetWidth(), 0, 0.9999, true);
fullVid.setPosition(thumbs[selected].pos);
fullVid.update();
bDown = true;
}
if( mode == "move" ){
for(int i = 0; i < thumbs.size(); i++){
if(thumbs[i].r.inside(x,y)){
selected = i;
bDown = true;
break;
}
}
placedIndex = selected;
}
}
示例2: nextVideo
void nextVideo(){
if( whichVideo < thumbs.size() ){
vid.loadMovie(thumbs[whichVideo].video);
vid.play();
vid.update();
vid.setPosition(thumbs[whichVideo].pos);
if( mode == "play" ){
vid.setSpeed(0.25);
}
whichVideo++;
framecounter = 0;
}else{
std::exit(0);
}
}
示例3: 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;
}
示例4: mouseDragged
//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
if(mode == "full" && bDown){
thumbs[selected].pos = ofMap(x, 0, ofGetWidth(), 0, 0.9999, true);
fullVid.setPosition(thumbs[selected].pos);
fullVid.update();
}
else if( mode == "move" && bDown ){
for(int i = 0; i < thumbs.size(); i++){
ofRectangle tr = thumbs[i].r;
if( tr.inside(x,y) ){
placedIndex = i;
cout << "placedIndex " << placedIndex <<endl;
}
}
}
}
示例5: mouseDragged
//--------------------------------------------------------------
void ofApp::mouseDragged(int x, int y, int button){
ofLogNotice() << "Position: " << x/w << "";
video.setPosition(x / w);
}