2019-09-19 14:41:32 +00:00
|
|
|
#ifndef MIDI2CV_UI_H
|
|
|
|
#define MIDI2CV_UI_H
|
|
|
|
|
|
|
|
#include "stmlib/stmlib.h"
|
2019-10-28 17:56:37 +00:00
|
|
|
#include "stmlib/ui/event_queue.h"
|
2019-09-19 14:41:32 +00:00
|
|
|
|
2019-10-14 21:51:38 +00:00
|
|
|
typedef enum {
|
2019-10-28 17:56:37 +00:00
|
|
|
MENU_PART_1 = 0,
|
2019-10-14 21:51:38 +00:00
|
|
|
MENU_PART_2,
|
|
|
|
MENU_PART_3,
|
|
|
|
MENU_PART_4,
|
|
|
|
MENU_COUNT
|
|
|
|
} Menu_t;
|
|
|
|
|
2019-09-19 14:41:32 +00:00
|
|
|
class UI {
|
2019-10-14 21:51:38 +00:00
|
|
|
public:
|
|
|
|
UI() {}
|
|
|
|
~UI() {}
|
|
|
|
|
2019-10-28 17:56:37 +00:00
|
|
|
void Init();
|
|
|
|
void Poll();
|
2019-10-14 21:51:38 +00:00
|
|
|
void Flush();
|
2019-10-28 17:56:37 +00:00
|
|
|
bool DoEvents();
|
2019-10-14 21:51:38 +00:00
|
|
|
|
|
|
|
private:
|
2019-10-28 17:56:37 +00:00
|
|
|
|
2019-10-14 21:51:38 +00:00
|
|
|
Menu_t current_menu;
|
2019-10-28 17:56:37 +00:00
|
|
|
stmlib::EventQueue<16> input_queue;
|
2019-09-19 14:41:32 +00:00
|
|
|
|
2019-10-28 17:56:37 +00:00
|
|
|
void Draw();
|
2019-10-14 21:51:38 +00:00
|
|
|
void DrawHeader();
|
|
|
|
void DrawPartMenu(Menu_t menu);
|
2019-09-19 14:41:32 +00:00
|
|
|
|
2019-10-28 17:56:37 +00:00
|
|
|
void OnClick();
|
|
|
|
void OnLongClick();
|
|
|
|
void OnIncrement(stmlib::Event &e);
|
|
|
|
|
2019-10-14 21:51:38 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(UI);
|
2019-09-19 14:41:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern UI ui;
|
|
|
|
|
|
|
|
#endif
|