diff options
| author | Tim Redfern <tim@eclectronics.org> | 2018-04-16 01:24:01 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2018-04-16 01:24:01 +0000 |
| commit | 0fc7051c2b4a4d77377742f50185f9a71ef4637b (patch) | |
| tree | d2af26ce44271896acaa6594e3a252b45a5c5f9d /menuApp/src/dirscanner.cpp | |
| parent | 7c080ed914ad1291bc07cd8b6ce58e5093b14203 (diff) | |
OMX for hangdai
Diffstat (limited to 'menuApp/src/dirscanner.cpp')
| -rw-r--r-- | menuApp/src/dirscanner.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
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; } } |
