From 87c535995a59391b50a242a9a71bc0c420da399c Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 13 Jun 2017 23:34:14 +0100 Subject: looking good --- menuApp/src/dirscanner.cpp | 107 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 95 insertions(+), 12 deletions(-) (limited to 'menuApp/src/dirscanner.cpp') diff --git a/menuApp/src/dirscanner.cpp b/menuApp/src/dirscanner.cpp index 5798e55..d0f80a0 100644 --- a/menuApp/src/dirscanner.cpp +++ b/menuApp/src/dirscanner.cpp @@ -1,13 +1,56 @@ #include "dirscanner.h" void playItem::play(){ - + //ofLogNotice() << "playing----->"<0; } void playItem::draw(){ + if (image.isAllocated()){ -} -bool playItem::isFinished(){ + //ofEnableAlphaBlending(); + //ofSetColor(255,255,255,1.0); + image.draw(0,0,ofGetWidth(),ofGetHeight()); + //ofDisableAlphaBlending(); + if (ofGetElapsedTimef()-startTime>5.0){ + isFinished=true; + } + } + if (video.isLoaded()){ + video.update(); + video.draw(0,0,ofGetWidth(),ofGetHeight()); + //ofLogNotice() << "position: "<=time){ + if (slots[i].start<=railwaytime&&slots[i].end>=railwaytime){ return i; } } return -1; } -void dirPlayer::load(){ - +void dirPlayer::load(std::string path){ + items.clear(); + ofDirectory dir(path); + dir.allowExt("mp4"); + dir.allowExt("mov"); + dir.allowExt("jpg"); + dir.allowExt("png"); + dir.listDir(); + for(int i = 0; i < dir.size(); i++){ + string d=dir.getPath(i); + playItem item; + if (item.load(d)){ + ofLogNotice() << "pushing back: "<getSlotForTime(); + if(slot==-1) return false; + if (slot!=currentslot){ + if (slot>-1){ + ofLogNotice() << "entering slot "<slots[slot].path; + load(scanner->slots[slot].path); + } + else { + ofLogNotice() << "leaving slot"; + } + currentslot=slot; + } + if (items[currentItem].isFinished){ + items[currentItem].isFinished=false; + currentItem=(currentItem+1)%items.size(); + items[currentItem].play(); + ofLogNotice() << "playing clip "<