71 lines
1.2 KiB
C++
71 lines
1.2 KiB
C++
// DisplayHandler.h
|
|
#ifndef DisplayHandler_h
|
|
#define DisplayHandler_h
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <array>
|
|
#include "Gate.h"
|
|
|
|
|
|
class DisplayHandler {
|
|
private:
|
|
char buffer[32];
|
|
uint8_t currentScreen;
|
|
std::string screens[7];
|
|
std::array<std::string, 19> out_pages = {
|
|
"Exit",
|
|
"Mod",
|
|
"Shape",
|
|
"Level",
|
|
"Width",
|
|
"Swing",
|
|
"Prob",
|
|
"Sticky",
|
|
"CV1 ON",
|
|
"CV1 SRC",
|
|
"CV1 TO",
|
|
"CV1 AMT",
|
|
"CV1 INV",
|
|
"CV2 ON",
|
|
"CV2 SRC",
|
|
"CV2 TO",
|
|
"CV2 AMT",
|
|
"CV2 INV",
|
|
"Mute"
|
|
};
|
|
bool onOutScreen = 0;
|
|
|
|
bool onSettingsScreen = 0;
|
|
std::array<std::string, 6> settings = {
|
|
"Save",
|
|
"Load",
|
|
"Reset",
|
|
"PPQN",
|
|
"Run",
|
|
"Exit"
|
|
};
|
|
|
|
void renderMainPage();
|
|
void renderOutPage();
|
|
void renderSettingsPage();
|
|
|
|
|
|
public:
|
|
DisplayHandler(Gate* outputs[]);
|
|
Gate** outputs;
|
|
bool updateScreen;
|
|
int8_t cursorPosition;
|
|
uint8_t mainMaxCursorPosition;
|
|
uint8_t outMaxCursorPosition;
|
|
int8_t currentOut;
|
|
bool cursorClick;
|
|
void setup();
|
|
void render();
|
|
void handleClick();
|
|
void exitSettingsScreen();
|
|
void flashMessage(std::string msg);
|
|
void moveCursor(bool dir = 1);
|
|
};
|
|
|
|
#endif
|