From 6ae491eea38055ebe3ba1154f0e916d7bbf95040 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 22 May 2017 21:31:33 +0100 Subject: directory reader in test case --- testDir/src/dirscanner.cpp | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 testDir/src/dirscanner.cpp (limited to 'testDir/src/dirscanner.cpp') diff --git a/testDir/src/dirscanner.cpp b/testDir/src/dirscanner.cpp new file mode 100644 index 0000000..feb29c1 --- /dev/null +++ b/testDir/src/dirscanner.cpp @@ -0,0 +1,71 @@ +#include "dirscanner.h" + +void playItem::play(){ + +} +void playItem::draw(){ + +} +bool playItem::isFinished(){ + +} + +void dirScanner::scan(){ + /* + parse directories and create structure + showing which folder to check at which time + */ + slots.clear(); + + ofDirectory dir(rootdir); + + dir.allowExt(""); //get directories + + dir.listDir(); + for(int i = 0; i < dir.size(); i++){ + string d=dir.getName(i); + int start = ofToInt(d.substr(0,4)); + int end = ofToInt(d.substr(5,4)); + + if (start&&end){ + slots.push_back(timeSlot(dir.getPath(i),start,end)); + ofLogNotice() << "item "<=railwaytime){ + return i; + } + } + return -1; +} + +void dirPlayer::load(){ + +} + +void dirPlayer::draw(){ + int slot=scanner->getSlotForTime(); + if (slot!=currentslot){ + if (slot>-1){ + ofLogNotice() << "entering slot "<slots[slot].path; + } + else { + ofLogNotice() << "leaving slots"; + } + currentslot=slot; + } + + +} \ No newline at end of file -- cgit v1.2.3