From 42c1b02b67227cdb94f048880fe8f46f433ee60a Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Wed, 3 Oct 2018 09:48:18 +0200 Subject: [PATCH] Changed encoder handling at bank borders to change to the next bank. --- UI.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/UI.cpp b/UI.cpp index 3938999..833c281 100644 --- a/UI.cpp +++ b/UI.cpp @@ -153,9 +153,25 @@ void handle_ui(void) ui_main_state = UI_MAIN_VOICE_SELECTED; case UI_MAIN_VOICE_SELECTED: if (enc[i].read() <= 0) - enc[i].write(0); + { + if (bank > 0) + { + enc[i].write(MAX_VOICES - 1); + bank--; + } + else + enc[i].write(0); + } else if (enc[i].read() > MAX_VOICES - 1) - enc[i].write(MAX_VOICES - 1); + { + if (bank < MAX_BANKS - 1) + { + enc[i].write(0); + bank++; + } + else + enc[i].write(MAX_VOICES - 1); + } voice = enc[i].read(); load_sysex(bank, voice); autostore_sound = 0;