diff options
| -rw-r--r-- | menuApp/addons.make | 1 | ||||
| -rw-r--r-- | menuApp/src/dirscanner.cpp | 28 | ||||
| -rw-r--r-- | menuApp/src/dirscanner.h | 7 |
3 files changed, 30 insertions, 6 deletions
diff --git a/menuApp/addons.make b/menuApp/addons.make index b771d86..cb0f7f4 100644 --- a/menuApp/addons.make +++ b/menuApp/addons.make @@ -1,4 +1,5 @@ ofxInstagram ofxJSON ofxThreadedImageLoader +ofxOMXPlayer diff --git a/menuApp/src/dirscanner.cpp b/menuApp/src/dirscanner.cpp index 5ba830b..2c98104 100644 --- a/menuApp/src/dirscanner.cpp +++ b/menuApp/src/dirscanner.cpp @@ -3,7 +3,7 @@ void playItem::play(){ //ofLogNotice() << "playing----->"<<filename; if (video.isLoaded()){ - video.setFrame(0); + //video.setFrame(0); video.play(); //ofLogNotice() << "video: "<<filename; } @@ -24,14 +24,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 +60,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; } } diff --git a/menuApp/src/dirscanner.h b/menuApp/src/dirscanner.h index 4512842..f6351e5 100644 --- a/menuApp/src/dirscanner.h +++ b/menuApp/src/dirscanner.h @@ -1,6 +1,7 @@ #pragma once #include "ofMain.h" +#include "ofxOMXPlayer.h" class timeSlot { public: @@ -26,7 +27,11 @@ class playItem { } string filename; ofImage image; - ofVideoPlayer video; + //ofVideoPlayer video; + + ofxOMXPlayer video; + ofxOMXPlayerSettings videosettings; + int loaded; //0- none, 1- image, 2- mov bool load(string filename); void play(); |
