summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-02-02 17:07:11 +0000
committerTim Redfern <tim@eclectronics.org>2012-02-02 17:07:11 +0000
commitdc4013f1380e9fabd6565c741664daed6d8cd7db (patch)
tree9ce42e152009bce6e1b79100c8fcbc40801cf31c /src
parent46f714e3ccb1949706c734944b4ecc3adde0dec3 (diff)
multi clips
Diffstat (limited to 'src')
-rw-r--r--src/testApp.cpp36
-rw-r--r--src/testApp.h3
2 files changed, 36 insertions, 3 deletions
diff --git a/src/testApp.cpp b/src/testApp.cpp
index f8078fb..4aaa009 100644
--- a/src/testApp.cpp
+++ b/src/testApp.cpp
@@ -23,13 +23,14 @@ void testApp::setup(){
//ofDisableArbTex();
- texture.loadMovie("stripey2.mov");
- texture.play();
-
mode=CALIBRATE;
loadSettings("settings.xml");
+ whichClip=0;
+ texture.loadMovie(clips[whichClip]);
+ texture.play();
+
light=true;
}
@@ -104,6 +105,21 @@ void testApp::keyPressed(int key){
case 'z':
loadSettings("defaults.xml");
break;
+ case ',':
+ case '<':
+ whichClip--;
+ if (whichClip<0) whichClip+=numClips;
+ texture.close();
+ texture.loadMovie(clips[whichClip]);
+ texture.play();
+ break;
+ case '.':
+ case '>':
+ whichClip=(whichClip+1)%numClips;
+ texture.close();
+ texture.loadMovie(clips[whichClip]);
+ texture.play();
+ break;
case '/':
light=!light;
printf(light?"LIGHT ON\n":"LIGHT OFF\n");
@@ -133,7 +149,21 @@ void testApp::loadSettings(string filename){
XML.popTag();
}
}
+
+ numClips=XML.getNumTags("clip");
+ if (numClips) {
+ clips=new string[numClips];
+ for (int i=0;i< numClips;i++) {
+ XML.pushTag("clip",i);
+ clips[i]=XML.getAttribute("settings","file","none",0);
+ XML.popTag();
+ }
+ }
+
XML.popTag();
+ for (int i=0;i< numClips;i++) {
+ printf("clip: %s\n",clips[i].c_str());
+ }
}
printf("loaded settings: %i views\n",numViews);
}
diff --git a/src/testApp.h b/src/testApp.h
index d0710e2..63e922d 100644
--- a/src/testApp.h
+++ b/src/testApp.h
@@ -54,6 +54,9 @@ class testApp : public ofBaseApp{
ofx3DModelLoader bottle;
ofVideoPlayer texture;
+ string* clips;
+ int numClips;
+ int whichClip;
viewpoint* views;
int activeView; //receives keypresses