From 1a1928259fa1df68b41a4763c28baa32a78a37c5 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Tue, 25 Oct 2016 16:18:43 +0300 Subject: [PATCH] Rename setActivePreset to setPreset --- src/Application/Application.cpp | 4 ++-- src/Application/Application.h | 2 +- src/Commands/SetActivePresetCmd.cpp | 4 ++-- src/Surfaces/SurfaceManager.cpp | 2 +- src/Surfaces/SurfaceManager.h | 2 +- src/ofxPiMapper.cpp | 4 ++-- src/ofxPiMapper.h | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Application/Application.cpp b/src/Application/Application.cpp index 037b73a..bb825f4 100644 --- a/src/Application/Application.cpp +++ b/src/Application/Application.cpp @@ -238,7 +238,7 @@ void Application::onCharacterReceived(KeyListenerEventData & e){ onKeyPressed(args); } -void Application::setActivePreset(unsigned int i){ +void Application::setPreset(unsigned int i){ _cmdManager.exec(new SetActivePresetCmd(this, i)); } @@ -253,7 +253,7 @@ void Application::setNextPreset(){ }else{ activePreset += 1; } - setActivePreset(activePreset); + setPreset(activePreset); } bool Application::loadXmlSettings(string fileName){ diff --git a/src/Application/Application.h b/src/Application/Application.h index a67e31f..0080bce 100644 --- a/src/Application/Application.h +++ b/src/Application/Application.h @@ -76,7 +76,7 @@ class Application : public KeyListener { void setProjectionMode(); void setSourceMode(); - void setActivePreset(unsigned int i); + void setPreset(unsigned int i); void setNextPreset(); protected: diff --git a/src/Commands/SetActivePresetCmd.cpp b/src/Commands/SetActivePresetCmd.cpp index 5e6c109..1dc896f 100644 --- a/src/Commands/SetActivePresetCmd.cpp +++ b/src/Commands/SetActivePresetCmd.cpp @@ -13,12 +13,12 @@ void SetActivePresetCmd::exec(){ _prevPresetIndex = _app->getSurfaceManager()->getActivePresetIndex(); _app->getSurfaceManager()->deselectSurface(); _selectedSurfaceIndex = _app->getSurfaceManager()->getSelectedSurfaceIndex(); - _app->getSurfaceManager()->setActivePreset(_newPresetIndex); + _app->getSurfaceManager()->setPreset(_newPresetIndex); } void SetActivePresetCmd::undo(){ ofLogNotice("SetActivePresetCmd", "undo"); - _app->getSurfaceManager()->setActivePreset(_prevPresetIndex); + _app->getSurfaceManager()->setPreset(_prevPresetIndex); _app->getSurfaceManager()->selectSurface(_selectedSurfaceIndex); } diff --git a/src/Surfaces/SurfaceManager.cpp b/src/Surfaces/SurfaceManager.cpp index 7b6a0ad..3e380f8 100644 --- a/src/Surfaces/SurfaceManager.cpp +++ b/src/Surfaces/SurfaceManager.cpp @@ -434,7 +434,7 @@ void SurfaceManager::setNextPreset(){ // TODO: Create command for this. } -void SurfaceManager::setActivePreset(unsigned int i){ +void SurfaceManager::setPreset(unsigned int i){ if(_presets.size() <= 1){ throw runtime_error("ofxPiMapper: No presets to set."); } diff --git a/src/Surfaces/SurfaceManager.h b/src/Surfaces/SurfaceManager.h index e340e2a..9b9147a 100644 --- a/src/Surfaces/SurfaceManager.h +++ b/src/Surfaces/SurfaceManager.h @@ -72,7 +72,7 @@ class SurfaceManager { SurfaceStack * getPresetAt(unsigned int i); void setNextPreset(); - void setActivePreset(unsigned int i); + void setPreset(unsigned int i); void cloneActivePreset(); void eraseActivePreset(); diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index 9ee6dad..1349b09 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -22,8 +22,8 @@ void ofxPiMapper::registerFboSource(ofx::piMapper::FboSource * fboSource){ _application.addFboSource(fboSource); } -void ofxPiMapper::setActivePreset(unsigned int i){ - _application.setActivePreset(i); +void ofxPiMapper::setPreset(unsigned int i){ + _application.setPreset(i); } void ofxPiMapper::setNextPreset(){ diff --git a/src/ofxPiMapper.h b/src/ofxPiMapper.h index dec0a43..80c64e0 100644 --- a/src/ofxPiMapper.h +++ b/src/ofxPiMapper.h @@ -49,7 +49,7 @@ class ofxPiMapper { // Presets unsigned int getNumPresets(); unsigned int getActivePresetIndex(); - void setActivePreset(unsigned int i); + void setPreset(unsigned int i); void setNextPreset(); void cloneActivePreset(); void eraseActivePreset();