diff --git a/example/example.xcodeproj/project.pbxproj b/example/example.xcodeproj/project.pbxproj index 349eec1..c2e9c5c 100644 --- a/example/example.xcodeproj/project.pbxproj +++ b/example/example.xcodeproj/project.pbxproj @@ -83,7 +83,7 @@ 39C1248819F1EB75005DF557 /* SurfaceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1248319F1EB75005DF557 /* SurfaceManager.cpp */; }; 39C1248919F1EB75005DF557 /* SurfaceManagerGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C1248519F1EB75005DF557 /* SurfaceManagerGui.cpp */; }; 39C787BD1AC2111B00691393 /* CmdManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C787BC1AC2111B00691393 /* CmdManager.cpp */; }; - 39FA2B801C457606003FAB28 /* Settings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FA2B7E1C457606003FAB28 /* Settings.cpp */; }; + 39FA2B801C457606003FAB28 /* SettingsLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39FA2B7E1C457606003FAB28 /* SettingsLoader.cpp */; }; E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; }; E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */; }; @@ -305,8 +305,8 @@ 39C1248719F1EB75005DF557 /* SurfaceType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurfaceType.h; sourceTree = ""; }; 39C787BB1AC20D2400691393 /* CmdManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CmdManager.h; path = Commands/CmdManager.h; sourceTree = ""; }; 39C787BC1AC2111B00691393 /* CmdManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CmdManager.cpp; path = Commands/CmdManager.cpp; sourceTree = ""; }; - 39FA2B7E1C457606003FAB28 /* Settings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Settings.cpp; sourceTree = ""; }; - 39FA2B7F1C457606003FAB28 /* Settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Settings.h; sourceTree = ""; }; + 39FA2B7E1C457606003FAB28 /* SettingsLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SettingsLoader.cpp; sourceTree = ""; }; + 39FA2B7F1C457606003FAB28 /* SettingsLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsLoader.h; sourceTree = ""; }; 39FDD9EA1AC007BF00262205 /* BaseCmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseCmd.h; path = Commands/BaseCmd.h; sourceTree = ""; }; BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = ""; }; E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; @@ -428,8 +428,8 @@ children = ( 3968416A1BC91F6F009F0BAE /* Application.h */, 396841691BC91F6F009F0BAE /* Application.cpp */, - 39FA2B7F1C457606003FAB28 /* Settings.h */, - 39FA2B7E1C457606003FAB28 /* Settings.cpp */, + 39FA2B7F1C457606003FAB28 /* SettingsLoader.h */, + 39FA2B7E1C457606003FAB28 /* SettingsLoader.cpp */, 3968416C1BC91F6F009F0BAE /* ApplicationBaseState.h */, 3968416B1BC91F6F009F0BAE /* ApplicationBaseState.cpp */, 3968416E1BC91F6F009F0BAE /* PresentationState.h */, @@ -969,7 +969,7 @@ 39C1248819F1EB75005DF557 /* SurfaceManager.cpp in Sources */, 396841771BC91F6F009F0BAE /* PresentationState.cpp in Sources */, 39A9AAF21B054FC300AA83BC /* MvSurfaceVertCmd.cpp in Sources */, - 39FA2B801C457606003FAB28 /* Settings.cpp in Sources */, + 39FA2B801C457606003FAB28 /* SettingsLoader.cpp in Sources */, 39C1244319EE9589005DF557 /* LinkFilter.cpp in Sources */, 39C1245919F086A9005DF557 /* BaseSource.cpp in Sources */, 39C1244019EE9589005DF557 /* FileExtensionFilter.cpp in Sources */, diff --git a/src/Application/Settings.cpp b/src/Application/Settings.cpp deleted file mode 100644 index c8023fa..0000000 --- a/src/Application/Settings.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "Settings.h" - -namespace ofx { -namespace piMapper { - -Settings::Settings(){} - -void Settings::load(){ - -} - -void Settings::save(){ - -} - -} // namespace piMapper -} // namespace ofx \ No newline at end of file diff --git a/src/Application/Settings.h b/src/Application/Settings.h deleted file mode 100644 index 2df4ad5..0000000 --- a/src/Application/Settings.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "ofMain.h" - -namespace ofx { -namespace piMapper { - -class Settings { - public: - Settings(); - - void load(); - void save(); -}; - -} -} \ No newline at end of file diff --git a/src/Application/SettingsLoader.cpp b/src/Application/SettingsLoader.cpp new file mode 100644 index 0000000..f4a00b4 --- /dev/null +++ b/src/Application/SettingsLoader.cpp @@ -0,0 +1,240 @@ +#include "SettingsLoader.h" + +namespace ofx { +namespace piMapper { + +SettingsLoader * SettingsLoader::_instance = 0; + +SettingsLoader * SettingsLoader::instance(){ + if(_instance == 0){ + _instance = new ofx::piMapper::SettingsLoader(); + } + return _instance; +} + +bool SettingsLoader::load(SurfaceStack & surfaces, MediaServer & mediaServer, string fileName){ + + ofxXmlSettings * xmlSettings = new ofxXmlSettings(); + + if(!xmlSettings->loadFile(fileName)){ + ofLogWarning("SurfaceManager") << "Could not load XML settings"; + return false; + } + + if(!xmlSettings->tagExists("surfaces")){ + ofLogWarning("SurfaceManager") << "XML settings is empty or has wrong markup"; + return false; + } + + xmlSettings->pushTag("surfaces"); + + int numSurfaces = xmlSettings->getNumTags("surface"); + for(int i = 0; i < numSurfaces; i++){ + xmlSettings->pushTag("surface", i); + + // attempt to load surface source + xmlSettings->pushTag("source"); + string sourceType = xmlSettings->getValue("source-type", ""); + string sourceName = xmlSettings->getValue("source-name", ""); + BaseSource * source = 0; + if(sourceName != "" && sourceName != "none" && sourceType != ""){ + + // Load source depending on type + int typeEnum = SourceType::GetSourceTypeEnum(sourceType); + if(typeEnum == SourceType::SOURCE_TYPE_FBO){ + // Load FBO source using sourceName + source = mediaServer.loadMedia(sourceName, typeEnum); + }else{ + // Construct full path + string dir = mediaServer.getDefaultMediaDir(typeEnum); + stringstream pathss; + pathss << ofToDataPath(dir, true) << sourceName; + string sourcePath = pathss.str(); + // Load media by using full path + source = mediaServer.loadMedia(sourcePath, typeEnum); + } + } + xmlSettings->popTag(); // source + xmlSettings->pushTag("vertices"); + vector vertices; + int vertexCount = xmlSettings->getNumTags("vertex"); + + if(vertexCount == 3){ + xmlSettings->pushTag("vertex", 0); + vertices.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), + xmlSettings->getValue("y", 0.0f))); + xmlSettings->popTag(); + + xmlSettings->pushTag("vertex", 1); + vertices.push_back(ofVec2f(xmlSettings->getValue("x", 100.0f), + xmlSettings->getValue("y", 0.0f))); + xmlSettings->popTag(); + + xmlSettings->pushTag("vertex", 2); + vertices.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), + xmlSettings->getValue("y", 100.0f))); + xmlSettings->popTag(); + + xmlSettings->popTag(); // vertices + + xmlSettings->pushTag("texCoords"); + + vector texCoords; + + xmlSettings->pushTag("texCoord", 0); + texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), + xmlSettings->getValue("y", 0.0f))); + xmlSettings->popTag(); + + xmlSettings->pushTag("texCoord", 1); + texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 1.0f), + xmlSettings->getValue("y", 0.0f))); + xmlSettings->popTag(); + + xmlSettings->pushTag("texCoord", 2); + texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), + xmlSettings->getValue("y", 1.0f))); + xmlSettings->popTag(); + + xmlSettings->popTag(); // texCoords + + // Create and add a triangle surface + BaseSurface * triangleSurface = + SurfaceFactory::instance()->createSurface( + SurfaceType::TRIANGLE_SURFACE); + triangleSurface->setVertices(vertices); + triangleSurface->setTexCoords(texCoords); + + if(sourceName != "none" && source != 0){ + triangleSurface->setSource(source); + } + + surfaces.push_back(triangleSurface); + + }else if(vertexCount == 4){ + xmlSettings->pushTag("vertex", 0); + vertices.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), + xmlSettings->getValue("y", 0.0f))); + xmlSettings->popTag(); + + xmlSettings->pushTag("vertex", 1); + vertices.push_back(ofVec2f(xmlSettings->getValue("x", 100.0f), + xmlSettings->getValue("y", 0.0f))); + xmlSettings->popTag(); + + xmlSettings->pushTag("vertex", 2); + vertices.push_back(ofVec2f(xmlSettings->getValue("x", 100.0f), + xmlSettings->getValue("y", 100.0f))); + xmlSettings->popTag(); + + xmlSettings->pushTag("vertex", 3); + vertices.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), + xmlSettings->getValue("y", 100.0f))); + xmlSettings->popTag(); + + xmlSettings->popTag(); // vertices + + xmlSettings->pushTag("texCoords"); + + vector texCoords; + + xmlSettings->pushTag("texCoord", 0); + texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), + xmlSettings->getValue("y", 0.0f))); + xmlSettings->popTag(); + + xmlSettings->pushTag("texCoord", 1); + texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 1.0f), + xmlSettings->getValue("y", 0.0f))); + xmlSettings->popTag(); + + xmlSettings->pushTag("texCoord", 2); + texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 1.0f), + xmlSettings->getValue("y", 1.0f))); + xmlSettings->popTag(); + + xmlSettings->pushTag("texCoord", 3); + texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), + xmlSettings->getValue("y", 1.0f))); + xmlSettings->popTag(); + + xmlSettings->popTag(); // texCoords + + // Create and add quad surface + BaseSurface * quadSurface = + SurfaceFactory::instance()->createSurface( + SurfaceType::QUAD_SURFACE); + quadSurface->setVertices(vertices); + quadSurface->setTexCoords(texCoords); + + if(sourceName != "none" && source != 0){ + quadSurface->setSource(source); + } + + surfaces.push_back(quadSurface); + } + + xmlSettings->popTag(); // surface + } + + xmlSettings->popTag(); // surfaces + + return true; +} + +bool SettingsLoader::save(SurfaceStack & surfaces, string fileName){ + + ofxXmlSettings * xmlSettings = new ofxXmlSettings(); + + // Save surfaces + xmlSettings->addTag("surfaces"); + xmlSettings->pushTag("surfaces"); + for(int i = 0; i < surfaces.size(); i++){ + xmlSettings->addTag("surface"); + xmlSettings->pushTag("surface", i); + BaseSurface * surface = surfaces[i]; + + xmlSettings->addTag("vertices"); + xmlSettings->pushTag("vertices"); + vector * vertices = &surface->getVertices(); + for(int j = 0; j < vertices->size(); j++){ + xmlSettings->addTag("vertex"); + xmlSettings->pushTag("vertex", j); + ofVec3f * vertex = &(*vertices)[j]; + xmlSettings->addValue("x", vertex->x); + xmlSettings->addValue("y", vertex->y); + + // we don't need z as it will be 0 anyways + + xmlSettings->popTag(); // vertex + } + xmlSettings->popTag(); // vertices + + xmlSettings->addTag("texCoords"); + xmlSettings->pushTag("texCoords"); + vector * texCoords = &surface->getTexCoords(); + for(int j = 0; j < texCoords->size(); j++){ + xmlSettings->addTag("texCoord"); + xmlSettings->pushTag("texCoord", j); + ofVec2f * texCoord = &(*texCoords)[j]; + xmlSettings->addValue("x", texCoord->x); + xmlSettings->addValue("y", texCoord->y); + xmlSettings->popTag(); // texCoord + } + xmlSettings->popTag(); // texCoords + xmlSettings->addTag("source"); + xmlSettings->pushTag("source"); + + string sourceTypeName = SourceType::GetSourceTypeName(surface->getSource()->getType()); + + xmlSettings->addValue("source-type", sourceTypeName); + xmlSettings->addValue("source-name", surface->getSource()->getName()); + xmlSettings->popTag(); // source + xmlSettings->popTag(); // surface + } + xmlSettings->popTag(); // surfaces + xmlSettings->save(fileName); +} + +} // namespace piMapper +} // namespace ofx \ No newline at end of file diff --git a/src/Application/SettingsLoader.h b/src/Application/SettingsLoader.h new file mode 100644 index 0000000..65b8363 --- /dev/null +++ b/src/Application/SettingsLoader.h @@ -0,0 +1,25 @@ +#pragma once + +#include "ofMain.h" +#include "ofxXmlSettings.h" +#include "SurfaceStack.h" +#include "MediaServer.h" +#include "SurfaceFactory.h" +#include "SurfaceType.h" + +namespace ofx { +namespace piMapper { + +class SettingsLoader { + public: + static SettingsLoader * instance(); + + bool load(SurfaceStack & surfaces, MediaServer & mediaServer, string fileName); + bool save(SurfaceStack & surfaces, string fileName); + + private: + static SettingsLoader * _instance; +}; + +} +} \ No newline at end of file diff --git a/src/Surfaces/SurfaceManager.cpp b/src/Surfaces/SurfaceManager.cpp index 2f12862..f5359bb 100644 --- a/src/Surfaces/SurfaceManager.cpp +++ b/src/Surfaces/SurfaceManager.cpp @@ -55,227 +55,17 @@ void SurfaceManager::saveXmlSettings(string fileName){ ofLogFatalError("SurfaceManager") << "Media server not set"; exit(EXIT_FAILURE); } - xmlSettings.clear(); - - // Save surfaces - xmlSettings.addTag("surfaces"); - xmlSettings.pushTag("surfaces"); - for(int i = 0; i < _surfaces.size(); i++){ - xmlSettings.addTag("surface"); - xmlSettings.pushTag("surface", i); - BaseSurface * surface = _surfaces[i]; - - xmlSettings.addTag("vertices"); - xmlSettings.pushTag("vertices"); - vector * vertices = &surface->getVertices(); - for(int j = 0; j < vertices->size(); j++){ - xmlSettings.addTag("vertex"); - xmlSettings.pushTag("vertex", j); - ofVec3f * vertex = &(*vertices)[j]; - xmlSettings.addValue("x", vertex->x); - xmlSettings.addValue("y", vertex->y); - - // we don't need z as it will be 0 anyways - - xmlSettings.popTag(); // vertex - } - xmlSettings.popTag(); // vertices - - xmlSettings.addTag("texCoords"); - xmlSettings.pushTag("texCoords"); - vector * texCoords = &surface->getTexCoords(); - for(int j = 0; j < texCoords->size(); j++){ - xmlSettings.addTag("texCoord"); - xmlSettings.pushTag("texCoord", j); - ofVec2f * texCoord = &(*texCoords)[j]; - xmlSettings.addValue("x", texCoord->x); - xmlSettings.addValue("y", texCoord->y); - xmlSettings.popTag(); // texCoord - } - xmlSettings.popTag(); // texCoords - xmlSettings.addTag("source"); - xmlSettings.pushTag("source"); - string sourceTypeName = SourceType::GetSourceTypeName(surface->getSource()->getType()); - cout << "sourceTypeName: " << sourceTypeName << endl; - xmlSettings.addValue("source-type", sourceTypeName); - xmlSettings.addValue("source-name", surface->getSource()->getName()); - xmlSettings.popTag(); // source - xmlSettings.popTag(); // surface - } - xmlSettings.popTag(); // surfaces - xmlSettings.save(fileName); + + SettingsLoader::instance()->save(_surfaces, fileName); } bool SurfaceManager::loadXmlSettings(string fileName){ - - // Exit if there is no media server if(mediaServer == 0){ ofLogFatalError("SurfaceManager") << "Media server not set"; exit(EXIT_FAILURE); } - if(!xmlSettings.loadFile(fileName)){ - ofLogWarning("SurfaceManager") << "Could not load XML settings"; - return false; - } - if(!xmlSettings.tagExists("surfaces")){ - ofLogWarning("SurfaceManager") << "XML settings is empty or has wrong markup"; - return false; - } - - xmlSettings.pushTag("surfaces"); - - int numSurfaces = xmlSettings.getNumTags("surface"); - for(int i = 0; i < numSurfaces; i++){ - xmlSettings.pushTag("surface", i); - - // attempt to load surface source - xmlSettings.pushTag("source"); - string sourceType = xmlSettings.getValue("source-type", ""); - string sourceName = xmlSettings.getValue("source-name", ""); - BaseSource * source = 0; - if(sourceName != "" && sourceName != "none" && sourceType != ""){ - - // Load source depending on type - int typeEnum = SourceType::GetSourceTypeEnum(sourceType); - if(typeEnum == SourceType::SOURCE_TYPE_FBO){ - // Load FBO source using sourceName - source = mediaServer->loadMedia(sourceName, typeEnum); - }else{ - // Construct full path - string dir = mediaServer->getDefaultMediaDir(typeEnum); - stringstream pathss; - pathss << ofToDataPath(dir, true) << sourceName; - string sourcePath = pathss.str(); - // Load media by using full path - source = mediaServer->loadMedia(sourcePath, typeEnum); - } - } - xmlSettings.popTag(); // source - xmlSettings.pushTag("vertices"); - vector vertices; - int vertexCount = xmlSettings.getNumTags("vertex"); - - if(vertexCount == 3){ - xmlSettings.pushTag("vertex", 0); - vertices.push_back(ofVec2f(xmlSettings.getValue("x", 0.0f), - xmlSettings.getValue("y", 0.0f))); - xmlSettings.popTag(); - - xmlSettings.pushTag("vertex", 1); - vertices.push_back(ofVec2f(xmlSettings.getValue("x", 100.0f), - xmlSettings.getValue("y", 0.0f))); - xmlSettings.popTag(); - - xmlSettings.pushTag("vertex", 2); - vertices.push_back(ofVec2f(xmlSettings.getValue("x", 0.0f), - xmlSettings.getValue("y", 100.0f))); - xmlSettings.popTag(); - - xmlSettings.popTag(); // vertices - - xmlSettings.pushTag("texCoords"); - - vector texCoords; - - xmlSettings.pushTag("texCoord", 0); - texCoords.push_back(ofVec2f(xmlSettings.getValue("x", 0.0f), - xmlSettings.getValue("y", 0.0f))); - xmlSettings.popTag(); - - xmlSettings.pushTag("texCoord", 1); - texCoords.push_back(ofVec2f(xmlSettings.getValue("x", 1.0f), - xmlSettings.getValue("y", 0.0f))); - xmlSettings.popTag(); - - xmlSettings.pushTag("texCoord", 2); - texCoords.push_back(ofVec2f(xmlSettings.getValue("x", 0.0f), - xmlSettings.getValue("y", 1.0f))); - xmlSettings.popTag(); - - xmlSettings.popTag(); // texCoords - - // Create and add a triangle surface - BaseSurface * triangleSurface = - SurfaceFactory::instance()->createSurface( - SurfaceType::TRIANGLE_SURFACE); - triangleSurface->setVertices(vertices); - triangleSurface->setTexCoords(texCoords); - - if(sourceName != "none" && source != 0){ - triangleSurface->setSource(source); - } - - addSurface(triangleSurface); - - }else if(vertexCount == 4){ - xmlSettings.pushTag("vertex", 0); - vertices.push_back(ofVec2f(xmlSettings.getValue("x", 0.0f), - xmlSettings.getValue("y", 0.0f))); - xmlSettings.popTag(); - - xmlSettings.pushTag("vertex", 1); - vertices.push_back(ofVec2f(xmlSettings.getValue("x", 100.0f), - xmlSettings.getValue("y", 0.0f))); - xmlSettings.popTag(); - - xmlSettings.pushTag("vertex", 2); - vertices.push_back(ofVec2f(xmlSettings.getValue("x", 100.0f), - xmlSettings.getValue("y", 100.0f))); - xmlSettings.popTag(); - - xmlSettings.pushTag("vertex", 3); - vertices.push_back(ofVec2f(xmlSettings.getValue("x", 0.0f), - xmlSettings.getValue("y", 100.0f))); - xmlSettings.popTag(); - - xmlSettings.popTag(); // vertices - - xmlSettings.pushTag("texCoords"); - - vector texCoords; - - xmlSettings.pushTag("texCoord", 0); - texCoords.push_back(ofVec2f(xmlSettings.getValue("x", 0.0f), - xmlSettings.getValue("y", 0.0f))); - xmlSettings.popTag(); - - xmlSettings.pushTag("texCoord", 1); - texCoords.push_back(ofVec2f(xmlSettings.getValue("x", 1.0f), - xmlSettings.getValue("y", 0.0f))); - xmlSettings.popTag(); - - xmlSettings.pushTag("texCoord", 2); - texCoords.push_back(ofVec2f(xmlSettings.getValue("x", 1.0f), - xmlSettings.getValue("y", 1.0f))); - xmlSettings.popTag(); - - xmlSettings.pushTag("texCoord", 3); - texCoords.push_back(ofVec2f(xmlSettings.getValue("x", 0.0f), - xmlSettings.getValue("y", 1.0f))); - xmlSettings.popTag(); - - xmlSettings.popTag(); // texCoords - - // Create and add quad surface - BaseSurface * quadSurface = - SurfaceFactory::instance()->createSurface( - SurfaceType::QUAD_SURFACE); - quadSurface->setVertices(vertices); - quadSurface->setTexCoords(texCoords); - - if(sourceName != "none" && source != 0){ - quadSurface->setSource(source); - } - - addSurface(quadSurface); - } - - xmlSettings.popTag(); // surface - } - - xmlSettings.popTag(); // surfaces - return true; + return SettingsLoader::instance()->load(_surfaces, *mediaServer, fileName); } void SurfaceManager::setMediaServer(MediaServer * newMediaServer){ diff --git a/src/Surfaces/SurfaceManager.h b/src/Surfaces/SurfaceManager.h index e0cc600..4093f96 100644 --- a/src/Surfaces/SurfaceManager.h +++ b/src/Surfaces/SurfaceManager.h @@ -12,6 +12,7 @@ #include "ofEvents.h" #include "ofxXmlSettings.h" +#include "SettingsLoader.h" using namespace std;