48 lines
969 B
C
48 lines
969 B
C
#ifndef SHAREDSTATE_H
|
|
#define SHAREDSTATE_H
|
|
|
|
#include <Arduino.h>
|
|
|
|
#define AUDIO_BUFFER_SIZE 512
|
|
extern volatile int audioBufferUsage;
|
|
|
|
extern volatile unsigned long lastLoop0Time;
|
|
extern volatile unsigned long lastLoop1Time;
|
|
extern volatile bool watchdogActive;
|
|
|
|
enum UIState {
|
|
UI_MENU,
|
|
UI_EDIT_SCALE_TYPE,
|
|
UI_EDIT_SCALE_KEY,
|
|
UI_EDIT_WAVETABLE
|
|
};
|
|
|
|
struct Scale {
|
|
const char* name;
|
|
const int semitones[8];
|
|
int numNotes;
|
|
};
|
|
|
|
struct MenuItem {
|
|
const char* label;
|
|
UIState editState;
|
|
};
|
|
|
|
extern UIState currentState;
|
|
extern const MenuItem MENU_ITEMS[];
|
|
extern const int NUM_MENU_ITEMS;
|
|
extern volatile int menuSelection;
|
|
|
|
extern const Scale SCALES[];
|
|
extern const int NUM_SCALES;
|
|
extern volatile int currentScaleIndex;
|
|
|
|
extern const char* KEY_NAMES[];
|
|
extern const int NUM_KEYS;
|
|
extern volatile int currentKeyIndex;
|
|
|
|
extern const char* WAVETABLE_NAMES[];
|
|
extern const int NUM_WAVETABLES;
|
|
extern volatile int currentWavetableIndex;
|
|
|
|
#endif // SHAREDSTATE_H
|