PicoWaveTracker/UIManager.h
2026-03-06 21:35:21 +01:00

46 lines
1.9 KiB
C++

#ifndef UI_MANAGER_H
#define UI_MANAGER_H
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "TrackerTypes.h"
#include "MelodyStrategy.h"
#include "LedMatrix.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 currentTrackNumSteps,
bool mutationEnabled, bool songModeEnabled,
const Step sequence[][NUM_STEPS], int playbackStep, bool isPlaying,
int randomizeTrack, const bool* trackMute, const int* trackIntensities);
void updateLeds(const Step sequence[][NUM_STEPS], int playbackStep, bool isPlaying,
UIState currentState, bool songModeEnabled,
int songRepeatsRemaining, bool sequenceChangeScheduled, PlayMode playMode,
int selectedTrack, const int* numSteps, int numScaleNotes, const int* scaleNotes, const bool* trackMute);
private:
Adafruit_SSD1306 display;
LedMatrix ledMatrix;
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 currentTrackNumSteps,
bool mutationEnabled, bool songModeEnabled, bool isPlaying, int randomizeTrack, const bool* trackMute, const int* trackIntensities);
void drawNumberEditor(const char* title, int value, int minVal, int maxVal);
void drawEditScreen(const char* title, const char* label, const char* valueStr);
void drawEditScreen(const char* title, const char* label, int value);
};
extern UIManager ui;
#endif