Menu system fixes; made state less global

This commit is contained in:
Brian Hrebec 2023-08-29 13:32:56 -05:00
parent cfc2390b8b
commit 209959e2de
14 changed files with 964 additions and 731 deletions

View file

@ -2,6 +2,7 @@
#define __MENU_H
#include "wiring.h"
#include "settings.h"
#define MENU_ROW_HEIGHT 9
#define MENU_HEADER_OFFSET 12
@ -28,17 +29,18 @@ struct InputState {
int knobPreset = 0;
};
struct MenuScreen {
class MenuScreen {
public:
MenuScreen() {};
virtual const char *title() { return ""; };
virtual void update(InputState input, bool redraw) {};
virtual bool update(state_t &state, InputState &input, bool redraw) = 0;
virtual ~MenuScreen() {};
};
extern const MenuScreen adjustMenu;
void initDisplay();
void displayOff();
void showVersion();
void displayError(const char *error);
void handleMenu(bool draw);
void handleMenu(state_t &state, bool draw);
#endif