diff options
| -rw-r--r-- | bin/data/settings.xml | 8 | ||||
| -rw-r--r-- | src/testApp.cpp | 36 | ||||
| -rw-r--r-- | src/testApp.h | 3 |
3 files changed, 42 insertions, 5 deletions
diff --git a/bin/data/settings.xml b/bin/data/settings.xml index 47e851e..46a83b5 100644 --- a/bin/data/settings.xml +++ b/bin/data/settings.xml @@ -6,6 +6,10 @@ <view> <settings x="0.500000" y="0.000000" w="0.500000" h="1.000000" distort="0.000000" fov="17.250000" roll="90.0" targX="0.000000" targY="112.000000" targZ="0.000000" lat="0.000000" lng="0.000000" dolly="1000.000000" /> </view> - <clip file="stripey2.mov"/> - <clip file="gradblend01.mov"/> + <clip> + <settings file="stripey2.mov"/> + </clip> + <clip> + <settings file="gradblend01.mov"/> + </clip> </map4> 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 |
