diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index af37d6f..dd3c6ff 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -27,8 +27,13 @@ void ofxPiMapper::setActivePreset(unsigned int i){ } void ofxPiMapper::setNextPreset(){ - _application.getSurfaceManager()->deselectSurface(); - _application.getSurfaceManager()->setNextPreset(); + unsigned int currentActivePreset = _application.getSurfaceManager()->getActivePresetIndex(); + if(currentActivePreset >= _application.getSurfaceManager()->getNumPresets() - 1){ + currentActivePreset = 0; + }else{ + currentActivePreset += 1; + } + _application.setActivePreset(currentActivePreset); } void ofxPiMapper::cloneActivePreset(){