diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-02-02 16:35:12 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-02-02 16:35:12 +0000 |
| commit | 46f714e3ccb1949706c734944b4ecc3adde0dec3 (patch) | |
| tree | 3ca96ff897d7fc15190398e4459b25c7ee4309dc /src/testApp.cpp | |
| parent | 1641253a1f8f6c5e7e7efa676c27e24c82893dfb (diff) | |
settings with defaults
Diffstat (limited to 'src/testApp.cpp')
| -rw-r--r-- | src/testApp.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/testApp.cpp b/src/testApp.cpp index 37717fa..f8078fb 100644 --- a/src/testApp.cpp +++ b/src/testApp.cpp @@ -1,7 +1,7 @@ #include "testApp.h" //-------------------------------------------------------------- testApp::~testApp(){ - saveSettings(); + saveSettings("settings.xml"); } //-------------------------------------------------------------- void testApp::setup(){ @@ -23,12 +23,12 @@ void testApp::setup(){ //ofDisableArbTex(); - texture.loadMovie("gradblend01.mov"); + texture.loadMovie("stripey2.mov"); texture.play(); mode=CALIBRATE; - loadSettings(); + loadSettings("settings.xml"); light=true; } @@ -99,8 +99,10 @@ void testApp::keyPressed(int key){ activeView=1; break; case 'p': - saveSettings(); - printf("saved settings.xml\n"); + saveSettings("settings.xml"); + break; + case 'z': + loadSettings("defaults.xml"); break; case '/': light=!light; @@ -110,10 +112,10 @@ void testApp::keyPressed(int key){ } } -void testApp::loadSettings(){ +void testApp::loadSettings(string filename){ //viewport settings are float/ normalised to 0..1 - if( !XML.loadFile("settings.xml") ){ - printf("unable to load settings.xml check data/ folder\n"); + if( !XML.loadFile(filename) ){ + printf("unable to load %s check data/ folder\n",filename.c_str()); }else{ if(XML.pushTag("map4")) { numViews=XML.getNumTags("view"); @@ -142,7 +144,7 @@ void testApp::loadSettings(){ //activeView=0; } //-------------------------------------------------------------- -void testApp::saveSettings(){ +void testApp::saveSettings(string filename){ //either re-navigate the whole thing OR //save the number to the vp OR //send a pointer to the vp @@ -160,7 +162,8 @@ void testApp::saveSettings(){ } XML.popTag(); } - XML.saveFile("settings.xml"); + XML.saveFile(filename); + printf("saved %s\n",filename.c_str()); } //-------------------------------------------------------------- void testApp::keyReleased(int key){ |
