diff options
Diffstat (limited to 'testDir')
| -rw-r--r-- | testDir/src/dirscanner.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/testDir/src/dirscanner.cpp b/testDir/src/dirscanner.cpp index fc233d5..34dec9b 100644 --- a/testDir/src/dirscanner.cpp +++ b/testDir/src/dirscanner.cpp @@ -5,9 +5,21 @@ void playItem::play(){ } bool playItem::load(string filename){ ofFile file(filename); - string ext=file.getExtension(); - ofLogNotice() << "item "<<i<<": "<<start<<" - "<<end<<" "<<dir.getPath(i); - + string ext=ofToLower(file.getExtension()); + loaded=0; + if (ext=="jpg"||ext=="png"){ + if (image.load(filename)){ + ofLogNotice() << "loaded image: "<<filename; + loaded=1; + } + } + if (ext=="mkv"||ext=="mov"){ + if (video.load(filename)){ + ofLogNotice() << "loaded clip: "<<filename; + loaded=2; + } + } + return loaded>0; } void playItem::draw(){ @@ -60,13 +72,13 @@ int dirScanner::getSlotForTime(){ void dirPlayer::load(std::string path){ items.clear(); ofDirectory dir(path); - dir.allowExt("mp4"); + dir.allowExt("mkv"); dir.allowExt("mov"); dir.allowExt("jpg"); // dir.allowExt("png"); dir.listDir(); for(int i = 0; i < dir.size(); i++){ - string d=dir.getName(i); + string d=dir.getPath(i); playItem item; if (item.load(d)){ items.push_back(item); |
