diff options
Diffstat (limited to 'menuApp/src/dirscanner.cpp')
| -rw-r--r-- | menuApp/src/dirscanner.cpp | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/menuApp/src/dirscanner.cpp b/menuApp/src/dirscanner.cpp index 5ba830b..5a8b91b 100644 --- a/menuApp/src/dirscanner.cpp +++ b/menuApp/src/dirscanner.cpp @@ -2,9 +2,10 @@ void playItem::play(){ //ofLogNotice() << "playing----->"<<filename; - if (video.isLoaded()){ - video.setFrame(0); - video.play(); + if (video.getIsOpen()){ + //video.setFrame(0); + //video.play(); + video.restartMovie(); //ofLogNotice() << "video: "<<filename; } if (image.isAllocated()){ @@ -24,14 +25,30 @@ bool playItem::load(string _filename){ } } if (ext=="mp4"||ext=="mov"){ + /* if (video.load(filename)){ video.setLoopState(OF_LOOP_NONE); ofLogNotice() << "loaded clip: "<<filename; loaded=2; } - } + */ + string videoPath1 = ofToDataPath(_filename, true); + videosettings.videoPath = videoPath1; + videosettings.useHDMIForAudio = true; //default true + videosettings.enableTexture = true; //default true + videosettings.enableLooping = true; //default true + videosettings.enableAudio = false; //default true, save resources by disabling + + if (video.setup(videosettings)){ + //video.setLoopState(OF_LOOP_NONE); + ofLogNotice() << "loaded clip: "<<filename; + loaded=2; + } + return loaded>0; + } } + void playItem::draw(){ if (image.isAllocated()){ @@ -44,11 +61,13 @@ void playItem::draw(){ isFinished=true; } } - if (video.isLoaded()){ - video.update(); + //if (video.isLoaded()){ + //video.update(); + if (video.getIsOpen()){ video.draw(0,0,1080*FACTOR,1920*FACTOR); //ofLogNotice() << "position: "<<video.getPosition(); - if (video.getIsMovieDone()){ + //if (video.getIsMovieDone()){ + if (!video.isPlaying()){ isFinished=true; } } |
