diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index c9a1b3c..59a6925 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -59,6 +59,21 @@ void ofxPiMapper::registerFboSource(ofx::piMapper::FboSource & fboSource){ mediaServer.addFboSource(fboSource); } +bool ofxPiMapper::loadXmlSettings(string fileName){ + /* + if(surfaceManager == 0){ + ofLogNotice("ofxPiMapper::loadXmlSettings()") << "Could not load XML settings as the surfaceManager is not initialized yet."; + return; + } + */ + if(!ofFile::doesFileExist(fileName)){ + ofLogNotice("ofxPiMapper::loadXmlSettings()") << "Settings file does not exist."; + return false; + } + surfaceManager.loadXmlSettings(fileName); + return true; +} + void ofxPiMapper::addTriangleSurface(){ int surfaceType = ofx::piMapper::SurfaceType::TRIANGLE_SURFACE; diff --git a/src/ofxPiMapper.h b/src/ofxPiMapper.h index dd5a431..ce975ac 100644 --- a/src/ofxPiMapper.h +++ b/src/ofxPiMapper.h @@ -27,6 +27,7 @@ class ofxPiMapper { void setup(); void draw(); void registerFboSource(ofx::piMapper::FboSource & fboSource); + bool loadXmlSettings(string fileName); void addTriangleSurface(); void addQuadSurface(); void showInfo(){