80 lines
1.5 KiB
C++
80 lines
1.5 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 = false;
|
|
bool onMainScreen = true;
|
|
bool onSettingsScreen = false;
|
|
bool engageBPM = false;
|
|
|
|
std::array<std::string, 6> settings = {
|
|
"Save",
|
|
"Load",
|
|
"Reset",
|
|
"PPQN",
|
|
"Run",
|
|
"Exit"
|
|
};
|
|
|
|
void renderMainPage();
|
|
void renderOutPage();
|
|
void renderSettingsPage();
|
|
void handleCursorOnOutputScreen(bool dir);
|
|
void handleClickOnOutputScreen();
|
|
void handleCursorOnMainScreen(bool dir);
|
|
void handleClickOnMainScreen();
|
|
void handleClickOnSettingsScreen();
|
|
|
|
|
|
public:
|
|
DisplayHandler(Gate* outputs[]);
|
|
Gate** outputs;
|
|
bool updateScreen;
|
|
int8_t cursorPosition;
|
|
uint8_t mainMaxCursorPosition;
|
|
uint8_t outMaxCursorPosition;
|
|
int8_t currentOut;
|
|
bool cursorClick;
|
|
void setup();
|
|
uint8_t modifyParameter(uint8_t dir, int8_t target, uint8_t clampMax, uint8_t clampMin = 0, bool overflow = true);
|
|
void render();
|
|
void handleClick();
|
|
void exitSettingsScreen();
|
|
void flashMessage(std::string msg);
|
|
void moveCursor(bool dir = 1);
|
|
};
|
|
|
|
#endif
|