diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/testApp.cpp | 36 | ||||
| -rw-r--r-- | src/testApp.h | 3 |
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 |
