diff options
| author | tim <tim@eclectronics.org> | 2017-06-13 23:10:55 +0100 |
|---|---|---|
| committer | tim <tim@eclectronics.org> | 2017-06-13 23:10:55 +0100 |
| commit | edeccbd160c72553d789516b40d4b922df848aac (patch) | |
| tree | abe08020cb9d965b98abf1755d150ea371b88666 /testDir/src/dirscanner.cpp | |
| parent | e7d2892633ba9761a8ab8cc98f812e2db89e8beb (diff) | |
dirscanner playing
Diffstat (limited to 'testDir/src/dirscanner.cpp')
| -rw-r--r-- | testDir/src/dirscanner.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/testDir/src/dirscanner.cpp b/testDir/src/dirscanner.cpp index f3aa974..c3101a5 100644 --- a/testDir/src/dirscanner.cpp +++ b/testDir/src/dirscanner.cpp @@ -1,12 +1,13 @@ #include "dirscanner.h" void playItem::play(){ + ofLogNotice() << "playing----->"<<filename; if (video.isLoaded()){ video.play(); - ofLogNotice() << "playing video: "<<filename; + ofLogNotice() << "video: "<<filename; } if (image.isAllocated()){ - ofLogNotice() << "playing still: "<<filename; + ofLogNotice() << "still: "<<filename; } startTime=ofGetElapsedTimef(); } @@ -23,6 +24,7 @@ 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; } @@ -34,7 +36,7 @@ void playItem::draw(){ //ofEnableAlphaBlending(); //ofSetColor(255,255,255,1.0); - image.draw(0,0); + image.draw(0,0,ofGetWidth(),ofGetHeight()); //ofDisableAlphaBlending(); if (ofGetElapsedTimef()-startTime>5.0){ @@ -42,7 +44,9 @@ void playItem::draw(){ } } if (video.isLoaded()){ - video.draw(0,0); + video.update(); + video.draw(0,0,ofGetWidth(),ofGetHeight()); + //ofLogNotice() << "position: "<<video.getPosition(); if (video.getIsMovieDone()){ isFinished=true; } @@ -102,11 +106,13 @@ void dirPlayer::load(std::string path){ string d=dir.getPath(i); playItem item; if (item.load(d)){ + ofLogNotice() << "pushing back: "<<i; items.push_back(item); } } - currentItem=0; ofLogNotice() << "found "<<items.size()<<" items"; + currentItem=items.size()-1; + items[currentItem].isFinished=true; } @@ -126,6 +132,7 @@ void dirPlayer::draw(){ items[currentItem].isFinished=false; currentItem=(currentItem+1)%items.size(); items[currentItem].play(); + ofLogNotice() << "playing clip "<<currentItem<<" - "<<(items[currentItem].loaded==0?"none":items[currentItem].loaded==1?"image":"mov"); } items[currentItem].draw(); |
