Menu system fixes; made state less global
This commit is contained in:
parent
cfc2390b8b
commit
209959e2de
14 changed files with 964 additions and 731 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue