#ifndef __MENU_H #define __MENU_H #include "wiring.h" #include "settings.h" #define MENU_ROW_HEIGHT 9 #define MENU_HEADER_OFFSET 12 #define MENU_NUM_ROWS 6 #define ADJUST_NUM_ROWS 3 #define ADJUST_ROW_HEIGHT 22 extern const unsigned long debounceDelay; // the debounce time; increase if the output flickers extern const unsigned long buttonRepeatInterval; extern const unsigned long buttonRepeatDelay; extern const unsigned long cursorBlinkInterval; // the cursor blink toggle interval time extern const unsigned long patchViewTimeUp; // ms until patch view shuts off extern const unsigned long menuTimeUp; // menu shuts off after one minute of button inactivity struct InputState { bool changed = false; bool btnMenu = false; bool btnVal1 = false; bool btnVal2 = false; bool btnPreset = false; int knobMenu = 0; int knobVal1 = 0; int knobVal2 = 0; int knobPreset = 0; }; class MenuScreen { public: MenuScreen() {}; virtual const char *title() { return ""; }; virtual const char* summary(state_t& state) { return ""; }; virtual void update(state_t &state, InputState &input, bool redraw) = 0; virtual void exit() { }; virtual ~MenuScreen() {}; }; void initDisplay(); bool inMenu(); void displayOff(state_t &state); void showVersion(); void displayError(const char *error); void handleMenu(state_t &state, bool draw); #endif