From 05c7185ba9a69e3c75fbd5f7788c9806aff4b5e5 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Thu, 20 Oct 2016 21:46:22 +0200 Subject: [PATCH] Add ofxPiMapper::selectSurface --- src/ofxPiMapper.cpp | 6 ++++++ src/ofxPiMapper.h | 12 +++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index 8b804cc..5a0b020 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -40,6 +40,12 @@ void ofxPiMapper::eraseActivePreset(){ _application.getSurfaceManager()->eraseActivePreset(); } +void ofxPiMapper::selectSurface(int i){ + if(_application.getState() == ofx::piMapper::PresentationMode::instance()){ + _application.getSurfaceManager()->selectSurface(i); + } +} + void ofxPiMapper::togglePauseForSurface(unsigned int i){ ofx::piMapper::BaseSource * s = _application.getSurfaceManager()->getActivePreset()->getSurfaces().at(i)->getSource(); diff --git a/src/ofxPiMapper.h b/src/ofxPiMapper.h index 1f6da26..d153a1d 100644 --- a/src/ofxPiMapper.h +++ b/src/ofxPiMapper.h @@ -47,21 +47,19 @@ class ofxPiMapper { ofxPiMapper::Mode getMode(); // Presets + unsigned int getNumPresets(); + unsigned int getActivePresetIndex(); void setActivePreset(unsigned int i); void setNextPreset(); void cloneActivePreset(); void eraseActivePreset(); - // Toggle play/pause for a surface in the active preset. + // Surfaces, active preset + unsigned int getNumSurfaces(); + void selectSurface(int i); void togglePauseForSurface(unsigned int i); bool loadXmlSettings(string fileName); - - unsigned int getNumPresets(); - unsigned int getActivePresetIndex(); - - // Get number of surfaces in the active preset. - unsigned int getNumSurfaces(); private: ofx::piMapper::Application _application;