From a3e2f621d761c74ea357c7292fe97c98238794da Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Tue, 29 Dec 2015 16:39:22 +0000 Subject: [PATCH] Add `ofxPiMapper::loadXmlSettings()` method. --- src/ofxPiMapper.cpp | 15 +++++++++++++++ src/ofxPiMapper.h | 1 + 2 files changed, 16 insertions(+) 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(){