From e49c8555552c76b526a798f16ec5327fe443141a Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 25 May 2017 00:21:51 +0100 Subject: load logic --- testDir/src/dirscanner.cpp | 28 ++++++++++++++++++++++++---- testDir/src/dirscanner.h | 8 +++++++- 2 files changed, 31 insertions(+), 5 deletions(-) (limited to 'testDir') diff --git a/testDir/src/dirscanner.cpp b/testDir/src/dirscanner.cpp index feb29c1..fc233d5 100644 --- a/testDir/src/dirscanner.cpp +++ b/testDir/src/dirscanner.cpp @@ -2,6 +2,12 @@ void playItem::play(){ +} +bool playItem::load(string filename){ + ofFile file(filename); + string ext=file.getExtension(); + ofLogNotice() << "item "<-1){ ofLogNotice() << "entering slot "<slots[slot].path; + load(scanner->slots[slot].path); } else { - ofLogNotice() << "leaving slots"; + ofLogNotice() << "leaving slot"; } currentslot=slot; } diff --git a/testDir/src/dirscanner.h b/testDir/src/dirscanner.h index f78c6d5..dfc0847 100644 --- a/testDir/src/dirscanner.h +++ b/testDir/src/dirscanner.h @@ -16,12 +16,18 @@ class timeSlot { class playItem { public: + playItem(){ + loaded=0; + } playItem(std::string _n){ filename=_n; + playItem(); } string filename; ofImage image; ofVideoPlayer video; + int loaded; //0- none, 1- image, 2- mov + bool load(string filename); void play(); void draw(); bool isFinished(); @@ -53,6 +59,6 @@ class dirPlayer { string playdir; int currentslot; dirScanner *scanner; - void load(); + void load(std::string path); void draw(); }; \ No newline at end of file -- cgit v1.2.3