diff --git a/UI.hpp b/UI.hpp index 7360a4b..7088777 100644 --- a/UI.hpp +++ b/UI.hpp @@ -28,7 +28,7 @@ #endif #include "config.h" -#include "Disp_Plus.h" +#include "disp_plus.h" #include "effect_modulated_delay.h" #include "effect_stereo_mono.h" #ifdef USE_PLATEREVERB @@ -248,6 +248,7 @@ void UI_func_eq_treble(uint8_t param); void UI_function_not_enabled(void); void UI_function_not_implemented(uint8_t param); void UI_func_favorites(uint8_t param); +void UI_update_instance_icons(); bool UI_select_name(uint8_t y, uint8_t x, char* edit_string, uint8_t len, bool init); uint8_t search_accepted_char(uint8_t c); void lcd_display_int(int16_t var, uint8_t size, bool zeros, bool brackets, bool sign); @@ -1028,10 +1029,7 @@ void UI_func_chorus_frequency(uint8_t param) lcd_display_bar_float("Chorus Frq.", configuration.fx.chorus_frequency[selected_instance_id], 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1047,10 +1045,7 @@ void UI_func_chorus_frequency(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1080,10 +1075,7 @@ void UI_func_chorus_waveform(uint8_t param) lcd.print(F("Chorus Wavefrm")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1097,10 +1089,7 @@ void UI_func_chorus_waveform(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif @@ -1143,10 +1132,7 @@ void UI_func_chorus_depth(uint8_t param) lcd_display_bar_int("Chorus Dpt.", configuration.fx.chorus_depth[selected_instance_id], 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1162,10 +1148,7 @@ void UI_func_chorus_depth(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1196,10 +1179,7 @@ void UI_func_chorus_level(uint8_t param) lcd_display_bar_int("Chorus Lvl.", configuration.fx.chorus_level[selected_instance_id], 1.0, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 3, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1221,10 +1201,7 @@ void UI_func_chorus_level(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1261,10 +1238,7 @@ void UI_func_delay_time(uint8_t param) lcd_display_bar_int("Delay Time", configuration.fx.delay_time[selected_instance_id], 10.0, DELAY_TIME_MIN, DELAY_TIME_MAX, 3, false, false, true); #endif lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1286,10 +1260,7 @@ void UI_func_delay_time(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1326,10 +1297,7 @@ void UI_func_delay_feedback(uint8_t param) lcd_display_bar_int("Delay Feedb.", configuration.fx.delay_feedback[selected_instance_id], 1.0, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 3, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1351,10 +1319,7 @@ void UI_func_delay_feedback(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1385,10 +1350,7 @@ void UI_func_delay_level(uint8_t param) lcd_display_bar_int("Delay Lvl.", configuration.fx.delay_level[selected_instance_id], 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1410,10 +1372,7 @@ void UI_func_delay_level(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1448,10 +1407,7 @@ void UI_func_reverb_send(uint8_t param) lcd_display_bar_int("Reverb Send", configuration.fx.reverb_send[selected_instance_id], 1.0, REVERB_SEND_MIN, REVERB_SEND_MAX, 3, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1473,10 +1429,7 @@ void UI_func_reverb_send(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1508,10 +1461,7 @@ void UI_func_filter_cutoff(uint8_t param) lcd_display_bar_int("Filter Cut", configuration.fx.filter_cutoff[selected_instance_id], 1.0, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 3, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1533,10 +1483,7 @@ void UI_func_filter_cutoff(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1567,10 +1514,7 @@ void UI_func_filter_resonance(uint8_t param) lcd_display_bar_int("Filter Res", configuration.fx.filter_resonance[selected_instance_id], 1.0, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 3, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1592,10 +1536,7 @@ void UI_func_filter_resonance(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1627,10 +1568,7 @@ void UI_func_transpose(uint8_t param) lcd_display_meter_int("Transpose", configuration.dexed[selected_instance_id].transpose, 1.0, -24.0, TRANSPOSE_MIN, TRANSPOSE_MAX, 2, false, true, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1646,10 +1584,7 @@ void UI_func_transpose(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1682,10 +1617,7 @@ void UI_func_tune(uint8_t param) lcd_display_meter_int("Fine Tune", configuration.dexed[selected_instance_id].tune, 1.0, -100.0, TUNE_MIN, TUNE_MAX, 3, false, true, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1707,10 +1639,7 @@ void UI_func_tune(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1742,10 +1671,7 @@ void UI_func_midi_channel(uint8_t param) lcd.print(F("MIDI Channel")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1759,10 +1685,7 @@ void UI_func_midi_channel(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif @@ -1815,10 +1738,7 @@ void UI_func_lowest_note(uint8_t param) lcd.print(F("]")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1834,10 +1754,7 @@ void UI_func_lowest_note(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1876,10 +1793,7 @@ void UI_func_highest_note(uint8_t param) lcd.print(F("]")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1895,10 +1809,7 @@ void UI_func_highest_note(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1930,10 +1841,7 @@ void UI_func_sound_intensity(uint8_t param) lcd_display_bar_int("Voice Level", configuration.dexed[selected_instance_id].sound_intensity, 1.0, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 3, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -1958,10 +1866,7 @@ void UI_func_sound_intensity(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -1999,10 +1904,7 @@ void UI_func_panorama(uint8_t param) lcd_display_meter_float("Panorama", configuration.dexed[selected_instance_id].pan, 0.05, -20.0, PANORAMA_MIN, PANORAMA_MAX, 1, 1, false, true, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2022,10 +1924,7 @@ void UI_func_panorama(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif @@ -2188,10 +2087,7 @@ void UI_func_polyphony(uint8_t param) lcd_display_bar_int("Polyphony", configuration.dexed[selected_instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX, 2, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2214,10 +2110,7 @@ void UI_func_polyphony(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } lcd_active_instance_number(selected_instance_id); #endif @@ -2249,10 +2142,7 @@ void UI_func_engine(uint8_t param) lcd.print(F("Engine")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2268,10 +2158,7 @@ void UI_func_engine(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -2314,10 +2201,7 @@ void UI_func_mono_poly(uint8_t param) lcd.print(F("Mono/Poly")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2333,10 +2217,7 @@ void UI_func_mono_poly(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } lcd_active_instance_number(selected_instance_id); #endif @@ -2378,10 +2259,7 @@ void UI_func_note_refresh(uint8_t param) lcd.print(F("Note Refresh")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2397,10 +2275,7 @@ void UI_func_note_refresh(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -2441,10 +2316,7 @@ void UI_func_pb_range(uint8_t param) lcd_display_bar_int("PB Range", configuration.dexed[selected_instance_id].pb_range, 1.0, PB_RANGE_MIN, PB_RANGE_MAX, 2, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2460,10 +2332,7 @@ void UI_func_pb_range(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -2495,10 +2364,7 @@ void UI_func_pb_step(uint8_t param) lcd_display_bar_int("PB Step", configuration.dexed[selected_instance_id].pb_step, 1.0, PB_STEP_MIN, PB_STEP_MAX, 2, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2514,10 +2380,7 @@ void UI_func_pb_step(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -2549,10 +2412,7 @@ void UI_func_mw_range(uint8_t param) lcd_display_bar_int("MW Range", configuration.dexed[selected_instance_id].mw_range, 1.0, MW_RANGE_MIN, MW_RANGE_MAX, 2, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2568,10 +2428,7 @@ void UI_func_mw_range(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -2603,10 +2460,7 @@ void UI_func_mw_assign(uint8_t param) lcd.print(F("MW Assign")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2622,10 +2476,7 @@ void UI_func_mw_assign(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -2684,10 +2535,7 @@ void UI_func_mw_mode(uint8_t param) lcd.print(F("MW Mode")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2703,10 +2551,7 @@ void UI_func_mw_mode(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -2750,10 +2595,7 @@ void UI_func_fc_range(uint8_t param) lcd_display_bar_int("FC Range", configuration.dexed[selected_instance_id].fc_range, 1.0, FC_RANGE_MIN, FC_RANGE_MAX, 2, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2769,10 +2611,7 @@ void UI_func_fc_range(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -2804,10 +2643,7 @@ void UI_func_fc_assign(uint8_t param) lcd.print(F("FC Assign")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2823,10 +2659,7 @@ void UI_func_fc_assign(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -2885,10 +2718,7 @@ void UI_func_fc_mode(uint8_t param) lcd.print(F("FC Mode")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2904,10 +2734,7 @@ void UI_func_fc_mode(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -2951,10 +2778,7 @@ void UI_func_bc_range(uint8_t param) lcd_display_bar_int("BC Range", configuration.dexed[selected_instance_id].bc_range, 1.0, BC_RANGE_MIN, BC_RANGE_MAX, 2, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -2970,10 +2794,7 @@ void UI_func_bc_range(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -3005,10 +2826,7 @@ void UI_func_bc_assign(uint8_t param) lcd.print(F("BC Assign")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -3024,10 +2842,7 @@ void UI_func_bc_assign(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -3086,10 +2901,7 @@ void UI_func_bc_mode(uint8_t param) lcd.print(F("BC Mode")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -3105,10 +2917,7 @@ void UI_func_bc_mode(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -3152,10 +2961,7 @@ void UI_func_at_range(uint8_t param) lcd_display_bar_int("AT Range", configuration.dexed[selected_instance_id].at_range, 1.0, AT_RANGE_MIN, AT_RANGE_MAX, 2, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -3171,10 +2977,7 @@ void UI_func_at_range(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -3206,10 +3009,7 @@ void UI_func_at_assign(uint8_t param) lcd.print(F("AT Assign")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -3225,10 +3025,7 @@ void UI_func_at_assign(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -3287,10 +3084,7 @@ void UI_func_at_mode(uint8_t param) lcd.print(F("AT Mode")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -3306,10 +3100,7 @@ void UI_func_at_mode(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -3353,10 +3144,7 @@ void UI_func_portamento_mode(uint8_t param) lcd.print(F("Port. Mode")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -3372,10 +3160,7 @@ void UI_func_portamento_mode(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -3422,10 +3207,7 @@ void UI_func_portamento_glissando(uint8_t param) lcd.print(F("Port. Gliss.")); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -3441,10 +3223,7 @@ void UI_func_portamento_glissando(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -3485,10 +3264,7 @@ void UI_func_portamento_time(uint8_t param) lcd_display_bar_int("Port. Time", configuration.dexed[selected_instance_id].portamento_time, 1.0, PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX, 2, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -3504,10 +3280,7 @@ void UI_func_portamento_time(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif } @@ -3545,10 +3318,7 @@ void UI_handle_OP(uint8_t param) for (uint8_t i = 2; i < 8; i++) lcd.write(i); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); lcd.setCursor(op_selected, 1); lcd.blink(); @@ -3690,10 +3460,7 @@ void UI_func_velocity_level(uint8_t param) lcd_display_bar_int("Velocity Lvl", configuration.dexed[selected_instance_id].velocity_level, 1.0, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX, 3, false, false, true); lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } if (LCDML.FUNC_loop()) // ****** LOOP ********* @@ -3710,10 +3477,7 @@ void UI_func_velocity_level(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif @@ -3956,6 +3720,14 @@ void locate_random_non_favorite() favsearcher = 0; } +void UI_update_instance_icons() +{ + lcd.setCursor(14, 0); + lcd.write(0); //Icon for first instance + lcd.setCursor(15, 0); + lcd.write(1); //Icon for second instance +} + void UI_func_voice_select(uint8_t param) { static uint8_t menu_voice_select = MENU_VOICE_SOUND; @@ -3974,10 +3746,7 @@ void UI_func_voice_select(uint8_t param) if (!get_voice_by_bank_name(configuration.performance.bank[selected_instance_id], bank_name, configuration.performance.voice[selected_instance_id], voice_name, sizeof(voice_name))) strcpy(voice_name, "*ERROR*"); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); lcd.createChar(2, (uint8_t*)special_chars[18]); // favorites symbol @@ -4179,10 +3948,7 @@ void UI_func_voice_select(uint8_t param) { selected_instance_id = !selected_instance_id; lcd_active_instance_number(selected_instance_id); - lcd.setCursor(14, 0); - lcd.write(0); - lcd.setCursor(15, 0); - lcd.write(1); + UI_update_instance_icons(); } #endif }