Fixes for LCDMenuLib2.

Fixes for displaying changes values (via MIDI) on display.
pull/32/head
Holger Wirtz 5 years ago
parent cc1380701a
commit 743dc51f42
  1. 12
      MicroDexed.ino
  2. 290
      UI.hpp
  3. 7
      third-party/LCDMenuLib2/keywords.txt
  4. 501
      third-party/LCDMenuLib2/src/LCDMenuLib2.cpp
  5. 57
      third-party/LCDMenuLib2/src/LCDMenuLib2.h
  6. 2
      third-party/LCDMenuLib2/src/LCDMenuLib2_macros.h
  7. 10
      third-party/LCDMenuLib2/src/LCDMenuLib2_menu.cpp
  8. 10
      third-party/LCDMenuLib2/src/LCDMenuLib2_menu.h
  9. 4
      third-party/LCDMenuLib2/src/LCDMenuLib2_typedef.h

@ -701,6 +701,9 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue)
MicroDexed[instance_id]->setMonoMode(false); MicroDexed[instance_id]->setMonoMode(false);
break; break;
} }
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
} }
} }
} }
@ -742,6 +745,9 @@ void handleProgramChange(byte inChannel, byte inProgram)
#ifdef DISPLAY_LCD_SPI #ifdef DISPLAY_LCD_SPI
change_disp_sd(true); change_disp_sd(true);
#endif #endif
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
} }
} }
} }
@ -888,6 +894,9 @@ void handleSystemExclusive(byte * sysex, uint len)
break; break;
} }
MicroDexed[instance_id]->controllers.refresh(); MicroDexed[instance_id]->controllers.refresh();
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
} }
#ifdef DEBUG #ifdef DEBUG
else else
@ -952,6 +961,9 @@ void handleSystemExclusive(byte * sysex, uint len)
// load sysex-data into voice memory // load sysex-data into voice memory
MicroDexed[instance_id]->loadVoiceParameters(&sysex[6]); MicroDexed[instance_id]->loadVoiceParameters(&sysex[6]);
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
/* /*
// manipulate UI names and numbers // manipulate UI names and numbers
strncpy(voice_name[instance_id], (char *)&sysex[151], sizeof(voice_name[instance_id]) - 1); strncpy(voice_name[instance_id], (char *)&sysex[151], sizeof(voice_name[instance_id]) - 1);

290
UI.hpp

@ -363,9 +363,6 @@ class EncoderDirection
bool down; bool down;
}; };
#define g_LCDML_CONTROL_button_long_press LONG_BUTTON_PRESS
#define g_LCDML_CONTROL_button_short_press BUT_DEBOUNCE_MS
//Encoder ENCODER[NUM_ENCODER] = {Encoder(ENC_R_PIN_B, ENC_R_PIN_A), Encoder(ENC_L_PIN_B, ENC_L_PIN_A)}; //Encoder ENCODER[NUM_ENCODER] = {Encoder(ENC_R_PIN_B, ENC_R_PIN_A), Encoder(ENC_L_PIN_B, ENC_L_PIN_A)};
MD_REncoder ENCODER[NUM_ENCODER] = {MD_REncoder(ENC_R_PIN_B, ENC_R_PIN_A), MD_REncoder(ENC_L_PIN_B, ENC_L_PIN_A)}; MD_REncoder ENCODER[NUM_ENCODER] = {MD_REncoder(ENC_R_PIN_B, ENC_R_PIN_A), MD_REncoder(ENC_L_PIN_B, ENC_L_PIN_A)};
EncoderDirection encoderDir[NUM_ENCODER]; EncoderDirection encoderDir[NUM_ENCODER];
@ -546,7 +543,7 @@ void lcdml_menu_control(void)
g_LCDML_CONTROL_button_press_time[ENC_R] = millis(); g_LCDML_CONTROL_button_press_time[ENC_R] = millis();
//Reset for left right action //Reset for left right action
} }
else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_R]) >= g_LCDML_CONTROL_button_long_press) else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_R]) >= LONG_BUTTON_PRESS)
{ {
#ifdef DEBUG #ifdef DEBUG
Serial.println("ENC-R long"); Serial.println("ENC-R long");
@ -554,16 +551,15 @@ void lcdml_menu_control(void)
//LCDML.BT_quit(); //LCDML.BT_quit();
encoderDir[ENC_R].ButtonLong(true); encoderDir[ENC_R].ButtonLong(true);
/* if (LCDML.FUNC_getID() < 0xff)
if (LCDML.FUNC_getID() < 0xff) LCDML.FUNC_setGBAToLastFunc();
LCDML.FUNC_setGBAToLastFunc(); else
else LCDML.FUNC_setGBAToLastCursorPos();
LCDML.FUNC_setGBAToLastCursorPos();
*/ //LCDML.FUNC_setGBA();
LCDML.FUNC_setGBA();
LCDML.OTHER_jumpToFunc(UI_func_voice_select); LCDML.OTHER_jumpToFunc(UI_func_voice_select);
} }
else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_R]) >= g_LCDML_CONTROL_button_short_press) else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_R]) >= BUT_DEBOUNCE_MS)
{ {
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("ENC-R short")); Serial.println(F("ENC-R short"));
@ -644,7 +640,7 @@ void lcdml_menu_control(void)
g_LCDML_CONTROL_button_press_time[ENC_L] = millis(); g_LCDML_CONTROL_button_press_time[ENC_L] = millis();
//Reset for left right action //Reset for left right action
} }
else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_L]) >= g_LCDML_CONTROL_button_long_press) else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_L]) >= LONG_BUTTON_PRESS)
{ {
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("ENC-L long")); Serial.println(F("ENC-L long"));
@ -654,7 +650,7 @@ void lcdml_menu_control(void)
for (uint8_t i = 0; i < NUM_DEXED; i++) for (uint8_t i = 0; i < NUM_DEXED; i++)
MicroDexed[i]->panic(); MicroDexed[i]->panic();
} }
else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_L]) >= g_LCDML_CONTROL_button_short_press) else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_L]) >= BUT_DEBOUNCE_MS)
{ {
//LCDML.BT_enter(); //LCDML.BT_enter();
#ifdef DEBUG #ifdef DEBUG
@ -837,12 +833,11 @@ void UI_func_reverb_roomsize(uint8_t param)
configuration.fx.reverb_roomsize = constrain(configuration.fx.reverb_roomsize + ENCODER[ENC_R].speed(), REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX); configuration.fx.reverb_roomsize = constrain(configuration.fx.reverb_roomsize + ENCODER[ENC_R].speed(), REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.fx.reverb_roomsize = constrain(configuration.fx.reverb_roomsize - ENCODER[ENC_R].speed(), REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX); configuration.fx.reverb_roomsize = constrain(configuration.fx.reverb_roomsize - ENCODER[ENC_R].speed(), REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX);
lcd_display_bar_int("Reverb Room", configuration.fx.reverb_roomsize, 1.0, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 3, false, false, false, false);
freeverb_r.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0));
freeverb_l.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0));
} }
lcd_display_bar_int("Reverb Room", configuration.fx.reverb_roomsize, 1.0, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 3, false, false, false, false);
freeverb_r.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0));
freeverb_l.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0));
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -871,12 +866,12 @@ void UI_func_reverb_damping(uint8_t param)
configuration.fx.reverb_damping = constrain(configuration.fx.reverb_damping + ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX); configuration.fx.reverb_damping = constrain(configuration.fx.reverb_damping + ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.fx.reverb_damping = constrain(configuration.fx.reverb_damping - ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX); configuration.fx.reverb_damping = constrain(configuration.fx.reverb_damping - ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX);
}
lcd_display_bar_int("Reverb Damp.", configuration.fx.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, false, false); lcd_display_bar_int("Reverb Damp.", configuration.fx.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, false, false);
freeverb_r.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); freeverb_r.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0));
freeverb_l.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); freeverb_l.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0));
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -910,12 +905,12 @@ void UI_func_reverb_send(uint8_t param)
configuration.dexed[instance_id].reverb_send = constrain(configuration.dexed[instance_id].reverb_send + ENCODER[ENC_R].speed(), REVERB_SEND_MIN, REVERB_SEND_MAX); configuration.dexed[instance_id].reverb_send = constrain(configuration.dexed[instance_id].reverb_send + ENCODER[ENC_R].speed(), REVERB_SEND_MIN, REVERB_SEND_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].reverb_send = constrain(configuration.dexed[instance_id].reverb_send - ENCODER[ENC_R].speed(), REVERB_SEND_MIN, REVERB_SEND_MAX); configuration.dexed[instance_id].reverb_send = constrain(configuration.dexed[instance_id].reverb_send - ENCODER[ENC_R].speed(), REVERB_SEND_MIN, REVERB_SEND_MAX);
}
lcd_display_bar_int("Reverb Send", configuration.dexed[instance_id].reverb_send, 1.0, REVERB_SEND_MIN, REVERB_SEND_MAX, 3, false, false, false, false); lcd_display_bar_int("Reverb Send", configuration.dexed[instance_id].reverb_send, 1.0, REVERB_SEND_MIN, REVERB_SEND_MAX, 3, false, false, false, false);
reverb_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0); reverb_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0);
reverb_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0); reverb_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -949,12 +944,12 @@ void UI_func_reverb_level(uint8_t param)
configuration.fx.reverb_level = constrain(configuration.fx.reverb_level + ENCODER[ENC_R].speed(), REVERB_LEVEL_MIN, REVERB_LEVEL_MAX); configuration.fx.reverb_level = constrain(configuration.fx.reverb_level + ENCODER[ENC_R].speed(), REVERB_LEVEL_MIN, REVERB_LEVEL_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.fx.reverb_level = constrain(configuration.fx.reverb_level - ENCODER[ENC_R].speed(), REVERB_LEVEL_MIN, REVERB_LEVEL_MAX); configuration.fx.reverb_level = constrain(configuration.fx.reverb_level - ENCODER[ENC_R].speed(), REVERB_LEVEL_MIN, REVERB_LEVEL_MAX);
}
lcd_display_bar_int("Reverb Level", configuration.fx.reverb_level, 1.0, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 3, false, false, false, true); lcd_display_bar_int("Reverb Level", configuration.fx.reverb_level, 1.0, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 3, false, false, false, true);
master_mixer_r.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0));
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -983,11 +978,10 @@ void UI_func_chorus_frequency(uint8_t param)
configuration.fx.chorus_frequency = constrain(configuration.fx.chorus_frequency + ENCODER[ENC_R].speed(), CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX); configuration.fx.chorus_frequency = constrain(configuration.fx.chorus_frequency + ENCODER[ENC_R].speed(), CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.fx.chorus_frequency = constrain(configuration.fx.chorus_frequency - ENCODER[ENC_R].speed(), CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX); configuration.fx.chorus_frequency = constrain(configuration.fx.chorus_frequency - ENCODER[ENC_R].speed(), CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX);
lcd_display_bar_float("Chorus Frq.", configuration.fx.chorus_frequency, 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, false, false);
chorus_modulator.frequency(configuration.fx.chorus_frequency / 10.0);
} }
lcd_display_bar_float("Chorus Frq.", configuration.fx.chorus_frequency, 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, false, false);
chorus_modulator.frequency(configuration.fx.chorus_frequency / 10.0);
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1058,11 +1052,11 @@ void UI_func_chorus_depth(uint8_t param)
configuration.fx.chorus_depth = constrain(configuration.fx.chorus_depth + ENCODER[ENC_R].speed(), CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX); configuration.fx.chorus_depth = constrain(configuration.fx.chorus_depth + ENCODER[ENC_R].speed(), CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.fx.chorus_depth = constrain(configuration.fx.chorus_depth - ENCODER[ENC_R].speed(), CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX); configuration.fx.chorus_depth = constrain(configuration.fx.chorus_depth - ENCODER[ENC_R].speed(), CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX);
}
lcd_display_bar_int("Chorus Dpt.", configuration.fx.chorus_depth, 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, false); lcd_display_bar_int("Chorus Dpt.", configuration.fx.chorus_depth, 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, false);
chorus_modulator.amplitude(configuration.fx.chorus_depth / 100.0); chorus_modulator.amplitude(configuration.fx.chorus_depth / 100.0);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1096,12 +1090,11 @@ void UI_func_chorus_send(uint8_t param)
configuration.dexed[instance_id].chorus_send = constrain(configuration.dexed[instance_id].chorus_send + ENCODER[ENC_R].speed(), CHORUS_SEND_MIN, CHORUS_SEND_MAX); configuration.dexed[instance_id].chorus_send = constrain(configuration.dexed[instance_id].chorus_send + ENCODER[ENC_R].speed(), CHORUS_SEND_MIN, CHORUS_SEND_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].chorus_send = constrain(configuration.dexed[instance_id].chorus_send - ENCODER[ENC_R].speed(), CHORUS_SEND_MIN, CHORUS_SEND_MAX); configuration.dexed[instance_id].chorus_send = constrain(configuration.dexed[instance_id].chorus_send - ENCODER[ENC_R].speed(), CHORUS_SEND_MIN, CHORUS_SEND_MAX);
lcd_display_bar_int("Chorus Send", configuration.dexed[instance_id].chorus_send, 1.0, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 3, false, false, false, false);
chorus_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].chorus_send / 100.0);
chorus_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].chorus_send / 100.0);
} }
lcd_display_bar_int("Chorus Send", configuration.dexed[instance_id].chorus_send, 1.0, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 3, false, false, false, false);
chorus_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].chorus_send / 100.0);
chorus_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].chorus_send / 100.0);
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1135,12 +1128,12 @@ void UI_func_chorus_level(uint8_t param)
configuration.fx.chorus_level = constrain(configuration.fx.chorus_level + ENCODER[ENC_R].speed(), CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); configuration.fx.chorus_level = constrain(configuration.fx.chorus_level + ENCODER[ENC_R].speed(), CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.fx.chorus_level = constrain(configuration.fx.chorus_level - ENCODER[ENC_R].speed(), CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); configuration.fx.chorus_level = constrain(configuration.fx.chorus_level - ENCODER[ENC_R].speed(), CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX);
}
lcd_display_bar_int("Chorus Lvl.", configuration.fx.chorus_level, 1.0, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 3, false, false, false, false); lcd_display_bar_int("Chorus Lvl.", configuration.fx.chorus_level, 1.0, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 3, false, false, false, false);
master_mixer_r.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0));
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1169,12 +1162,12 @@ void UI_func_delay_time(uint8_t param)
configuration.fx.delay_time = constrain(configuration.fx.delay_time + ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX); configuration.fx.delay_time = constrain(configuration.fx.delay_time + ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.fx.delay_time = constrain(configuration.fx.delay_time - ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX); configuration.fx.delay_time = constrain(configuration.fx.delay_time - ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX);
}
lcd_display_bar_int("Delay Time", configuration.fx.delay_time, 10.0, DELAY_TIME_MIN, DELAY_TIME_MAX, 3, false, false, false, true); lcd_display_bar_int("Delay Time", configuration.fx.delay_time, 10.0, DELAY_TIME_MIN, DELAY_TIME_MAX, 3, false, false, false, true);
delay_r.delay(0, configuration.fx.delay_time * 10); delay_r.delay(0, configuration.fx.delay_time * 10);
delay_l.delay(0, configuration.fx.delay_time * 10); delay_l.delay(0, configuration.fx.delay_time * 10);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1203,13 +1196,13 @@ void UI_func_delay_feedback(uint8_t param)
configuration.fx.delay_feedback = constrain(configuration.fx.delay_feedback + ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); configuration.fx.delay_feedback = constrain(configuration.fx.delay_feedback + ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.fx.delay_feedback = constrain(configuration.fx.delay_feedback - ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); configuration.fx.delay_feedback = constrain(configuration.fx.delay_feedback - ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX);
}
lcd_display_bar_int("Delay Feedb.", configuration.fx.delay_feedback, 1.0, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 3, false, false, false, false); lcd_display_bar_int("Delay Feedb.", configuration.fx.delay_feedback, 1.0, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 3, false, false, false, false);
delay_fb_mixer_r.gain(1, configuration.fx.delay_feedback / 100.0); // amount of feedback delay_fb_mixer_r.gain(1, configuration.fx.delay_feedback / 100.0); // amount of feedback
delay_fb_mixer_l.gain(1, configuration.fx.delay_feedback / 100.0); // amount of feedback delay_fb_mixer_l.gain(1, configuration.fx.delay_feedback / 100.0); // amount of feedback
//delay_fb_mixer.gain(0, 1.0 - configuration.fx.delay_feedback / 200.0); // original signal //delay_fb_mixer.gain(0, 1.0 - configuration.fx.delay_feedback / 200.0); // original signal
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1243,12 +1236,12 @@ void UI_func_delay_send(uint8_t param)
configuration.dexed[instance_id].delay_send = constrain(configuration.dexed[instance_id].delay_send + ENCODER[ENC_R].speed(), DELAY_SEND_MIN, DELAY_SEND_MAX); configuration.dexed[instance_id].delay_send = constrain(configuration.dexed[instance_id].delay_send + ENCODER[ENC_R].speed(), DELAY_SEND_MIN, DELAY_SEND_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].delay_send = constrain(configuration.dexed[instance_id].delay_send - ENCODER[ENC_R].speed(), DELAY_SEND_MIN, DELAY_SEND_MAX); configuration.dexed[instance_id].delay_send = constrain(configuration.dexed[instance_id].delay_send - ENCODER[ENC_R].speed(), DELAY_SEND_MIN, DELAY_SEND_MAX);
}
lcd_display_bar_int("Delay Send", configuration.dexed[instance_id].delay_send, 1.0, DELAY_SEND_MIN, DELAY_SEND_MAX, 3, false, false, false, false); lcd_display_bar_int("Delay Send", configuration.dexed[instance_id].delay_send, 1.0, DELAY_SEND_MIN, DELAY_SEND_MAX, 3, false, false, false, false);
delay_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].delay_send / 100.0); delay_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].delay_send / 100.0);
delay_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].delay_send / 100.0); delay_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].delay_send / 100.0);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1282,12 +1275,12 @@ void UI_func_delay_level(uint8_t param)
configuration.fx.delay_level = constrain(configuration.fx.delay_level + ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); configuration.fx.delay_level = constrain(configuration.fx.delay_level + ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.fx.delay_level = constrain(configuration.fx.delay_level - ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); configuration.fx.delay_level = constrain(configuration.fx.delay_level - ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX);
}
lcd_display_bar_int("Delay Lvl.", configuration.fx.delay_level, 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, false, false); lcd_display_bar_int("Delay Lvl.", configuration.fx.delay_level, 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, false, false);
master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1321,11 +1314,11 @@ void UI_func_filter_cutoff(uint8_t param)
configuration.dexed[instance_id].filter_cutoff = constrain(configuration.dexed[instance_id].filter_cutoff + ENCODER[ENC_R].speed(), FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); configuration.dexed[instance_id].filter_cutoff = constrain(configuration.dexed[instance_id].filter_cutoff + ENCODER[ENC_R].speed(), FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].filter_cutoff = constrain(configuration.dexed[instance_id].filter_cutoff - ENCODER[ENC_R].speed(), FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); configuration.dexed[instance_id].filter_cutoff = constrain(configuration.dexed[instance_id].filter_cutoff - ENCODER[ENC_R].speed(), FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX);
}
lcd_display_bar_int("Filter Cut", configuration.dexed[instance_id].filter_cutoff, 1.0, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 3, false, false, false, false); lcd_display_bar_int("Filter Cut", configuration.dexed[instance_id].filter_cutoff, 1.0, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 3, false, false, false, false);
MicroDexed[instance_id]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); MicroDexed[instance_id]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1364,11 +1357,11 @@ void UI_func_filter_resonance(uint8_t param)
configuration.dexed[instance_id].filter_resonance = constrain(configuration.dexed[instance_id].filter_resonance + ENCODER[ENC_R].speed(), FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); configuration.dexed[instance_id].filter_resonance = constrain(configuration.dexed[instance_id].filter_resonance + ENCODER[ENC_R].speed(), FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].filter_resonance = constrain(configuration.dexed[instance_id].filter_resonance - ENCODER[ENC_R].speed(), FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); configuration.dexed[instance_id].filter_resonance = constrain(configuration.dexed[instance_id].filter_resonance - ENCODER[ENC_R].speed(), FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX);
}
lcd_display_bar_int("Filter Res", configuration.dexed[instance_id].filter_resonance, 1.0, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 3, false, false, false, false); lcd_display_bar_int("Filter Res", configuration.dexed[instance_id].filter_resonance, 1.0, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 3, false, false, false, false);
MicroDexed[instance_id]->fx.Reso = mapfloat(configuration.dexed[instance_id].filter_resonance, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0); MicroDexed[instance_id]->fx.Reso = mapfloat(configuration.dexed[instance_id].filter_resonance, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1408,12 +1401,12 @@ void UI_func_transpose(uint8_t param)
configuration.dexed[instance_id].transpose = constrain(configuration.dexed[instance_id].transpose + ENCODER[ENC_R].speed(), TRANSPOSE_MIN, TRANSPOSE_MAX); configuration.dexed[instance_id].transpose = constrain(configuration.dexed[instance_id].transpose + ENCODER[ENC_R].speed(), TRANSPOSE_MIN, TRANSPOSE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].transpose = constrain(configuration.dexed[instance_id].transpose - ENCODER[ENC_R].speed(), TRANSPOSE_MIN, TRANSPOSE_MAX); configuration.dexed[instance_id].transpose = constrain(configuration.dexed[instance_id].transpose - ENCODER[ENC_R].speed(), TRANSPOSE_MIN, TRANSPOSE_MAX);
}
lcd_display_meter_int("Transpose", configuration.dexed[instance_id].transpose, 1.0, -24.0, TRANSPOSE_MIN, TRANSPOSE_MAX, 3, false, false, true, true); lcd_display_meter_int("Transpose", configuration.dexed[instance_id].transpose, 1.0, -24.0, TRANSPOSE_MIN, TRANSPOSE_MAX, 3, false, false, true, true);
MicroDexed[instance_id]->data[DEXED_VOICE_OFFSET + DEXED_TRANSPOSE] = configuration.dexed[instance_id].transpose; MicroDexed[instance_id]->data[DEXED_VOICE_OFFSET + DEXED_TRANSPOSE] = configuration.dexed[instance_id].transpose;
MicroDexed[instance_id]->notesOff(); MicroDexed[instance_id]->notesOff();
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1452,12 +1445,12 @@ void UI_func_tune(uint8_t param)
configuration.dexed[instance_id].tune = constrain(configuration.dexed[instance_id].tune + ENCODER[ENC_R].speed(), TUNE_MIN, TUNE_MAX); configuration.dexed[instance_id].tune = constrain(configuration.dexed[instance_id].tune + ENCODER[ENC_R].speed(), TUNE_MIN, TUNE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].tune = constrain(configuration.dexed[instance_id].tune - ENCODER[ENC_R].speed(), TUNE_MIN, TUNE_MAX); configuration.dexed[instance_id].tune = constrain(configuration.dexed[instance_id].tune - ENCODER[ENC_R].speed(), TUNE_MIN, TUNE_MAX);
}
lcd_display_meter_int("Fine Tune", configuration.dexed[instance_id].tune, 1.0, -100.0, TUNE_MIN, TUNE_MAX, 3, false, false, true, false); lcd_display_meter_int("Fine Tune", configuration.dexed[instance_id].tune, 1.0, -100.0, TUNE_MIN, TUNE_MAX, 3, false, false, true, false);
MicroDexed[instance_id]->controllers.masterTune = (int((configuration.dexed[instance_id].tune - 100) / 100.0 * 0x4000) << 11) * (1.0 / 12); MicroDexed[instance_id]->controllers.masterTune = (int((configuration.dexed[instance_id].tune - 100) / 100.0 * 0x4000) << 11) * (1.0 / 12);
MicroDexed[instance_id]->doRefreshVoice(); MicroDexed[instance_id]->doRefreshVoice();
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1557,11 +1550,11 @@ void UI_func_lowest_note(uint8_t param)
configuration.dexed[instance_id].lowest_note = constrain(configuration.dexed[instance_id].lowest_note + ENCODER[ENC_R].speed(), INSTANCE_LOWEST_NOTE_MIN, INSTANCE_LOWEST_NOTE_MAX); configuration.dexed[instance_id].lowest_note = constrain(configuration.dexed[instance_id].lowest_note + ENCODER[ENC_R].speed(), INSTANCE_LOWEST_NOTE_MIN, INSTANCE_LOWEST_NOTE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].lowest_note = constrain(configuration.dexed[instance_id].lowest_note - ENCODER[ENC_R].speed(), INSTANCE_LOWEST_NOTE_MIN, INSTANCE_LOWEST_NOTE_MAX); configuration.dexed[instance_id].lowest_note = constrain(configuration.dexed[instance_id].lowest_note - ENCODER[ENC_R].speed(), INSTANCE_LOWEST_NOTE_MIN, INSTANCE_LOWEST_NOTE_MAX);
getNoteName(note_name, configuration.dexed[instance_id].lowest_note);
lcd.setCursor(1, 1);
lcd.print(note_name);
} }
getNoteName(note_name, configuration.dexed[instance_id].lowest_note);
lcd.setCursor(1, 1);
lcd.print(note_name);
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1605,11 +1598,11 @@ void UI_func_highest_note(uint8_t param)
configuration.dexed[instance_id].highest_note = constrain(configuration.dexed[instance_id].highest_note + ENCODER[ENC_R].speed(), INSTANCE_HIGHEST_NOTE_MIN, INSTANCE_HIGHEST_NOTE_MAX); configuration.dexed[instance_id].highest_note = constrain(configuration.dexed[instance_id].highest_note + ENCODER[ENC_R].speed(), INSTANCE_HIGHEST_NOTE_MIN, INSTANCE_HIGHEST_NOTE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].highest_note = constrain(configuration.dexed[instance_id].highest_note - ENCODER[ENC_R].speed(), INSTANCE_HIGHEST_NOTE_MIN, INSTANCE_HIGHEST_NOTE_MAX); configuration.dexed[instance_id].highest_note = constrain(configuration.dexed[instance_id].highest_note - ENCODER[ENC_R].speed(), INSTANCE_HIGHEST_NOTE_MIN, INSTANCE_HIGHEST_NOTE_MAX);
getNoteName(note_name, configuration.dexed[instance_id].highest_note);
lcd.setCursor(1, 1);
lcd.print(note_name);
} }
getNoteName(note_name, configuration.dexed[instance_id].highest_note);
lcd.setCursor(1, 1);
lcd.print(note_name);
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1647,12 +1640,10 @@ void UI_func_sound_intensity(uint8_t param)
configuration.dexed[instance_id].sound_intensity = constrain(configuration.dexed[instance_id].sound_intensity + ENCODER[ENC_R].speed(), SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX); configuration.dexed[instance_id].sound_intensity = constrain(configuration.dexed[instance_id].sound_intensity + ENCODER[ENC_R].speed(), SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].sound_intensity = constrain(configuration.dexed[instance_id].sound_intensity - ENCODER[ENC_R].speed(), SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX); configuration.dexed[instance_id].sound_intensity = constrain(configuration.dexed[instance_id].sound_intensity - ENCODER[ENC_R].speed(), SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX);
lcd_display_bar_float("Voice Level", float(configuration.dexed[instance_id].sound_intensity), 1.0, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 3, 0, false, false, false, false);
dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX));
} }
lcd_display_bar_float("Voice Level", float(configuration.dexed[instance_id].sound_intensity), 1.0, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 3, 0, false, false, false, false);
dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX));
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1808,11 +1799,11 @@ void UI_func_polyphony(uint8_t param)
configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony + ENCODER[ENC_R].speed(), POLYPHONY_MIN, POLYPHONY_MAX); configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony + ENCODER[ENC_R].speed(), POLYPHONY_MIN, POLYPHONY_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony - ENCODER[ENC_R].speed(), POLYPHONY_MIN, POLYPHONY_MAX); configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony - ENCODER[ENC_R].speed(), POLYPHONY_MIN, POLYPHONY_MAX);
}
lcd_display_bar_int("Polyphony", configuration.dexed[instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX, 3, false, false, false, false); lcd_display_bar_int("Polyphony", configuration.dexed[instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX, 3, false, false, false, false);
MicroDexed[instance_id]->setMaxNotes(configuration.dexed[instance_id].polyphony); MicroDexed[instance_id]->setMaxNotes(configuration.dexed[instance_id].polyphony);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1851,10 +1842,10 @@ void UI_func_engine(uint8_t param)
configuration.dexed[instance_id].engine = constrain(configuration.dexed[instance_id].engine + 1, ENGINE_MIN, ENGINE_MAX); configuration.dexed[instance_id].engine = constrain(configuration.dexed[instance_id].engine + 1, ENGINE_MIN, ENGINE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].engine = constrain(configuration.dexed[instance_id].engine - 1, ENGINE_MIN, ENGINE_MAX); configuration.dexed[instance_id].engine = constrain(configuration.dexed[instance_id].engine - 1, ENGINE_MIN, ENGINE_MAX);
MicroDexed[instance_id]->setEngineType(configuration.dexed[instance_id].engine);
} }
MicroDexed[instance_id]->setEngineType(configuration.dexed[instance_id].engine);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].engine) switch (configuration.dexed[instance_id].engine)
{ {
@ -1905,10 +1896,10 @@ void UI_func_mono_poly(uint8_t param)
configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly + 1, MONOPOLY_MIN, MONOPOLY_MAX); configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly + 1, MONOPOLY_MIN, MONOPOLY_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly - 1, MONOPOLY_MIN, MONOPOLY_MAX); configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly - 1, MONOPOLY_MIN, MONOPOLY_MAX);
MicroDexed[instance_id]->setMonoMode(!configuration.dexed[instance_id].monopoly);
} }
MicroDexed[instance_id]->setMonoMode(!configuration.dexed[instance_id].monopoly);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].monopoly) switch (configuration.dexed[instance_id].monopoly)
{ {
@ -1956,10 +1947,10 @@ void UI_func_note_refresh(uint8_t param)
configuration.dexed[instance_id].note_refresh = constrain(configuration.dexed[instance_id].note_refresh + 1, NOTE_REFRESH_MIN, NOTE_REFRESH_MAX); configuration.dexed[instance_id].note_refresh = constrain(configuration.dexed[instance_id].note_refresh + 1, NOTE_REFRESH_MIN, NOTE_REFRESH_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].note_refresh = constrain(configuration.dexed[instance_id].note_refresh - 1, NOTE_REFRESH_MIN, NOTE_REFRESH_MAX); configuration.dexed[instance_id].note_refresh = constrain(configuration.dexed[instance_id].note_refresh - 1, NOTE_REFRESH_MIN, NOTE_REFRESH_MAX);
MicroDexed[instance_id]->setRefreshMode(configuration.dexed[instance_id].note_refresh);
} }
MicroDexed[instance_id]->setRefreshMode(configuration.dexed[instance_id].note_refresh);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].note_refresh) switch (configuration.dexed[instance_id].note_refresh)
{ {
@ -2007,11 +1998,11 @@ void UI_func_pb_range(uint8_t param)
configuration.dexed[instance_id].pb_range = constrain(configuration.dexed[instance_id].pb_range + ENCODER[ENC_R].speed(), PB_RANGE_MIN, PB_RANGE_MAX); configuration.dexed[instance_id].pb_range = constrain(configuration.dexed[instance_id].pb_range + ENCODER[ENC_R].speed(), PB_RANGE_MIN, PB_RANGE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].pb_range = constrain(configuration.dexed[instance_id].pb_range - ENCODER[ENC_R].speed(), PB_RANGE_MIN, PB_RANGE_MAX); configuration.dexed[instance_id].pb_range = constrain(configuration.dexed[instance_id].pb_range - ENCODER[ENC_R].speed(), PB_RANGE_MIN, PB_RANGE_MAX);
}
lcd_display_bar_int("PB Range", configuration.dexed[instance_id].pb_range, 1.0, PB_RANGE_MIN, PB_RANGE_MAX, 2, false, false, false, false); lcd_display_bar_int("PB Range", configuration.dexed[instance_id].pb_range, 1.0, PB_RANGE_MIN, PB_RANGE_MAX, 2, false, false, false, false);
MicroDexed[instance_id]->setPBController(configuration.dexed[instance_id].pb_range, configuration.dexed[instance_id].pb_step); MicroDexed[instance_id]->setPBController(configuration.dexed[instance_id].pb_range, configuration.dexed[instance_id].pb_step);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2050,11 +2041,11 @@ void UI_func_pb_step(uint8_t param)
configuration.dexed[instance_id].pb_step = constrain(configuration.dexed[instance_id].pb_step + ENCODER[ENC_R].speed(), PB_STEP_MIN, PB_STEP_MAX); configuration.dexed[instance_id].pb_step = constrain(configuration.dexed[instance_id].pb_step + ENCODER[ENC_R].speed(), PB_STEP_MIN, PB_STEP_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].pb_step = constrain(configuration.dexed[instance_id].pb_step - ENCODER[ENC_R].speed(), PB_STEP_MIN, PB_STEP_MAX); configuration.dexed[instance_id].pb_step = constrain(configuration.dexed[instance_id].pb_step - ENCODER[ENC_R].speed(), PB_STEP_MIN, PB_STEP_MAX);
}
lcd_display_bar_int("PB Step", configuration.dexed[instance_id].pb_step, 1.0, PB_STEP_MIN, PB_STEP_MAX, 2, false, false, false, false); lcd_display_bar_int("PB Step", configuration.dexed[instance_id].pb_step, 1.0, PB_STEP_MIN, PB_STEP_MAX, 2, false, false, false, false);
MicroDexed[instance_id]->setPBController(configuration.dexed[instance_id].pb_range, configuration.dexed[instance_id].pb_step); MicroDexed[instance_id]->setPBController(configuration.dexed[instance_id].pb_range, configuration.dexed[instance_id].pb_step);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2093,11 +2084,11 @@ void UI_func_mw_range(uint8_t param)
configuration.dexed[instance_id].mw_range = constrain(configuration.dexed[instance_id].mw_range + ENCODER[ENC_R].speed(), MW_RANGE_MIN, MW_RANGE_MAX); configuration.dexed[instance_id].mw_range = constrain(configuration.dexed[instance_id].mw_range + ENCODER[ENC_R].speed(), MW_RANGE_MIN, MW_RANGE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].mw_range = constrain(configuration.dexed[instance_id].mw_range - ENCODER[ENC_R].speed(), MW_RANGE_MIN, MW_RANGE_MAX); configuration.dexed[instance_id].mw_range = constrain(configuration.dexed[instance_id].mw_range - ENCODER[ENC_R].speed(), MW_RANGE_MIN, MW_RANGE_MAX);
}
lcd_display_bar_int("MW Range", configuration.dexed[instance_id].mw_range, 1.0, MW_RANGE_MIN, MW_RANGE_MAX, 2, false, false, false, false); lcd_display_bar_int("MW Range", configuration.dexed[instance_id].mw_range, 1.0, MW_RANGE_MIN, MW_RANGE_MAX, 2, false, false, false, false);
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2136,10 +2127,10 @@ void UI_func_mw_assign(uint8_t param)
configuration.dexed[instance_id].mw_assign = constrain(configuration.dexed[instance_id].mw_assign + 1, MW_ASSIGN_MIN, MW_ASSIGN_MAX); configuration.dexed[instance_id].mw_assign = constrain(configuration.dexed[instance_id].mw_assign + 1, MW_ASSIGN_MIN, MW_ASSIGN_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].mw_assign = constrain(configuration.dexed[instance_id].mw_assign - 1, MW_ASSIGN_MIN, MW_ASSIGN_MAX); configuration.dexed[instance_id].mw_assign = constrain(configuration.dexed[instance_id].mw_assign - 1, MW_ASSIGN_MIN, MW_ASSIGN_MAX);
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode);
} }
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].mw_assign) switch (configuration.dexed[instance_id].mw_assign)
{ {
@ -2205,11 +2196,11 @@ void UI_func_mw_mode(uint8_t param)
configuration.dexed[instance_id].mw_mode = constrain(configuration.dexed[instance_id].mw_mode + 1, MW_MODE_MIN, MW_MODE_MAX); configuration.dexed[instance_id].mw_mode = constrain(configuration.dexed[instance_id].mw_mode + 1, MW_MODE_MIN, MW_MODE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].mw_mode = constrain(configuration.dexed[instance_id].mw_mode - 1, MW_MODE_MIN, MW_MODE_MAX); configuration.dexed[instance_id].mw_mode = constrain(configuration.dexed[instance_id].mw_mode - 1, MW_MODE_MIN, MW_MODE_MAX);
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode);
MicroDexed[instance_id]->controllers.refresh();
} }
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode);
MicroDexed[instance_id]->controllers.refresh();
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].mw_mode) switch (configuration.dexed[instance_id].mw_mode)
{ {
@ -2260,11 +2251,11 @@ void UI_func_fc_range(uint8_t param)
configuration.dexed[instance_id].fc_range = constrain(configuration.dexed[instance_id].fc_range + ENCODER[ENC_R].speed(), FC_RANGE_MIN, FC_RANGE_MAX); configuration.dexed[instance_id].fc_range = constrain(configuration.dexed[instance_id].fc_range + ENCODER[ENC_R].speed(), FC_RANGE_MIN, FC_RANGE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].fc_range = constrain(configuration.dexed[instance_id].fc_range - ENCODER[ENC_R].speed(), FC_RANGE_MIN, FC_RANGE_MAX); configuration.dexed[instance_id].fc_range = constrain(configuration.dexed[instance_id].fc_range - ENCODER[ENC_R].speed(), FC_RANGE_MIN, FC_RANGE_MAX);
}
lcd_display_bar_int("FC Range", configuration.dexed[instance_id].fc_range, 1.0, FC_RANGE_MIN, FC_RANGE_MAX, 2, false, false, false, false); lcd_display_bar_int("FC Range", configuration.dexed[instance_id].fc_range, 1.0, FC_RANGE_MIN, FC_RANGE_MAX, 2, false, false, false, false);
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2303,10 +2294,10 @@ void UI_func_fc_assign(uint8_t param)
configuration.dexed[instance_id].fc_assign = constrain(configuration.dexed[instance_id].fc_assign + 1, FC_ASSIGN_MIN, FC_ASSIGN_MAX); configuration.dexed[instance_id].fc_assign = constrain(configuration.dexed[instance_id].fc_assign + 1, FC_ASSIGN_MIN, FC_ASSIGN_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].fc_assign = constrain(configuration.dexed[instance_id].fc_assign - 1, FC_ASSIGN_MIN, FC_ASSIGN_MAX); configuration.dexed[instance_id].fc_assign = constrain(configuration.dexed[instance_id].fc_assign - 1, FC_ASSIGN_MIN, FC_ASSIGN_MAX);
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode);
} }
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].fc_assign) switch (configuration.dexed[instance_id].fc_assign)
{ {
@ -2372,11 +2363,11 @@ void UI_func_fc_mode(uint8_t param)
configuration.dexed[instance_id].fc_mode = constrain(configuration.dexed[instance_id].fc_mode + 1, FC_MODE_MIN, FC_MODE_MAX); configuration.dexed[instance_id].fc_mode = constrain(configuration.dexed[instance_id].fc_mode + 1, FC_MODE_MIN, FC_MODE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].fc_mode = constrain(configuration.dexed[instance_id].fc_mode - 1, FC_MODE_MIN, FC_MODE_MAX); configuration.dexed[instance_id].fc_mode = constrain(configuration.dexed[instance_id].fc_mode - 1, FC_MODE_MIN, FC_MODE_MAX);
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode);
MicroDexed[instance_id]->controllers.refresh();
} }
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode);
MicroDexed[instance_id]->controllers.refresh();
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].fc_mode) switch (configuration.dexed[instance_id].fc_mode)
{ {
@ -2427,11 +2418,11 @@ void UI_func_bc_range(uint8_t param)
configuration.dexed[instance_id].bc_range = constrain(configuration.dexed[instance_id].bc_range + ENCODER[ENC_R].speed(), BC_RANGE_MIN, BC_RANGE_MAX); configuration.dexed[instance_id].bc_range = constrain(configuration.dexed[instance_id].bc_range + ENCODER[ENC_R].speed(), BC_RANGE_MIN, BC_RANGE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].bc_range = constrain(configuration.dexed[instance_id].bc_range - ENCODER[ENC_R].speed(), BC_RANGE_MIN, BC_RANGE_MAX); configuration.dexed[instance_id].bc_range = constrain(configuration.dexed[instance_id].bc_range - ENCODER[ENC_R].speed(), BC_RANGE_MIN, BC_RANGE_MAX);
}
lcd_display_bar_int("BC Range", configuration.dexed[instance_id].bc_range, 1.0, BC_RANGE_MIN, BC_RANGE_MAX, 2, false, false, false, false); lcd_display_bar_int("BC Range", configuration.dexed[instance_id].bc_range, 1.0, BC_RANGE_MIN, BC_RANGE_MAX, 2, false, false, false, false);
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode); MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2470,10 +2461,10 @@ void UI_func_bc_assign(uint8_t param)
configuration.dexed[instance_id].bc_assign = constrain(configuration.dexed[instance_id].bc_assign + 1, BC_ASSIGN_MIN, BC_ASSIGN_MAX); configuration.dexed[instance_id].bc_assign = constrain(configuration.dexed[instance_id].bc_assign + 1, BC_ASSIGN_MIN, BC_ASSIGN_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].bc_assign = constrain(configuration.dexed[instance_id].bc_assign - 1, BC_ASSIGN_MIN, BC_ASSIGN_MAX); configuration.dexed[instance_id].bc_assign = constrain(configuration.dexed[instance_id].bc_assign - 1, BC_ASSIGN_MIN, BC_ASSIGN_MAX);
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode);
} }
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].bc_assign) switch (configuration.dexed[instance_id].bc_assign)
{ {
@ -2539,11 +2530,11 @@ void UI_func_bc_mode(uint8_t param)
configuration.dexed[instance_id].bc_mode = constrain(configuration.dexed[instance_id].bc_mode + 1, BC_MODE_MIN, BC_MODE_MAX); configuration.dexed[instance_id].bc_mode = constrain(configuration.dexed[instance_id].bc_mode + 1, BC_MODE_MIN, BC_MODE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].bc_mode = constrain(configuration.dexed[instance_id].bc_mode - 1, BC_MODE_MIN, BC_MODE_MAX); configuration.dexed[instance_id].bc_mode = constrain(configuration.dexed[instance_id].bc_mode - 1, BC_MODE_MIN, BC_MODE_MAX);
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode);
MicroDexed[instance_id]->controllers.refresh();
} }
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode);
MicroDexed[instance_id]->controllers.refresh();
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].bc_mode) switch (configuration.dexed[instance_id].bc_mode)
{ {
@ -2594,11 +2585,11 @@ void UI_func_at_range(uint8_t param)
configuration.dexed[instance_id].at_range = constrain(configuration.dexed[instance_id].at_range + ENCODER[ENC_R].speed(), AT_RANGE_MIN, AT_RANGE_MAX); configuration.dexed[instance_id].at_range = constrain(configuration.dexed[instance_id].at_range + ENCODER[ENC_R].speed(), AT_RANGE_MIN, AT_RANGE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].at_range = constrain(configuration.dexed[instance_id].at_range - ENCODER[ENC_R].speed(), AT_RANGE_MIN, AT_RANGE_MAX); configuration.dexed[instance_id].at_range = constrain(configuration.dexed[instance_id].at_range - ENCODER[ENC_R].speed(), AT_RANGE_MIN, AT_RANGE_MAX);
}
lcd_display_bar_int("AT Range", configuration.dexed[instance_id].at_range, 1.0, AT_RANGE_MIN, AT_RANGE_MAX, 2, false, false, false, false); lcd_display_bar_int("AT Range", configuration.dexed[instance_id].at_range, 1.0, AT_RANGE_MIN, AT_RANGE_MAX, 2, false, false, false, false);
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode); MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2637,10 +2628,10 @@ void UI_func_at_assign(uint8_t param)
configuration.dexed[instance_id].at_assign = constrain(configuration.dexed[instance_id].at_assign + 1, AT_ASSIGN_MIN, AT_ASSIGN_MAX); configuration.dexed[instance_id].at_assign = constrain(configuration.dexed[instance_id].at_assign + 1, AT_ASSIGN_MIN, AT_ASSIGN_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].at_assign = constrain(configuration.dexed[instance_id].at_assign - 1, AT_ASSIGN_MIN, AT_ASSIGN_MAX); configuration.dexed[instance_id].at_assign = constrain(configuration.dexed[instance_id].at_assign - 1, AT_ASSIGN_MIN, AT_ASSIGN_MAX);
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode);
} }
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].at_assign) switch (configuration.dexed[instance_id].at_assign)
{ {
@ -2706,11 +2697,11 @@ void UI_func_at_mode(uint8_t param)
configuration.dexed[instance_id].at_mode = constrain(configuration.dexed[instance_id].at_mode + 1, AT_MODE_MIN, AT_MODE_MAX); configuration.dexed[instance_id].at_mode = constrain(configuration.dexed[instance_id].at_mode + 1, AT_MODE_MIN, AT_MODE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].at_mode = constrain(configuration.dexed[instance_id].at_mode - 1, AT_MODE_MIN, AT_MODE_MAX); configuration.dexed[instance_id].at_mode = constrain(configuration.dexed[instance_id].at_mode - 1, AT_MODE_MIN, AT_MODE_MAX);
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode);
MicroDexed[instance_id]->controllers.refresh();
} }
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode);
MicroDexed[instance_id]->controllers.refresh();
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].at_mode) switch (configuration.dexed[instance_id].at_mode)
{ {
@ -2761,10 +2752,10 @@ void UI_func_portamento_mode(uint8_t param)
configuration.dexed[instance_id].portamento_mode = constrain(configuration.dexed[instance_id].portamento_mode + 1, PORTAMENTO_MODE_MIN, PORTAMENTO_MODE_MAX); configuration.dexed[instance_id].portamento_mode = constrain(configuration.dexed[instance_id].portamento_mode + 1, PORTAMENTO_MODE_MIN, PORTAMENTO_MODE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].portamento_mode = constrain(configuration.dexed[instance_id].portamento_mode - 1, PORTAMENTO_MODE_MIN, PORTAMENTO_MODE_MAX); configuration.dexed[instance_id].portamento_mode = constrain(configuration.dexed[instance_id].portamento_mode - 1, PORTAMENTO_MODE_MIN, PORTAMENTO_MODE_MAX);
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time);
} }
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].portamento_mode) switch (configuration.dexed[instance_id].portamento_mode)
{ {
@ -2818,10 +2809,10 @@ void UI_func_portamento_glissando(uint8_t param)
configuration.dexed[instance_id].portamento_glissando = constrain(configuration.dexed[instance_id].portamento_glissando + 1, PORTAMENTO_GLISSANDO_MIN, PORTAMENTO_GLISSANDO_MAX); configuration.dexed[instance_id].portamento_glissando = constrain(configuration.dexed[instance_id].portamento_glissando + 1, PORTAMENTO_GLISSANDO_MIN, PORTAMENTO_GLISSANDO_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].portamento_glissando = constrain(configuration.dexed[instance_id].portamento_glissando - 1, PORTAMENTO_GLISSANDO_MIN, PORTAMENTO_GLISSANDO_MAX); configuration.dexed[instance_id].portamento_glissando = constrain(configuration.dexed[instance_id].portamento_glissando - 1, PORTAMENTO_GLISSANDO_MIN, PORTAMENTO_GLISSANDO_MAX);
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time);
} }
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].portamento_glissando) switch (configuration.dexed[instance_id].portamento_glissando)
{ {
@ -2869,11 +2860,12 @@ void UI_func_portamento_time(uint8_t param)
configuration.dexed[instance_id].portamento_time = constrain(configuration.dexed[instance_id].portamento_time + ENCODER[ENC_R].speed(), PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX); configuration.dexed[instance_id].portamento_time = constrain(configuration.dexed[instance_id].portamento_time + ENCODER[ENC_R].speed(), PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].portamento_time = constrain(configuration.dexed[instance_id].portamento_time - ENCODER[ENC_R].speed(), PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX); configuration.dexed[instance_id].portamento_time = constrain(configuration.dexed[instance_id].portamento_time - ENCODER[ENC_R].speed(), PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX);
}
lcd_display_bar_int("Portam. Time", configuration.dexed[instance_id].portamento_time, 1.0, PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX, 2, false, false, false, false); lcd_display_bar_int("Portam. Time", configuration.dexed[instance_id].portamento_time, 1.0, PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX, 2, false, false, false, false);
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time);
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2995,9 +2987,10 @@ void UI_handle_OP(uint8_t param, uint8_t op, uint8_t instance_id)
{ {
lcd.print(F("[DISABLED]")); lcd.print(F("[DISABLED]"));
} }
MicroDexed[instance_id]->setOPs(configuration.dexed[instance_id].op_enabled);
MicroDexed[instance_id]->doRefreshVoice();
} }
MicroDexed[instance_id]->setOPs(configuration.dexed[instance_id].op_enabled);
MicroDexed[instance_id]->doRefreshVoice();
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -3059,6 +3052,7 @@ void UI_func_midi_soft_thru(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.sys.soft_midi_thru = constrain(configuration.sys.soft_midi_thru - 1, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX); configuration.sys.soft_midi_thru = constrain(configuration.sys.soft_midi_thru - 1, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX);
} }
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.sys.soft_midi_thru) switch (configuration.sys.soft_midi_thru)
{ {
@ -3101,9 +3095,9 @@ void UI_func_velocity_level(uint8_t param)
configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level + ENCODER[ENC_R].speed(), VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX); configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level + ENCODER[ENC_R].speed(), VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level - ENCODER[ENC_R].speed(), VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX); configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level - ENCODER[ENC_R].speed(), VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX);
lcd_display_bar_int("Velocity Lvl", configuration.dexed[instance_id].velocity_level, 1.0, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX, 3, false, false, false, false);
} }
lcd_display_bar_int("Velocity Lvl", configuration.dexed[instance_id].velocity_level, 1.0, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX, 3, false, false, false, false);
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********

@ -4,7 +4,7 @@
# #
# MIT License # MIT License
# #
# Copyright (c) [2018] [Nils Feldkämper] # Copyright (c) [2020] [Nils Feldkämper]
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal # of this software and associated documentation files (the "Software"), to deal
@ -59,6 +59,9 @@ _LCDML_DISP_cfg_scrollbar LITERAL1
_LCDML_VERSION LITERAL1 _LCDML_VERSION LITERAL1
_LCDML_NO_FUNC LITERAL1
_LCDML_FIRST_ELEMENT_ID LITERAL1
_LCDML_CONTROL_serial_enter LITERAL1 _LCDML_CONTROL_serial_enter LITERAL1
_LCDML_CONTROL_serial_up LITERAL1 _LCDML_CONTROL_serial_up LITERAL1
_LCDML_CONTROL_serial_down LITERAL1 _LCDML_CONTROL_serial_down LITERAL1
@ -271,12 +274,14 @@ FUNC_disableScreensaver KEYWORD2
FUNC_setGBAToLastFunc KEYWORD2 FUNC_setGBAToLastFunc KEYWORD2
FUNC_setGBAToLastCursorPos KEYWORD2 FUNC_setGBAToLastCursorPos KEYWORD2
FUNC_setGBA KEYWORD2 FUNC_setGBA KEYWORD2
FUNC_setCEMask KEYWORD2
OTHER_jumpToFunc KEYWORD2 OTHER_jumpToFunc KEYWORD2
OTHER_jumpToID KEYWORD2 OTHER_jumpToID KEYWORD2
OTHER_setCursorToFunc KEYWORD2 OTHER_setCursorToFunc KEYWORD2
OTHER_setCursorToID KEYWORD2 OTHER_setCursorToID KEYWORD2
OTHER_getIDFromFunction KEYWORD2 OTHER_getIDFromFunction KEYWORD2
OTHER_updateFunc KEYWORD2
TIMER_ms KEYWORD2 TIMER_ms KEYWORD2
TIMER_msReset KEYWORD2 TIMER_msReset KEYWORD2

@ -145,7 +145,7 @@ void LCDMenuLib2::loop_control(void)
// check if a "jumpTo - setCursoTo" function is active // check if a "jumpTo - setCursoTo" function is active
// this check is necessary because there can be a bad timing between a timebased function call or a event and // this check is necessary because there can be a bad timing between a timebased function call or a event and
// another OTHER_...() function. // another OTHER_...() function.
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled) == false) if(bitRead(REG_special, _LCDML_REG_special_OTHER_function_active) == false)
{ {
// screensaver handling // screensaver handling
// check if the screensaver is enabled and a callback function is defined // check if the screensaver is enabled and a callback function is defined
@ -256,7 +256,7 @@ void LCDMenuLib2::loop_menu(void)
// local declaration // local declaration
uint8_t cnt = 0; uint8_t cnt = 0;
uint8_t found = _LCDML_NO_FUNC; uint8_t found = _LCDML_FIRST_ELEMENT_ID;
LCDMenuLib2_menu *tmp; LCDMenuLib2_menu *tmp;
// ============================================ // ============================================
@ -372,18 +372,16 @@ void LCDMenuLib2::loop_menu(void)
// ============================================ // ============================================
// jump to handling // jump to handling
// ============================================ // ============================================
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled)) if(bitRead(REG_special, _LCDML_REG_special_OTHER_function_active))
{ {
// debug information // debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - is active")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - is active"));
MENU_enScroll(); MENU_enScroll();
bitClear(REG_special, _LCDML_REG_special_jumpTo_enabled); bitClear(REG_special, _LCDML_REG_special_OTHER_function_active);
bitClear(REG_control, _LCDML_REG_control_dynMenuDisplayed); bitClear(REG_control, _LCDML_REG_control_dynMenuDisplayed);
bitSet(REG_control, _LCDML_REG_control_disable_hidden);
// got to root // got to root
if(bitRead(REG_control, _LCDML_REG_control_menu_func_active) == true) if(bitRead(REG_control, _LCDML_REG_control_menu_func_active) == true)
{ {
@ -471,7 +469,7 @@ void LCDMenuLib2::loop_menu(void)
} }
// check if the last item is reached // check if the last item is reached
if(curMenu->getParent()->getID() == _LCDML_NO_FUNC && curMenu->getSibling(1) == NULL) if(curMenu->getParent()->getID() == _LCDML_FIRST_ELEMENT_ID && curMenu->getSibling(1) == NULL)
{ {
break; break;
} }
@ -483,6 +481,9 @@ void LCDMenuLib2::loop_menu(void)
// check childs for childs // check childs for childs
if(curMenu->getChild(0) != NULL) if(curMenu->getChild(0) != NULL)
{ {
// Debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("gointo an element"));
// -- GO INTO -- // -- GO INTO --
layer++; layer++;
@ -499,10 +500,10 @@ void LCDMenuLib2::loop_menu(void)
else else
{ {
// check parent element // check parent element
if(curMenu->getParent()->getID() == _LCDML_NO_FUNC) if(curMenu->getParent()->getID() == _LCDML_FIRST_ELEMENT_ID)
{ {
// Debug information // Debug information
DBG_print(LCDML_DBG_function_name_OTHER, F("nothing found: point (A) / ID: ")); DBG_print(LCDML_DBG_function_name_OTHER, F("nothing found: endpoint (A) / ID: "));
DBG_println(LCDML_DBG_function_name_OTHER, curMenu->getID()); DBG_println(LCDML_DBG_function_name_OTHER, curMenu->getID());
} }
else else
@ -516,7 +517,7 @@ void LCDMenuLib2::loop_menu(void)
layer--; layer--;
// Debug information // Debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("go to parent element")); DBG_println(LCDML_DBG_function_name_OTHER, F("goback to parent element"));
// check if the parent element have siblings // check if the parent element have siblings
if(curMenu->getSibling(1) != NULL) if(curMenu->getSibling(1) != NULL)
@ -527,7 +528,7 @@ void LCDMenuLib2::loop_menu(void)
} }
else else
{ {
if(curMenu->getParent()->getID() == _LCDML_NO_FUNC) if(curMenu->getParent()->getID() == _LCDML_FIRST_ELEMENT_ID)
{ {
break; break;
} }
@ -547,20 +548,17 @@ void LCDMenuLib2::loop_menu(void)
} }
// check element handling // check element handling
if(found != _LCDML_NO_FUNC) if(found != _LCDML_FIRST_ELEMENT_ID)
{ {
// debug information // debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - element found")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - element found"));
tmp = curMenu->getChild(0); tmp = curMenu->getChild(0);
// get the current obj position in this layer // get the current obj position in this layer
do do
{ {
if(tmp->getID() == found) if(tmp->getID() == found)
{ {
cursor_pos_abs = cnt;
cursor_obj_pos = cnt;
break; break;
} }
else else
@ -572,7 +570,11 @@ void LCDMenuLib2::loop_menu(void)
cnt++; cnt++;
} }
while((tmp = tmp->getSibling(1)) != NULL); while((tmp = tmp->getSibling(1)) != NULL);
// tmp have here the pointer to the right position // tmp have here the pointer to the right position
//tmp = --pointer_position--
cursor_pos_abs = cnt;
cursor_obj_pos = cnt;
if(bitRead(REG_special, _LCDML_REG_special_setCursorTo) == false) if(bitRead(REG_special, _LCDML_REG_special_setCursorTo) == false)
{ {
@ -598,7 +600,6 @@ void LCDMenuLib2::loop_menu(void)
// Debug information // Debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_helpFunction - callbackfunction is hidden, the cursor cannot be set to this possition: go back to root menu")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_helpFunction - callbackfunction is hidden, the cursor cannot be set to this possition: go back to root menu"));
bitClear(REG_control, _LCDML_REG_control_disable_hidden);
MENU_goRoot(); MENU_goRoot();
} }
else else
@ -610,8 +611,6 @@ void LCDMenuLib2::loop_menu(void)
// update the menu // update the menu
DISP_update(); DISP_update();
bitClear(REG_control, _LCDML_REG_control_disable_hidden);
// set current cursor possition with hidden elements // set current cursor possition with hidden elements
tmp = curMenu->getChild(0); tmp = curMenu->getChild(0);
cnt = 0; cnt = 0;
@ -620,7 +619,6 @@ void LCDMenuLib2::loop_menu(void)
{ {
if(tmp->checkCondition()) if(tmp->checkCondition())
{ {
//if(obj_pos == cursor_obj_pos)
if(tmp->getID() == found) if(tmp->getID() == found)
{ {
cursor_pos_abs = cnt; cursor_pos_abs = cnt;
@ -655,8 +653,6 @@ void LCDMenuLib2::loop_menu(void)
// debug information // debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - nothing found")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpTo.. / LCDML.OTHER_setCursorTo... - nothing found"));
} }
bitClear(REG_control, _LCDML_REG_control_disable_hidden);
} }
else else
{ {
@ -674,8 +670,16 @@ void LCDMenuLib2::loop_menu(void)
{ {
// => do not close the running function // => do not close the running function
// check if a loop time was set or a button was pressed or the function is called the first time // check if a loop time was set or a button was pressed or the function is called the first time
if(TIMER_ms(menuFunction_loopTimer, actMenu_default_time) == true || bitRead(REG_MenuFunction, _LCDML_REG_MenuFunction_setup) == false || BT_checkAny() > 0 || CE_checkAny() > 0) if( TIMER_ms(menuFunction_loopTimer, actMenu_default_time) == true ||
bitRead(REG_MenuFunction, _LCDML_REG_MenuFunction_setup) == false ||
BT_checkAny() > 0 ||
CE_checkAny() > 0 ||
bitRead(REG_update, _LCDML_REG_update_menu_function_content)
)
{ {
// reset update flag
bitClear(REG_update, _LCDML_REG_update_menu_function_content);
// call the current menu function // call the current menu function
FUNC_call(); FUNC_call();
} }
@ -880,6 +884,9 @@ void LCDMenuLib2::MENU_goRoot(void)
void LCDMenuLib2::MENU_resetActiveMenu(void) void LCDMenuLib2::MENU_resetActiveMenu(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information
DBG_println(LCDML_DBG_function_name_MENU, F("LCDML.MENU_resetActiveMenu"));
// reset callback function // reset callback function
actMenu_cb_function = NULL; actMenu_cb_function = NULL;
@ -892,7 +899,8 @@ void LCDMenuLib2::MENU_resetActiveMenu(void)
// reset variables // reset variables
actMenu_id = _LCDML_NO_FUNC; actMenu_id = _LCDML_NO_FUNC;
actMenu_param = 0; actMenu_param = 0;
actMenu_default_time = 100000000; actMenu_default_time = 0xFFFFFFFF; // 32 Bit
actMenu_ce_mask = 0xFFFFFFFFFFFFFFFF; // 64 Bit
bitClear(REG_control, _LCDML_REG_control_menu_func_active); bitClear(REG_control, _LCDML_REG_control_menu_func_active);
} }
@ -903,15 +911,87 @@ void LCDMenuLib2::MENU_goBack(void)
// debug information // debug information
DBG_println(LCDML_DBG_function_name_MENU, F("LCDML.MENU_goBack")); DBG_println(LCDML_DBG_function_name_MENU, F("LCDML.MENU_goBack"));
if(curMenu->getParent() != NULL) //declare variables
LCDMenuLib2_menu *tmp;
uint8_t old_id = 0;
uint8_t j = 0;
uint8_t obj_pos = 0;
bool found_visible = false;
old_id = curMenu->getID();
tmp = curMenu->getParent();
// set the curMenu pointer to a other menu element
curMenu = curMenu->getParent();
// update the layer counter
if(layer > 0)
{ {
//set current menu object layer--;
MENU_goMenu(*curMenu->getParent(), true);
} }
else else
{ {
// do nothing // do nothing
} }
// init the cursor_position variables to 0
cursor_obj_pos = 0;
cursor_pos_abs = 0;
// get childs from the current menu element
if((tmp = curMenu->getChild(0)) != NULL)
{
// search the current possition of the cursor
do
{
// check conditions
if (tmp->checkCondition())
{
// when the current element id is the same as the old_id the current cursor position is found
if(tmp->getID() == old_id)
{
cursor_pos_abs = j;
cursor_obj_pos = obj_pos;
if(cursor_pos_abs - (window_rows-1) > 0)
{
window_start = cursor_pos_abs-(window_rows-1);
}
else
{
window_start = 0;
}
MENU_doScroll(10);
found_visible = true;
break;
}
else
{
// do nothing
}
// count all visible elements
j++;
}
else
{
// do nothing
}
obj_pos++;
// select the next sibling when it exists
} while ((tmp = tmp->getSibling(1)) != NULL);
if(found_visible == false)
{
MENU_goRoot();
}
}
else
{
// Something is wrong, go to a stable state (root menu)
MENU_goRoot();
}
} }
/* ******************************************************************** */ /* ******************************************************************** */
@ -947,8 +1027,19 @@ void LCDMenuLib2::MENU_goInto(void)
//check if element has visible children //check if element has visible children
if(MENU_countChilds(curMenu->getChild(cursor_obj_pos)) > 0) if(MENU_countChilds(curMenu->getChild(cursor_obj_pos)) > 0)
{ {
// Menu found, goInto // set the curMenu pointer to a other menu element
MENU_goMenu(*curMenu->getChild(cursor_obj_pos), false); curMenu = curMenu->getChild(cursor_obj_pos);
// new layer
window_start = 0;
cursor_obj_pos = 0;
cursor_pos_abs = 0;
MENU_initFirstElement();
// update the layer counter
layer++;
BT_resetAll(); // reset all buttons BT_resetAll(); // reset all buttons
DISP_update(); DISP_update();
} }
@ -970,121 +1061,6 @@ void LCDMenuLib2::MENU_goInto(void)
} }
} }
/* ******************************************************************** */
void LCDMenuLib2::MENU_goMenu(LCDMenuLib2_menu &p_m, uint8_t p_back)
/* ******************************************************************** */
{
// debug information
DBG_println(LCDML_DBG_function_name_MENU, F("LCDML.MENU_goMenu"));
//declare variables
LCDMenuLib2_menu *tmp;
uint8_t old_id = curMenu->getID();
uint8_t j = 0;
uint8_t obj_pos = 0;
boolean found_visible = false;
// check if the menu is opening or closing
if(p_back == false)
{
// set the curMenu pointer to a other menu element
curMenu = &p_m;
// only update the contet when the layer is smaller then 254
if(layer < (_LCDML_NO_FUNC-1))
{
// new layer
window_start = 0;
cursor_obj_pos = 0;
cursor_pos_abs = 0;
MENU_initFirstElement();
// update the layer counter
layer++;
}
else
{
// do nothing
}
}
else
{
// update the layer counter
if(layer > 0)
{
layer--;
}
else
{
// do nothing
}
// set the curMenu pointer to a other menu element
curMenu = &p_m;
// init the cursor_position variables to 0
cursor_obj_pos = 0;
cursor_pos_abs = 0;
// get childs from the current menu element
if((tmp = curMenu->getChild(0)) != NULL)
{
// search the current possition of the cursor
do
{
// check conditions
if (tmp->checkCondition() || bitRead(REG_control, _LCDML_REG_control_disable_hidden))
{
// when the current element id is the same as the old_id the current cursor position is found
if(tmp->getID() == old_id)
{
cursor_pos_abs = j;
cursor_obj_pos = obj_pos;
if(cursor_pos_abs - (window_rows-1) > 0)
{
window_start = cursor_pos_abs-(window_rows-1);
}
else
{
window_start = 0;
}
MENU_doScroll(10);
found_visible = true;
break;
}
else
{
// do nothing
}
// count all visible elements
j++;
}
else
{
// do nothing
}
obj_pos++;
// select the next sibling when it exists
} while ((tmp = tmp->getSibling(1)) != NULL);
if(found_visible == false)
{
MENU_goRoot();
}
}
else
{
// Something is wrong, go to a stable state (root menu)
MENU_goRoot();
}
}
}
/* ******************************************************************** */ /* ******************************************************************** */
LCDMenuLib2_menu * LCDMenuLib2::MENU_getCurrentObj(void) LCDMenuLib2_menu * LCDMenuLib2::MENU_getCurrentObj(void)
@ -1106,13 +1082,17 @@ LCDMenuLib2_menu * LCDMenuLib2::MENU_getRootObj(void)
LCDMenuLib2_menu *tmp; LCDMenuLib2_menu *tmp;
if(curMenu->getID() != _LCDML_NO_FUNC) if(curMenu->getID() != _LCDML_FIRST_ELEMENT_ID)
{ {
tmp = curMenu; tmp = curMenu;
while((tmp = tmp->getParent()) != NULL) while(true)
{ {
if(tmp->getID() == _LCDML_NO_FUNC) if(tmp->getID() != _LCDML_FIRST_ELEMENT_ID)
{
tmp = tmp->getParent();
}
else
{ {
return tmp; return tmp;
} }
@ -1218,7 +1198,7 @@ void LCDMenuLib2::MENU_doScroll(uint8_t state)
uint8_t cnt_visible = 0; uint8_t cnt_visible = 0;
uint8_t obj_pos = 0; uint8_t obj_pos = 0;
uint8_t last_valid_obj_pos = 0; uint8_t last_valid_obj_pos = 0;
boolean rollover = false; bool rollover = false;
//content: //content:
// 0 = scroll up // 0 = scroll up
@ -1526,7 +1506,7 @@ uint8_t LCDMenuLib2::MENU_countChilds(LCDMenuLib2_menu *menu, uint8_t all)
{ {
do do
{ {
if (tmp->checkCondition() || bitRead(REG_control, _LCDML_REG_control_disable_hidden) || all == true) if (tmp->checkCondition() || all == true)
{ {
j++; j++;
} }
@ -1573,13 +1553,13 @@ uint8_t LCDMenuLib2::MENU_getParentID(uint8_t p_layer)
{ {
for(uint8_t i=0; i<p_layer; i++) for(uint8_t i=0; i<p_layer; i++)
{ {
if(tmp->getParent() != NULL) if(tmp->getParent()->getID() != _LCDML_FIRST_ELEMENT_ID)
{ {
tmp = tmp->getParent(); tmp = tmp->getParent();
} }
else else
{ {
return _LCDML_NO_FUNC; return _LCDML_FIRST_ELEMENT_ID;
break; break;
} }
} }
@ -1588,7 +1568,7 @@ uint8_t LCDMenuLib2::MENU_getParentID(uint8_t p_layer)
} }
else else
{ {
return _LCDML_NO_FUNC; return _LCDML_FIRST_ELEMENT_ID;
} }
} }
@ -1647,7 +1627,7 @@ void LCDMenuLib2::MENU_disScroll(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::MENU_getScrollDisableStatus(void) bool LCDMenuLib2::MENU_getScrollDisableStatus(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -1689,7 +1669,7 @@ uint8_t LCDMenuLib2::MENU_getElementIDFromCursorPos(void)
} }
else else
{ {
return _LCDML_NO_FUNC; return _LCDML_FIRST_ELEMENT_ID;
} }
} }
@ -1723,7 +1703,7 @@ void LCDMenuLib2::DISP_clear(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::DISP_checkMenuUpdate(void) bool LCDMenuLib2::DISP_checkMenuUpdate(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -1742,7 +1722,7 @@ boolean LCDMenuLib2::DISP_checkMenuUpdate(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::DISP_checkMenuCursorUpdate(void) bool LCDMenuLib2::DISP_checkMenuCursorUpdate(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -1850,7 +1830,7 @@ void LCDMenuLib2::FUNC_call(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::FUNC_setup(void) bool LCDMenuLib2::FUNC_setup(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -1879,7 +1859,7 @@ boolean LCDMenuLib2::FUNC_setup(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::FUNC_loop(void) bool LCDMenuLib2::FUNC_loop(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -1905,7 +1885,7 @@ boolean LCDMenuLib2::FUNC_loop(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::FUNC_close(void) bool LCDMenuLib2::FUNC_close(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2020,6 +2000,23 @@ void LCDMenuLib2::FUNC_setGBA(void)
} }
} }
/* ******************************************************************** */
void LCDMenuLib2::FUNC_setCEMask(unsigned long p_mask)
/* ******************************************************************** */
{
// debug information
DBG_println(LCDML_DBG_function_name_FUNC, F("LCDML.FUNC_setCEMask"));
if(bitRead(REG_control, _LCDML_REG_control_menu_func_active) == true)
{
actMenu_ce_mask = p_mask;
}
else
{
actMenu_ce_mask = 0xFFFFFFFFFFFFFFFF;
}
}
/* ******************************************************************** */ /* ******************************************************************** */
/* ******************************************************************** */ /* ******************************************************************** */
@ -2029,7 +2026,7 @@ void LCDMenuLib2::FUNC_setGBA(void)
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::BT_setup(void) bool LCDMenuLib2::BT_setup(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2109,7 +2106,7 @@ void LCDMenuLib2::BT_quit(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::BT_checkAny(void) bool LCDMenuLib2::BT_checkAny(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2126,7 +2123,7 @@ boolean LCDMenuLib2::BT_checkAny(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::BT_checkEnter(void) bool LCDMenuLib2::BT_checkEnter(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2143,7 +2140,7 @@ boolean LCDMenuLib2::BT_checkEnter(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::BT_checkUp(void) bool LCDMenuLib2::BT_checkUp(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2160,7 +2157,7 @@ boolean LCDMenuLib2::BT_checkUp(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::BT_checkDown(void) bool LCDMenuLib2::BT_checkDown(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2177,7 +2174,7 @@ boolean LCDMenuLib2::BT_checkDown(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::BT_checkLeft(void) bool LCDMenuLib2::BT_checkLeft(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2194,7 +2191,7 @@ boolean LCDMenuLib2::BT_checkLeft(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::BT_checkRight(void) bool LCDMenuLib2::BT_checkRight(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2211,7 +2208,7 @@ boolean LCDMenuLib2::BT_checkRight(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::BT_checkQuit(void) bool LCDMenuLib2::BT_checkQuit(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2306,7 +2303,7 @@ void LCDMenuLib2::BT_resetQuit(void)
/* ******************************************************************** */ /* ******************************************************************** */
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::CE_setup(void) bool LCDMenuLib2::CE_setup(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2362,13 +2359,13 @@ void LCDMenuLib2::CE_reset(uint8_t p_event)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::CE_checkAny(void) bool LCDMenuLib2::CE_checkAny(void)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
DBG_println(LCDML_DBG_function_name_CE, F("LCDML.CE_checkAny")); DBG_println(LCDML_DBG_function_name_CE, F("LCDML.CE_checkAny"));
if(REG_custom_event > 0) if((REG_custom_event & actMenu_ce_mask) > 0)
{ {
return true; return true;
} }
@ -2379,7 +2376,7 @@ boolean LCDMenuLib2::CE_checkAny(void)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::CE_check(uint8_t p_event) bool LCDMenuLib2::CE_check(uint8_t p_event)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2440,7 +2437,7 @@ void LCDMenuLib2::TIMER_msReset(unsigned long &p_var)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::TIMER_ms(unsigned long &p_var, unsigned long p_t) bool LCDMenuLib2::TIMER_ms(unsigned long &p_var, unsigned long p_t)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2468,7 +2465,7 @@ void LCDMenuLib2::TIMER_usReset(unsigned long &p_var)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2::TIMER_us(unsigned long &p_var, unsigned long p_t) bool LCDMenuLib2::TIMER_us(unsigned long &p_var, unsigned long p_t)
/* ******************************************************************** */ /* ******************************************************************** */
{ {
// debug information // debug information
@ -2499,43 +2496,52 @@ void LCDMenuLib2::OTHER_jumpToFunc(LCDML_FuncPtr_pu8 p_search, uint8_t p_para)
// debug information // debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc"));
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled) == true) if(bitRead(REG_special, _LCDML_REG_special_OTHER_function_active) == true)
{ {
// debug information // debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc - is still activ")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc - is still activ"));
} }
else else
{ {
// debug information // check if this menu function is active - do nothing
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc - start")); if(p_search == actMenu_cb_function)
// enable jump to Func
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled);
bitClear(REG_special, _LCDML_REG_special_setCursorTo);
jT_id = 0;
// Save last active Menu ID
actMenu_lastFuncID = actMenu_id;
if(bitRead(REG_control, _LCDML_REG_control_menu_func_active) == true)
{ {
// handle parameters // debug information
jT_paramOld = jT_param; DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc - function is still running"));
bitClear(REG_MenuFunction, _LCDML_REG_MenuFunction_called_from_menu);
} }
else else
{ {
// handle parameters // debug information
jT_paramOld = 0; DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc - start"));
bitSet(REG_MenuFunction, _LCDML_REG_MenuFunction_called_from_menu);
// Save last cursor position bitSet(REG_special, _LCDML_REG_special_OTHER_function_active);
actMenu_lastCursorPositionID = actMenu_cursorPositionID; bitClear(REG_special, _LCDML_REG_special_setCursorTo);
actMenu_cursorPositionID = curMenu->getChild(MENU_getCursorPosAbs())->getID();
}
jT_param = p_para; // Save last active Menu ID
jT_function = p_search; actMenu_lastFuncID = actMenu_id;
if(bitRead(REG_control, _LCDML_REG_control_menu_func_active) == true)
{
// handle parameters
jT_paramOld = jT_param;
bitClear(REG_MenuFunction, _LCDML_REG_MenuFunction_called_from_menu);
}
else
{
// handle parameters
jT_paramOld = 0;
bitSet(REG_MenuFunction, _LCDML_REG_MenuFunction_called_from_menu);
// Save last cursor position
actMenu_lastCursorPositionID = actMenu_cursorPositionID;
actMenu_cursorPositionID = curMenu->getChild(MENU_getCursorPosAbs())->getID();
}
// enable jump to Func
jT_id = 0;
jT_param = p_para;
jT_function = p_search;
}
} }
} }
@ -2548,45 +2554,54 @@ void LCDMenuLib2::OTHER_jumpToID(uint8_t p_id, uint8_t p_para)
if(p_id != _LCDML_NO_FUNC) if(p_id != _LCDML_NO_FUNC)
{ {
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled) == true) if(bitRead(REG_special, _LCDML_REG_special_OTHER_function_active) == true)
{ {
// debug information // debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToID - is still activ")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToID - is still activ"));
} }
else else
{ {
// debug information // check if this menu function is active - do nothing
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToID - start")); if(p_id == actMenu_id)
// enable jump to ID
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled);
bitClear(REG_special, _LCDML_REG_special_setCursorTo);
jT_id = p_id;
// Save last active Menu ID
actMenu_lastFuncID = actMenu_id;
if(bitRead(REG_control, _LCDML_REG_control_menu_func_active) == true)
{ {
// handle parameters // debug information
jT_paramOld = jT_param; DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToFunc - function is still running"));
bitClear(REG_MenuFunction, _LCDML_REG_MenuFunction_called_from_menu);
} }
else else
{ {
// handle parameters // debug information
jT_paramOld = 0; DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_jumpToID - start"));
bitSet(REG_MenuFunction, _LCDML_REG_MenuFunction_called_from_menu); bitSet(REG_special, _LCDML_REG_special_OTHER_function_active);
bitClear(REG_special, _LCDML_REG_special_setCursorTo);
// Save last cursor position // Save last active Menu ID
actMenu_lastCursorPositionID = actMenu_cursorPositionID; actMenu_lastFuncID = actMenu_id;
actMenu_cursorPositionID = curMenu->getChild(MENU_getCursorPosAbs())->getID();
} if(bitRead(REG_control, _LCDML_REG_control_menu_func_active) == true)
{
// handle parameters
jT_paramOld = jT_param;
bitClear(REG_MenuFunction, _LCDML_REG_MenuFunction_called_from_menu);
}
else
{
// handle parameters
jT_paramOld = 0;
jT_param = p_para; bitSet(REG_MenuFunction, _LCDML_REG_MenuFunction_called_from_menu);
jT_function = NULL;
// Save last cursor position
actMenu_lastCursorPositionID = actMenu_cursorPositionID;
actMenu_cursorPositionID = curMenu->getChild(MENU_getCursorPosAbs())->getID();
}
// enable jump to ID
jT_id = p_id;
jT_param = p_para;
jT_function = NULL;
}
} }
} }
else else
@ -2602,7 +2617,7 @@ void LCDMenuLib2::OTHER_setCursorToFunc(LCDML_FuncPtr_pu8 p_search)
// debug information // debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToFunc")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToFunc"));
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled) == true) if(bitRead(REG_special, _LCDML_REG_special_OTHER_function_active) == true)
{ {
// debug information // debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToFunc - is still activ")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToFunc - is still activ"));
@ -2613,7 +2628,7 @@ void LCDMenuLib2::OTHER_setCursorToFunc(LCDML_FuncPtr_pu8 p_search)
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToFunc - start")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToFunc - start"));
// enable jump to Func // enable jump to Func
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled); bitSet(REG_special, _LCDML_REG_special_OTHER_function_active);
bitSet(REG_special, _LCDML_REG_special_setCursorTo); bitSet(REG_special, _LCDML_REG_special_setCursorTo);
jT_id = 0; jT_id = 0;
@ -2652,7 +2667,7 @@ void LCDMenuLib2::OTHER_setCursorToID(uint8_t p_id)
if(p_id != _LCDML_NO_FUNC) if(p_id != _LCDML_NO_FUNC)
{ {
if(bitRead(REG_special, _LCDML_REG_special_jumpTo_enabled) == true) if(bitRead(REG_special, _LCDML_REG_special_OTHER_function_active) == true)
{ {
// debug information // debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToID - is still activ")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToID - is still activ"));
@ -2663,7 +2678,7 @@ void LCDMenuLib2::OTHER_setCursorToID(uint8_t p_id)
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToID - start")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_setCursorToID - start"));
// enable jump to Func // enable jump to Func
bitSet(REG_special, _LCDML_REG_special_jumpTo_enabled); bitSet(REG_special, _LCDML_REG_special_OTHER_function_active);
bitSet(REG_special, _LCDML_REG_special_setCursorTo); bitSet(REG_special, _LCDML_REG_special_setCursorTo);
jT_id = p_id; jT_id = p_id;
@ -2707,7 +2722,6 @@ uint8_t LCDMenuLib2::OTHER_getIDFromFunction(LCDML_FuncPtr_pu8 p_function_name)
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_getIDFromFunction")); DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_getIDFromFunction"));
// define local variables // define local variables
uint8_t step = 0;
LCDMenuLib2_menu *tmp; LCDMenuLib2_menu *tmp;
// set object // set object
@ -2750,7 +2764,7 @@ uint8_t LCDMenuLib2::OTHER_getIDFromFunction(LCDML_FuncPtr_pu8 p_function_name)
*/ */
// check if the last item is reached // check if the last item is reached
if(tmp->getParent()->getID() == _LCDML_NO_FUNC && tmp->getSibling(1) == NULL) if(tmp->getParent()->getID() == _LCDML_FIRST_ELEMENT_ID && tmp->getSibling(1) == NULL)
{ {
break; break;
} }
@ -2762,8 +2776,10 @@ uint8_t LCDMenuLib2::OTHER_getIDFromFunction(LCDML_FuncPtr_pu8 p_function_name)
// check childs for childs // check childs for childs
if(tmp->getChild(0) != NULL) if(tmp->getChild(0) != NULL)
{ {
// Debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("gointo an element"));
// -- GO INTO -- // -- GO INTO --
layer++;
// set next child for check // set next child for check
tmp = tmp->getChild(0); tmp = tmp->getChild(0);
@ -2778,10 +2794,10 @@ uint8_t LCDMenuLib2::OTHER_getIDFromFunction(LCDML_FuncPtr_pu8 p_function_name)
else else
{ {
// check parent element // check parent element
if(tmp->getParent()->getID() == _LCDML_NO_FUNC) if(tmp->getParent()->getID() == _LCDML_FIRST_ELEMENT_ID)
{ {
// Debug information // Debug information
DBG_print(LCDML_DBG_function_name_OTHER, F("nothing found: point (A) / ID: ")); DBG_print(LCDML_DBG_function_name_OTHER, F("end point: (A) / ID: "));
DBG_println(LCDML_DBG_function_name_OTHER, tmp->getID()); DBG_println(LCDML_DBG_function_name_OTHER, tmp->getID());
} }
else else
@ -2792,10 +2808,9 @@ uint8_t LCDMenuLib2::OTHER_getIDFromFunction(LCDML_FuncPtr_pu8 p_function_name)
tmp = tmp->getParent(); tmp = tmp->getParent();
// -- GO Back -- // -- GO Back --
layer--;
// Debug information // Debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("go to parent element")); DBG_println(LCDML_DBG_function_name_OTHER, F("goback to parent element"));
// check if the parent element have siblings // check if the parent element have siblings
if(tmp->getSibling(1) != NULL) if(tmp->getSibling(1) != NULL)
@ -2806,7 +2821,7 @@ uint8_t LCDMenuLib2::OTHER_getIDFromFunction(LCDML_FuncPtr_pu8 p_function_name)
} }
else else
{ {
if(tmp->getParent()->getID() == _LCDML_NO_FUNC) if(tmp->getParent()->getID() == _LCDML_FIRST_ELEMENT_ID)
{ {
break; break;
} }
@ -2827,6 +2842,24 @@ uint8_t LCDMenuLib2::OTHER_getIDFromFunction(LCDML_FuncPtr_pu8 p_function_name)
} }
/* ******************************************************************** */
void LCDMenuLib2::OTHER_updateFunc(void)
/* ******************************************************************** */
{
// debug information
DBG_println(LCDML_DBG_function_name_OTHER, F("LCDML.OTHER_updateFunc"));
if(bitRead(REG_control, _LCDML_REG_control_menu_func_active) == true)
{
bitSet(REG_update, _LCDML_REG_update_menu_function_content);
}
else
{
// do nothing
}
}
/* ******************************************************************** */ /* ******************************************************************** */
/* ******************************************************************** */ /* ******************************************************************** */
/* SCREEN methods */ /* SCREEN methods */

@ -4,7 +4,7 @@
* *
* MIT License * MIT License
* *
* Copyright (c) [2019] [Nils Feldkämper] * Copyright (c) [2020] [Nils Feldkämper]
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -83,7 +83,7 @@
#endif #endif
// Version // Version
#define _LCDML_VERSION "LCDML2 v2.2.2 - 23.04.2020" #define _LCDML_VERSION "LCDML2 v2.2.2 - 27.04.2020"
// this makro is for unused variables which exists for compatibility tings ... // this makro is for unused variables which exists for compatibility tings ...
#define LCDML_UNUSED(expr) do { (void)(expr); } while (0) #define LCDML_UNUSED(expr) do { (void)(expr); } while (0)
@ -110,6 +110,7 @@
// No function constant // No function constant
#define _LCDML_NO_FUNC 255 #define _LCDML_NO_FUNC 255
#define _LCDML_FIRST_ELEMENT_ID 255
// Bit pos control flags // Bit pos control flags
#define _LCDML_REG_control_dynMenuDisplayed 7 #define _LCDML_REG_control_dynMenuDisplayed 7
@ -119,11 +120,11 @@
#define _LCDML_REG_control_update_direct 3 #define _LCDML_REG_control_update_direct 3
#define _LCDML_REG_control_free_2 2 #define _LCDML_REG_control_free_2 2
#define _LCDML_REG_control_rollover 1 #define _LCDML_REG_control_rollover 1
#define _LCDML_REG_control_disable_hidden 0 #define _LCDML_REG_control_free_0 0
// screensaver, jump to function, go Root, ... // screensaver, jump to function, go Root, ...
#define _LCDML_REG_special_setCursorTo 7 #define _LCDML_REG_special_setCursorTo 7
#define _LCDML_REG_special_jumpTo_enabled 6 #define _LCDML_REG_special_OTHER_function_active 6
#define _LCDML_REG_special_free_5 5 #define _LCDML_REG_special_free_5 5
#define _LCDML_REG_special_free_4 4 #define _LCDML_REG_special_free_4 4
#define _LCDML_REG_special_free_3 3 #define _LCDML_REG_special_free_3 3
@ -155,7 +156,7 @@
#define _LCDML_REG_update_content 7 #define _LCDML_REG_update_content 7
#define _LCDML_REG_update_cursor 6 #define _LCDML_REG_update_cursor 6
#define _LCDML_REG_update_menu 5 #define _LCDML_REG_update_menu 5
#define _LCDML_REG_update_free_4 4 #define _LCDML_REG_update_menu_function_content 4
#define _LCDML_REG_update_free_3 3 #define _LCDML_REG_update_free_3 3
#define _LCDML_REG_update_free_2 2 #define _LCDML_REG_update_free_2 2
#define _LCDML_REG_update_free_1 1 #define _LCDML_REG_update_free_1 1
@ -212,7 +213,8 @@
uint8_t actMenu_lastFuncID; // History of the last three active menu functions uint8_t actMenu_lastFuncID; // History of the last three active menu functions
uint8_t actMenu_cursorPositionID; // current cursor position id uint8_t actMenu_cursorPositionID; // current cursor position id
uint8_t actMenu_lastCursorPositionID; // Save the last Cursor position before a new function was called uint8_t actMenu_lastCursorPositionID; // Save the last Cursor position before a new function was called
unsigned long actMenu_default_time; unsigned long actMenu_default_time; // default loop time
uint64_t actMenu_ce_mask; // ce mask
// jump To variables // jump To variables
uint8_t jT_id; // contains the jumpTo id uint8_t jT_id; // contains the jumpTo id
@ -252,13 +254,12 @@
void MENU_goInto(void); // activate the menu under the cursor void MENU_goInto(void); // activate the menu under the cursor
void MENU_goBack(void); // move to the parent menu void MENU_goBack(void); // move to the parent menu
void MENU_doScroll(uint8_t state); // scroll the menu void MENU_doScroll(uint8_t state); // scroll the menu
void MENU_goMenu(LCDMenuLib2_menu &p_m, uint8_t p_back); // go to a menu element
uint8_t MENU_countChilds(LCDMenuLib2_menu *menu, uint8_t all=false); // how many children exists on next layer uint8_t MENU_countChilds(LCDMenuLib2_menu *menu, uint8_t all=false); // how many children exists on next layer
void MENU_initFirstElement(void); // set counter to the first object child void MENU_initFirstElement(void); // set counter to the first object child
void MENU_resetActiveMenu(void); // clear all neccessary variables void MENU_resetActiveMenu(void); // clear all neccessary variables
// callback function // callback function
void FUNC_call(void); void FUNC_call(void);
public: public:
@ -282,7 +283,7 @@
void MENU_disScroll(void); // disable the scroll function to catch the cursor to an dyn content element when a encoder is used void MENU_disScroll(void); // disable the scroll function to catch the cursor to an dyn content element when a encoder is used
void MENU_setDynContent(void); // set this value when dyn content is shown on the current windows of the display void MENU_setDynContent(void); // set this value when dyn content is shown on the current windows of the display
uint8_t MENU_checkDynContent(void); // check if dyn content is displayed uint8_t MENU_checkDynContent(void); // check if dyn content is displayed
boolean MENU_getScrollDisableStatus(void); // check if the scroll function is disabled bool MENU_getScrollDisableStatus(void); // check if the scroll function is disabled
uint8_t MENU_getLayer(void); // get the current layer of the menu uint8_t MENU_getLayer(void); // get the current layer of the menu
uint8_t MENU_getCursorPos(void); // get the current cursor position (row 0, row 1, row 2, ...) uint8_t MENU_getCursorPos(void); // get the current cursor position (row 0, row 1, row 2, ...)
uint8_t MENU_getCursorPosAbs(void); // get the current cursor postion absolute (..., row 10, row 11, ..) based on the menu structure uint8_t MENU_getCursorPosAbs(void); // get the current cursor postion absolute (..., row 10, row 11, ..) based on the menu structure
@ -298,7 +299,7 @@
LCDMenuLib2_menu * MENU_getRootObj(void); // get the root menu object LCDMenuLib2_menu * MENU_getRootObj(void); // get the root menu object
// BT = button methods // BT = button methods
boolean BT_setup(void); // check if the button initialisation was done bool BT_setup(void); // check if the button initialisation was done
void BT_enter(void); // set button enter void BT_enter(void); // set button enter
void BT_up(void); // set button up void BT_up(void); // set button up
void BT_down(void); // set button down void BT_down(void); // set button down
@ -314,23 +315,23 @@
void BT_resetRight(void); // reset right button state void BT_resetRight(void); // reset right button state
void BT_resetQuit(void); // reset quit button state void BT_resetQuit(void); // reset quit button state
// //
boolean BT_checkAny(void); // check if any button was pressed bool BT_checkAny(void); // check if any button was pressed
boolean BT_checkEnter(void); // check enter button bool BT_checkEnter(void); // check enter button
boolean BT_checkUp(void); // check up button bool BT_checkUp(void); // check up button
boolean BT_checkDown(void); // check down button bool BT_checkDown(void); // check down button
boolean BT_checkLeft(void); // check left button bool BT_checkLeft(void); // check left button
boolean BT_checkRight(void); // check right button bool BT_checkRight(void); // check right button
boolean BT_checkQuit(void); // check quit button bool BT_checkQuit(void); // check quit button
// CE = custom event // CE = custom event
boolean CE_setup(void); // check if the button initialisation was done bool CE_setup(void); // check if the button initialisation was done
void CE_set(uint8_t p_event); // set button enter void CE_set(uint8_t p_event); // set button enter
// //
void CE_resetAll(void); // reset all button states void CE_resetAll(void); // reset all button states
void CE_reset(uint8_t p_event); // reset enter button state void CE_reset(uint8_t p_event); // reset enter button state
// //
boolean CE_checkAny(void); // check if any button was pressed bool CE_checkAny(void); // check if any button was pressed
boolean CE_check(uint8_t p_event); // check enter button bool CE_check(uint8_t p_event); // check enter button
// //
void CE_setOnChangeCbFunction(uint8_t p_event, LCDML_FuncPtr_pu8 p_function); // add callback function void CE_setOnChangeCbFunction(uint8_t p_event, LCDML_FuncPtr_pu8 p_function); // add callback function
void CE_clearOnChangeCbFunction(uint8_t p_event); // remove callback function void CE_clearOnChangeCbFunction(uint8_t p_event); // remove callback function
@ -339,14 +340,14 @@
void DISP_update(void); // display the content and update the menu structure void DISP_update(void); // display the content and update the menu structure
void DISP_menuUpdate(void); // display the content but do not update the menu structure void DISP_menuUpdate(void); // display the content but do not update the menu structure
void DISP_clear(void); // calls the callback function to clear the display void DISP_clear(void); // calls the callback function to clear the display
boolean DISP_checkMenuUpdate(void); // check if there is new content to display bool DISP_checkMenuUpdate(void); // check if there is new content to display
boolean DISP_checkMenuCursorUpdate(void); // check if the cursor was moved bool DISP_checkMenuCursorUpdate(void); // check if the cursor was moved
uint8_t DISP_getMenuContentId(uint8_t n); // get the id`s from a contentelement for a special line uint8_t DISP_getMenuContentId(uint8_t n); // get the id`s from a contentelement for a special line
// menu function methods // menu function methods
boolean FUNC_setup(void); // check if a menu function is called the first time to init some things bool FUNC_setup(void); // check if a menu function is called the first time to init some things
boolean FUNC_loop(void); // check if a menu function is running in a loop bool FUNC_loop(void); // check if a menu function is running in a loop
boolean FUNC_close(void); // check if a menu function is closed to reach a stable state bool FUNC_close(void); // check if a menu function is closed to reach a stable state
void FUNC_goBackToMenu(uint8_t p_goBackCnt=0); // close the current menu function (the FUNC_close check is true when this is set) void FUNC_goBackToMenu(uint8_t p_goBackCnt=0); // close the current menu function (the FUNC_close check is true when this is set)
uint8_t FUNC_getID(void); // get the ID of the current menu function uint8_t FUNC_getID(void); // get the ID of the current menu function
void FUNC_setLoopInterval(unsigned long p_t); // set a loop intervall for the current menu function the default loop intervall is 100000000 ms void FUNC_setLoopInterval(unsigned long p_t); // set a loop intervall for the current menu function the default loop intervall is 100000000 ms
@ -354,11 +355,12 @@
void FUNC_setGBAToLastCursorPos(void); // set a special "go back handling" void FUNC_setGBAToLastCursorPos(void); // set a special "go back handling"
void FUNC_setGBAToLastFunc(void); // set a special "go back handling" void FUNC_setGBAToLastFunc(void); // set a special "go back handling"
void FUNC_setGBA(void); // set a special "go back handling" which decide between the two function above void FUNC_setGBA(void); // set a special "go back handling" which decide between the two function above
void FUNC_setCEMask(unsigned long p_mask); // set a mask to enable only special events for a menu function
// timer methods // timer methods
boolean TIMER_ms(unsigned long &p_var, unsigned long p_t); // a small timer based on the millis() function bool TIMER_ms(unsigned long &p_var, unsigned long p_t); // a small timer based on the millis() function
void TIMER_msReset(unsigned long &p_var); // reset the millis timer void TIMER_msReset(unsigned long &p_var); // reset the millis timer
boolean TIMER_us(unsigned long &p_var, unsigned long p_t); // a small timer based on the micros() function bool TIMER_us(unsigned long &p_var, unsigned long p_t); // a small timer based on the micros() function
void TIMER_usReset(unsigned long &p_var); // reset the micros timer void TIMER_usReset(unsigned long &p_var); // reset the micros timer
// other methods // other methods
@ -367,6 +369,7 @@
void OTHER_setCursorToID(uint8_t p_search); // set the cursor to a defined function based on the id void OTHER_setCursorToID(uint8_t p_search); // set the cursor to a defined function based on the id
void OTHER_setCursorToFunc(LCDML_FuncPtr_pu8 p_search); // set the cursor to a defined function based on the function name void OTHER_setCursorToFunc(LCDML_FuncPtr_pu8 p_search); // set the cursor to a defined function based on the function name
uint8_t OTHER_getIDFromFunction(LCDML_FuncPtr_pu8 p_search); // get the menu element id from a menu element function name uint8_t OTHER_getIDFromFunction(LCDML_FuncPtr_pu8 p_search); // get the menu element id from a menu element function name
void OTHER_updateFunc(void); // update a menu function directly when it runs
// screensaver methods // screensaver methods
void SCREEN_enable(LCDML_FuncPtr_pu8 p_function, unsigned long p_t); // enable the screensaver feature void SCREEN_enable(LCDML_FuncPtr_pu8 p_function, unsigned long p_t); // enable the screensaver feature

@ -4,7 +4,7 @@
* *
* MIT License * MIT License
* *
* Copyright (c) [2019] [Nils Feldkämper] * Copyright (c) [2020] [Nils Feldkämper]
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

@ -4,7 +4,7 @@
* *
* MIT License * MIT License
* *
* Copyright (c) [2019] [Nils Feldkämper] * Copyright (c) [2020] [Nils Feldkämper]
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -144,7 +144,7 @@ uint8_t LCDMenuLib2_menu::getID()
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2_menu::checkCondition() bool LCDMenuLib2_menu::checkCondition()
/* ******************************************************************** */ /* ******************************************************************** */
{ {
if(cb_condition != NULL) if(cb_condition != NULL)
@ -182,7 +182,7 @@ void LCDMenuLib2_menu::callback(uint8_t p)
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2_menu::checkCallback() bool LCDMenuLib2_menu::checkCallback()
/* ******************************************************************** */ /* ******************************************************************** */
{ {
if(cb_function == NULL) if(cb_function == NULL)
@ -196,7 +196,7 @@ boolean LCDMenuLib2_menu::checkCallback()
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2_menu::checkType_menu() bool LCDMenuLib2_menu::checkType_menu()
/* ******************************************************************** */ /* ******************************************************************** */
{ {
if(bitRead(configuration, _LCDML_menu_default)) if(bitRead(configuration, _LCDML_menu_default))
@ -210,7 +210,7 @@ boolean LCDMenuLib2_menu::checkType_menu()
} }
/* ******************************************************************** */ /* ******************************************************************** */
boolean LCDMenuLib2_menu::checkType_dynParam() bool LCDMenuLib2_menu::checkType_dynParam()
/* ******************************************************************** */ /* ******************************************************************** */
{ {
if(bitRead(configuration, _LCDML_menu_dynParam)) if(bitRead(configuration, _LCDML_menu_dynParam))

@ -4,7 +4,7 @@
* *
* MIT License * MIT License
* *
* Copyright (c) [2019] [Nils Feldkämper] * Copyright (c) [2020] [Nils Feldkämper]
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -81,12 +81,12 @@
LCDMenuLib2_menu * getParent(); // Returns this menu's parent menu. If no parent, returns itself LCDMenuLib2_menu * getParent(); // Returns this menu's parent menu. If no parent, returns itself
uint8_t getID(); // return the id of a menu element uint8_t getID(); // return the id of a menu element
boolean checkCondition(); // check menu display condition bool checkCondition(); // check menu display condition
uint8_t getParam(); // return a parameter which is set on the initialization uint8_t getParam(); // return a parameter which is set on the initialization
boolean checkType_menu(); bool checkType_menu();
boolean checkType_dynParam(); bool checkType_dynParam();
void callback(uint8_t p); // call menu callback void callback(uint8_t p); // call menu callback
boolean checkCallback(); // check if callback can called bool checkCallback(); // check if callback can called
}; };
#endif #endif

@ -4,7 +4,7 @@
* *
* MIT License * MIT License
* *
* Copyright (c) [2019] [Nils Feldkämper] * Copyright (c) [2020] [Nils Feldkämper]
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -40,6 +40,6 @@
typedef void (* LCDML_FuncPtr) (); typedef void (* LCDML_FuncPtr) ();
typedef void (* LCDML_FuncPtr_pu8) (uint8_t); // with parameter u8 typedef void (* LCDML_FuncPtr_pu8) (uint8_t); // with parameter u8
typedef boolean (* LCDML_FuncPtr_rb) (); // with return value boolean typedef bool (* LCDML_FuncPtr_rb) (); // with return value bool
#endif #endif

Loading…
Cancel
Save