#include "dirscanner.h" void playItem::play(){ //ofLogNotice() << "playing----->"<0; } void playItem::draw(){ if (image.isAllocated()){ //ofEnableAlphaBlending(); //ofSetColor(255,255,255,1.0); image.draw(0,0,1080*FACTOR,1920*FACTOR); //ofDisableAlphaBlending(); if (ofGetElapsedTimef()-startTime>5.0){ isFinished=true; } } if (video.isLoaded()){ video.update(); video.draw(0,0,1080*FACTOR,1920*FACTOR); //ofLogNotice() << "position: "<=railwaytime){ return i; } } else { if (slots[i].end>=railwaytime||slots[i].start<=railwaytime){ return i; } } } return -1; } 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 "<