|
|
|
@ -22,15 +22,16 @@ |
|
|
|
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_LCD_UI |
|
|
|
|
#ifndef _UI_HPP_ |
|
|
|
|
#define _UI_HPP_ |
|
|
|
|
|
|
|
|
|
#include <LiquidCrystal_I2C.h> |
|
|
|
|
#include <LCDMenuLib2.h> |
|
|
|
|
#include "Arduino.h" |
|
|
|
|
#include "config.h" |
|
|
|
|
|
|
|
|
|
#define _LCDML_DISP_cols 16 |
|
|
|
|
#define _LCDML_DISP_rows 2 |
|
|
|
|
#define _LCDML_DISP_cols LCD_cols |
|
|
|
|
#define _LCDML_DISP_rows LCD_rows |
|
|
|
|
|
|
|
|
|
#define _LCDML_DISP_cfg_cursor 0x7E // cursor Symbol
|
|
|
|
|
#define _LCDML_DISP_cfg_scrollbar 1 // enable a scrollbar
|
|
|
|
@ -51,9 +52,18 @@ const uint8_t scroll_bar[5][8] = { |
|
|
|
|
void lcdml_menu_display(void); |
|
|
|
|
void lcdml_menu_clear(void); |
|
|
|
|
void lcdml_menu_control(void); |
|
|
|
|
void UI_func_information(uint8_t param); |
|
|
|
|
void UI_func_screensaver(uint8_t param); |
|
|
|
|
void UI_func_test(uint8_t param); |
|
|
|
|
void UI_func_sound(uint8_t param); |
|
|
|
|
void UI_func_reverb_roomsize(uint8_t param); |
|
|
|
|
void UI_func_reverb_damping(uint8_t param); |
|
|
|
|
void UI_func_reverb_level(uint8_t param); |
|
|
|
|
void UI_func_chorus_frequency(uint8_t param); |
|
|
|
|
void UI_func_chorus_depth(uint8_t param); |
|
|
|
|
void UI_func_chorus_level(uint8_t param); |
|
|
|
|
void UI_func_delay_time(uint8_t param); |
|
|
|
|
void UI_func_delay_feedback(uint8_t param); |
|
|
|
|
void UI_func_delay_level(uint8_t param); |
|
|
|
|
void UI_func_filter_cutoff(uint8_t param); |
|
|
|
|
void UI_func_filter_resonance(uint8_t param); |
|
|
|
|
void UI_func_back(uint8_t param); |
|
|
|
|
void UI_func_goToRootMenu(uint8_t param); |
|
|
|
|
|
|
|
|
@ -61,10 +71,28 @@ LCDMenuLib2_menu LCDML_0(255, 0, 0, NULL, NULL); // root menu element (do not ch |
|
|
|
|
LCDMenuLib2 LCDML(LCDML_0, _LCDML_DISP_rows, _LCDML_DISP_cols, lcdml_menu_display, lcdml_menu_clear, lcdml_menu_control); |
|
|
|
|
|
|
|
|
|
// LCDML_add(id, prev_layer, new_num, lang_char_array, callback_function)
|
|
|
|
|
LCDML_add(0, LCDML_0, 1, "Information", UI_func_information); |
|
|
|
|
LCDML_add(1, LCDML_0, 2, "Test", UI_func_test); |
|
|
|
|
LCDML_add(2, LCDML_0, 3, "Screensaver", UI_func_screensaver); |
|
|
|
|
#define _LCDML_DISP_cnt 2 |
|
|
|
|
LCDML_add(0, LCDML_0, 1, "Sound", UI_func_sound); |
|
|
|
|
LCDML_add(1, LCDML_0, 2, "Effect", NULL); |
|
|
|
|
LCDML_add(2, LCDML_0_2, 1, "Reverb", NULL); |
|
|
|
|
LCDML_add(3, LCDML_0_2_1, 1, "Roomsize", UI_func_reverb_roomsize); |
|
|
|
|
LCDML_add(4, LCDML_0_2_1, 2, "Damping", UI_func_reverb_damping); |
|
|
|
|
LCDML_add(5, LCDML_0_2_1, 3, "Level", UI_func_reverb_level); |
|
|
|
|
LCDML_add(6, LCDML_0_2, 2, "Chorus", NULL); |
|
|
|
|
LCDML_add(7, LCDML_0_2_2, 1, "Frequency", UI_func_chorus_frequency); |
|
|
|
|
LCDML_add(8, LCDML_0_2_2, 2, "Depth", UI_func_chorus_depth); |
|
|
|
|
LCDML_add(9, LCDML_0_2_2, 3, "Level", UI_func_chorus_level); |
|
|
|
|
LCDML_add(10, LCDML_0_2, 3, "Delay", NULL); |
|
|
|
|
LCDML_add(11, LCDML_0_2_3, 1, "Time", UI_func_delay_time); |
|
|
|
|
LCDML_add(12, LCDML_0_2_3, 2, "Feedback", UI_func_delay_feedback); |
|
|
|
|
LCDML_add(13, LCDML_0_2_3, 3, "Level", UI_func_delay_level); |
|
|
|
|
LCDML_add(14, LCDML_0_2, 4, "Filter", NULL); |
|
|
|
|
LCDML_add(15, LCDML_0_2_4, 1, "Cutoff", UI_func_filter_cutoff); |
|
|
|
|
LCDML_add(16, LCDML_0_2_4, 2, "Resonance", UI_func_filter_resonance); |
|
|
|
|
LCDML_add(17, LCDML_0, 3, "Store", NULL); |
|
|
|
|
LCDML_add(18, LCDML_0, 4, "System", NULL); |
|
|
|
|
LCDML_add(19, LCDML_0, 5, "Info", NULL); |
|
|
|
|
|
|
|
|
|
#define _LCDML_DISP_cnt 19 |
|
|
|
|
|
|
|
|
|
// create menu
|
|
|
|
|
LCDML_createMenu(_LCDML_DISP_cnt); |
|
|
|
@ -276,21 +304,19 @@ void lcdml_menu_display(void) |
|
|
|
|
/***********************************************************************
|
|
|
|
|
MENU |
|
|
|
|
***********************************************************************/ |
|
|
|
|
void UI_func_information(uint8_t param) |
|
|
|
|
void UI_func_sound(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
// setup function
|
|
|
|
|
lcd.setCursor(0, 0); |
|
|
|
|
lcd.print(F("MicroDexed")); |
|
|
|
|
lcd.print(F("Filter Res.")); |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
lcd.print(F("LCDMenuLib2")); |
|
|
|
|
lcd.print(F("<valua>")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
|
{ |
|
|
|
|
// loop function, can be run in a loop when LCDML_DISP_triggerMenu(xx) is set
|
|
|
|
|
// the quit button works in every DISP function without any checks; it starts the loop_end function
|
|
|
|
|
if (LCDML.BT_checkAny()) { // check if any button is pressed (enter, up, down, left, right)
|
|
|
|
|
// LCDML_goToMenu stops a running menu function and goes to the menu
|
|
|
|
|
LCDML.FUNC_goBackToMenu(); |
|
|
|
@ -303,42 +329,97 @@ void UI_func_information(uint8_t param) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_screensaver(uint8_t param) |
|
|
|
|
void UI_func_reverb_roomsize(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_reverb_damping(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_reverb_level(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_chorus_frequency(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_chorus_depth(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_chorus_level(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_delay_time(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_delay_feedback(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_delay_level(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_filter_cutoff(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_filter_resonance(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_information(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
// update LCD content
|
|
|
|
|
lcd.setCursor(0, 0); // set cursor
|
|
|
|
|
lcd.print("screensaver"); // print change content
|
|
|
|
|
lcd.setCursor(0, 1); // set cursor
|
|
|
|
|
lcd.print("press any key"); |
|
|
|
|
LCDML.FUNC_setLoopInterval(100); // starts a trigger event for the loop function every 100 milliseconds
|
|
|
|
|
// setup function
|
|
|
|
|
lcd.setCursor(0, 0); |
|
|
|
|
lcd.print(F("MicroDexed")); |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
lcd.print(F("LCDMenuLib2")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) |
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
|
{ |
|
|
|
|
if (LCDML.BT_checkAny()) // check if any button is pressed (enter, up, down, left, right)
|
|
|
|
|
{ |
|
|
|
|
LCDML.FUNC_goBackToMenu(); // leave this function
|
|
|
|
|
// loop function, can be run in a loop when LCDML_DISP_triggerMenu(xx) is set
|
|
|
|
|
// the quit button works in every DISP function without any checks; it starts the loop_end function
|
|
|
|
|
if (LCDML.BT_checkAny()) { // check if any button is pressed (enter, up, down, left, right)
|
|
|
|
|
// LCDML_goToMenu stops a running menu function and goes to the menu
|
|
|
|
|
LCDML.FUNC_goBackToMenu(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_close()) |
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
|
{ |
|
|
|
|
// The screensaver go to the root menu
|
|
|
|
|
LCDML.MENU_goRoot(); |
|
|
|
|
// you can here reset some global vars or do nothing
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_test(uint8_t param) |
|
|
|
|
void UI_func_screensaver(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
// update LCD content
|
|
|
|
|
lcd.setCursor(0, 0); // set cursor
|
|
|
|
|
lcd.print("TEST"); // print change content
|
|
|
|
|
lcd.print("screensaver"); // print change content
|
|
|
|
|
lcd.setCursor(0, 1); // set cursor
|
|
|
|
|
lcd.print("TEST123"); |
|
|
|
|
lcd.print("press any key"); |
|
|
|
|
LCDML.FUNC_setLoopInterval(100); // starts a trigger event for the loop function every 100 milliseconds
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -357,15 +438,6 @@ void UI_func_test(uint8_t param) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*void UI_func_back(uint8_t param)
|
|
|
|
|
{ |
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
// end function and go an layer back
|
|
|
|
|
LCDML.FUNC_goBackToMenu(1); // leave this function and go a layer back
|
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
void UI_func_goToRootMenu(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
@ -376,3 +448,4 @@ void UI_func_goToRootMenu(uint8_t param) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
#endif |
|
|
|
|