diff --git a/src/Application/Modes/ProjectionMappingMode.cpp b/src/Application/Modes/ProjectionMappingMode.cpp index 22cba71..0019b7a 100644 --- a/src/Application/Modes/ProjectionMappingMode.cpp +++ b/src/Application/Modes/ProjectionMappingMode.cpp @@ -285,6 +285,10 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg } break; + case 'n': // Set next preset + app->getSurfaceManager()->setNextPreset(); + break; + default: break; } diff --git a/src/Application/SettingsLoader.cpp b/src/Application/SettingsLoader.cpp index 4fa88b9..46726ec 100644 --- a/src/Application/SettingsLoader.cpp +++ b/src/Application/SettingsLoader.cpp @@ -32,12 +32,6 @@ bool SettingsLoader::load( return false; } - /* TODO: Add presets. - * Presets would be surface groups. Now we are using a single tag - * to store only one possible composition. We can multiply the container - * in order to get presets working. - */ - if(!xmlSettings->tagExists("surfaces")){ ofLogWarning("SettingsLoader::load()") << "XML settings is empty or has wrong markup"; return false; @@ -47,13 +41,14 @@ bool SettingsLoader::load( cout << "numPresets: " << numPresets << endl; // Clear previous presets and surfaces first. - // TODO... + surfaceManager.clearPresets(); - // Add new presets. - // surfaceManager.createPreset... - SurfaceStack * surfaces = surfaceManager.createPreset(); + // Loop through tags in the XML. + for(unsigned int i = 0; i < numPresets; ++i){ - xmlSettings->pushTag("surfaces"); + xmlSettings->pushTag("surfaces", i); + + SurfaceStack * surfaces = surfaceManager.createPreset(); int numSurfaces = xmlSettings->getNumTags("surface"); for(int i = 0; i < numSurfaces; i++){ @@ -139,6 +134,8 @@ bool SettingsLoader::load( } xmlSettings->popTag(); // surfaces + + } // for } _lastLoadedFilename = fileName; diff --git a/src/Application/SettingsLoader.h b/src/Application/SettingsLoader.h index 4bdab36..50f2cfd 100644 --- a/src/Application/SettingsLoader.h +++ b/src/Application/SettingsLoader.h @@ -34,5 +34,5 @@ class SettingsLoader { string _lastLoadedFilename; }; -} -} \ No newline at end of file +} // namespace piMapper +} // namespace ofx \ No newline at end of file