From fdf39c8f7b6590970fe7aefe05c4e61446d7f6b2 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sat, 8 Oct 2016 22:58:11 +0200 Subject: [PATCH] Simplify ofxPiMapper::setNextPreset --- src/ofxPiMapper.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index dd3c6ff..3306628 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -27,13 +27,7 @@ void ofxPiMapper::setActivePreset(unsigned int i){ } void ofxPiMapper::setNextPreset(){ - unsigned int currentActivePreset = _application.getSurfaceManager()->getActivePresetIndex(); - if(currentActivePreset >= _application.getSurfaceManager()->getNumPresets() - 1){ - currentActivePreset = 0; - }else{ - currentActivePreset += 1; - } - _application.setActivePreset(currentActivePreset); + _application.setNextPreset(); } void ofxPiMapper::cloneActivePreset(){