migrate Gravity firmware into a new dedicated firmware directory.
This commit is contained in:
54
firmware/Gravity/app_state.h
Normal file
54
firmware/Gravity/app_state.h
Normal file
@ -0,0 +1,54 @@
|
||||
#ifndef APP_STATE_H
|
||||
#define APP_STATE_H
|
||||
|
||||
#include <gravity.h>
|
||||
|
||||
#include "channel.h"
|
||||
|
||||
// Global state for settings and app behavior.
|
||||
struct AppState {
|
||||
int tempo = Clock::DEFAULT_TEMPO;
|
||||
bool encoder_reversed = false;
|
||||
bool refresh_screen = true;
|
||||
bool editing_param = false;
|
||||
byte selected_param = 0;
|
||||
byte selected_sub_param = 0; // Temporary value for editing params.
|
||||
byte selected_channel = 0; // 0=tempo, 1-6=output channel
|
||||
byte selected_swing = 0;
|
||||
byte selected_save_slot = 0; // The currently active save slot.
|
||||
Clock::Source selected_source = Clock::SOURCE_INTERNAL;
|
||||
Clock::Pulse selected_pulse = Clock::PULSE_PPQN_24;
|
||||
Channel channel[Gravity::OUTPUT_COUNT];
|
||||
};
|
||||
|
||||
extern AppState app;
|
||||
|
||||
static Channel& GetSelectedChannel() {
|
||||
return app.channel[app.selected_channel - 1];
|
||||
}
|
||||
|
||||
enum ParamsMainPage : uint8_t {
|
||||
PARAM_MAIN_TEMPO,
|
||||
PARAM_MAIN_SOURCE,
|
||||
PARAM_MAIN_PULSE,
|
||||
PARAM_MAIN_ENCODER_DIR,
|
||||
PARAM_MAIN_SAVE_DATA,
|
||||
PARAM_MAIN_LOAD_DATA,
|
||||
PARAM_MAIN_RESET_STATE,
|
||||
PARAM_MAIN_LAST,
|
||||
};
|
||||
|
||||
enum ParamsChannelPage : uint8_t {
|
||||
PARAM_CH_MOD,
|
||||
PARAM_CH_PROB,
|
||||
PARAM_CH_DUTY,
|
||||
PARAM_CH_OFFSET,
|
||||
PARAM_CH_SWING,
|
||||
PARAM_CH_EUC_STEPS,
|
||||
PARAM_CH_EUC_HITS,
|
||||
PARAM_CH_CV1_DEST,
|
||||
PARAM_CH_CV2_DEST,
|
||||
PARAM_CH_LAST,
|
||||
};
|
||||
|
||||
#endif // APP_STATE_H
|
||||
Reference in New Issue
Block a user