summaryrefslogtreecommitdiff
path: root/testDir/src
diff options
context:
space:
mode:
authortim <tim@eclectronics.org>2017-05-28 22:12:27 +0100
committertim <tim@eclectronics.org>2017-05-28 22:12:27 +0100
commit7a201017da4b0aedd79bb93747c855fe63b5ede9 (patch)
treed43d69b41d2dc02d16f9bf5fcca369df6a39e2e3 /testDir/src
parente49c8555552c76b526a798f16ec5327fe443141a (diff)
video playback issue
Diffstat (limited to 'testDir/src')
-rw-r--r--testDir/src/dirscanner.cpp22
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);