eurorack/midi2cv/ui.h

49 lines
780 B
C
Raw Normal View History

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
#include "config.h"
#include "settings.h"
#include "ui/main_menu.h"
#include <array>
2019-09-19 14:41:32 +00:00
class UI {
public:
UI(Part** part_pointers, Settings* settings);
~UI() {}
2019-10-28 17:56:37 +00:00
void Poll();
void Flush();
void DoEvents();
private:
2019-10-28 17:56:37 +00:00
stmlib::EventQueue<16> input_queue;
2019-09-19 14:41:32 +00:00
Settings* settings;
2020-02-21 00:39:20 +00:00
bool long_press_event_sent_;
uint32_t start_stop_press_time_;
bool encoder_long_press_event_sent_;
uint32_t encoder_press_time_;
MainMenu<PART_COUNT> main_menu;
Part** parts;
void LoadState();
void SaveState();
2019-10-28 17:56:37 +00:00
void Draw();
2019-09-19 14:41:32 +00:00
2019-10-28 17:56:37 +00:00
void OnClick();
void OnLongClick();
2020-02-21 00:39:20 +00:00
void OnIncrement(stmlib::Event& e);
2019-10-28 17:56:37 +00:00
DISALLOW_COPY_AND_ASSIGN(UI);
2019-09-19 14:41:32 +00:00
};
extern UI ui;
#endif