46 lines
1.7 KiB
C++
46 lines
1.7 KiB
C++
#ifndef UI_MANAGER_H
|
|
#define UI_MANAGER_H
|
|
|
|
#include <Adafruit_GFX.h>
|
|
#include <Adafruit_SSD1306.h>
|
|
#include <Adafruit_NeoPixel.h>
|
|
#include "TrackerTypes.h"
|
|
#include "MelodyStrategy.h"
|
|
|
|
class UIManager {
|
|
public:
|
|
UIManager();
|
|
void begin();
|
|
|
|
void showMessage(const char* msg);
|
|
|
|
void draw(UIState currentState, int menuSelection,
|
|
int midiChannel, int tempo, MelodyStrategy* currentStrategy,
|
|
int queuedTheme, int currentThemeIndex,
|
|
int numScaleNotes, const int* scaleNotes, int melodySeed, int numSteps,
|
|
bool mutationEnabled, bool songModeEnabled,
|
|
const Step sequence[][NUM_STEPS], int playbackStep, bool isPlaying,
|
|
int randomizeTrack, const bool* trackMute);
|
|
|
|
void updateLeds(const Step sequence[][NUM_STEPS], int playbackStep, bool isPlaying,
|
|
UIState currentState, bool songModeEnabled,
|
|
int songRepeatsRemaining, bool sequenceChangeScheduled, PlayMode playMode,
|
|
int selectedTrack, int numSteps, int numScaleNotes, const int* scaleNotes, const bool* trackMute);
|
|
|
|
private:
|
|
Adafruit_SSD1306 display;
|
|
Adafruit_NeoPixel pixels;
|
|
uint32_t leds_buffer[8][8]; // For piano roll
|
|
|
|
void drawMenu(int selection, UIState currentState, int midiChannel, int tempo, const char* flavourName,
|
|
int queuedTheme, int currentThemeIndex,
|
|
int numScaleNotes, const int* scaleNotes, int melodySeed, int numSteps,
|
|
bool mutationEnabled, bool songModeEnabled, bool isPlaying, int randomizeTrack, const bool* trackMute);
|
|
|
|
uint32_t getNoteColor(int note, bool dim);
|
|
int getPixelIndex(int x, int y);
|
|
};
|
|
|
|
extern UIManager ui;
|
|
|
|
#endif |