GUI: woooooow

This commit is contained in:
tildearrow 2022-02-11 01:56:59 -05:00
parent dbed326a58
commit 99cf9b3bf1
2 changed files with 374 additions and 7 deletions

View file

@ -25,6 +25,7 @@
#ifdef __APPLE__
#define CMD_MODIFIER KMOD_GUI
#define FURKMOD_CMD FURKMOD_META
#define CMD_MODIFIER_NAME "Cmd-"
#define SHIFT_MODIFIER_NAME "Shift-"
extern "C" {
@ -32,6 +33,7 @@ extern "C" {
}
#else
#define CMD_MODIFIER KMOD_CTRL
#define FURKMOD_CMD FURKMOD_CTRL
#define CMD_MODIFIER_NAME "Ctrl-"
#define SHIFT_MODIFIER_NAME "Shift-"
#endif
@ -3872,6 +3874,9 @@ void FurnaceGUI::drawSettings() {
ImGui::End();
}
#define LOAD_KEYBIND(x,y) \
actionKeys[x]=e->getConfInt("keybind_" #x,y);
void FurnaceGUI::syncSettings() {
settings.mainFontSize=e->getConfInt("mainFontSize",18);
settings.patFontSize=e->getConfInt("patFontSize",18);
@ -3906,9 +3911,155 @@ void FurnaceGUI::syncSettings() {
settings.forceMono=e->getConfInt("forceMono",0);
settings.controlLayout=e->getConfInt("controlLayout",0);
settings.restartOnFlagChange=e->getConfInt("restartOnFlagChange",1);
// keybinds
LOAD_KEYBIND(GUI_ACTION_OPEN,FURKMOD_CMD|SDLK_o);
LOAD_KEYBIND(GUI_ACTION_SAVE,FURKMOD_CMD|SDLK_s);
LOAD_KEYBIND(GUI_ACTION_UNDO,FURKMOD_CMD|SDLK_z);
LOAD_KEYBIND(GUI_ACTION_REDO,FURKMOD_CMD|SDLK_y);
LOAD_KEYBIND(GUI_ACTION_PLAY_TOGGLE,SDLK_RETURN);
LOAD_KEYBIND(GUI_ACTION_PLAY,0);
LOAD_KEYBIND(GUI_ACTION_STOP,0);
LOAD_KEYBIND(GUI_ACTION_PLAY_REPEAT,0);
LOAD_KEYBIND(GUI_ACTION_PLAY_CURSOR,FURKMOD_SHIFT|SDLK_RETURN);
LOAD_KEYBIND(GUI_ACTION_STEP_ONE,FURKMOD_CMD|SDLK_RETURN);
LOAD_KEYBIND(GUI_ACTION_OCTAVE_UP,SDLK_KP_MULTIPLY);
LOAD_KEYBIND(GUI_ACTION_OCTAVE_DOWN,SDLK_KP_DIVIDE);
LOAD_KEYBIND(GUI_ACTION_INS_UP,FURKMOD_SHIFT|SDLK_KP_DIVIDE);
LOAD_KEYBIND(GUI_ACTION_INS_DOWN,FURKMOD_SHIFT|SDLK_KP_MULTIPLY);
LOAD_KEYBIND(GUI_ACTION_STEP_UP,FURKMOD_CMD|SDLK_KP_DIVIDE);
LOAD_KEYBIND(GUI_ACTION_STEP_DOWN,FURKMOD_CMD|SDLK_KP_MULTIPLY);
LOAD_KEYBIND(GUI_ACTION_TOGGLE_EDIT,SDLK_SPACE);
LOAD_KEYBIND(GUI_ACTION_METRONOME,FURKMOD_CMD|SDLK_m);
LOAD_KEYBIND(GUI_ACTION_REPEAT_PATTERN,0);
LOAD_KEYBIND(GUI_ACTION_FOLLOW_ORDERS,0);
LOAD_KEYBIND(GUI_ACTION_FOLLOW_PATTERN,0);
LOAD_KEYBIND(GUI_ACTION_PANIC,SDLK_F12);
LOAD_KEYBIND(GUI_ACTION_WINDOW_EDIT_CONTROLS,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_ORDERS,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_INS_LIST,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_INS_EDIT,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_SONG_INFO,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_PATTERN,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_WAVE_LIST,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_WAVE_EDIT,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_SAMPLE_LIST,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_SAMPLE_EDIT,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_ABOUT,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_SETTINGS,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_MIXER,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_DEBUG,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_VOL_METER,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_STATS,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_COMPAT_FLAGS,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_PIANO,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_NOTES,0);
LOAD_KEYBIND(GUI_ACTION_WINDOW_CHANNELS,0);
LOAD_KEYBIND(GUI_ACTION_COLLAPSE_WINDOW,0);
LOAD_KEYBIND(GUI_ACTION_CLOSE_WINDOW,FURKMOD_SHIFT|SDLK_ESCAPE);
LOAD_KEYBIND(GUI_ACTION_PAT_NOTE_UP,0);
LOAD_KEYBIND(GUI_ACTION_PAT_NOTE_DOWN,0);
LOAD_KEYBIND(GUI_ACTION_PAT_OCTAVE_UP,0);
LOAD_KEYBIND(GUI_ACTION_PAT_OCTAVE_DOWN,0);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECT_ALL,FURKMOD_CMD|SDLK_a);
LOAD_KEYBIND(GUI_ACTION_PAT_CUT,FURKMOD_CMD|SDLK_x);
LOAD_KEYBIND(GUI_ACTION_PAT_COPY,FURKMOD_CMD|SDLK_c);
LOAD_KEYBIND(GUI_ACTION_PAT_PASTE,FURKMOD_CMD|SDLK_v);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_UP,SDLK_UP);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_DOWN,SDLK_DOWN);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_LEFT,SDLK_LEFT);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_RIGHT,SDLK_RIGHT);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_UP_ONE,FURKMOD_SHIFT|SDLK_HOME);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_DOWN_ONE,FURKMOD_SHIFT|SDLK_END);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_LEFT_CHANNEL,0);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_RIGHT_CHANNEL,0);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_NEXT_CHANNEL,0);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_PREVIOUS_CHANNEL,0);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_BEGIN,SDLK_HOME);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_END,SDLK_END);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_UP_COARSE,SDLK_PAGEUP);
LOAD_KEYBIND(GUI_ACTION_PAT_CURSOR_DOWN_COARSE,SDLK_PAGEDOWN);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECTION_UP,FURKMOD_SHIFT|SDLK_UP);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECTION_DOWN,FURKMOD_SHIFT|SDLK_DOWN);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECTION_LEFT,FURKMOD_SHIFT|SDLK_LEFT);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECTION_RIGHT,FURKMOD_SHIFT|SDLK_RIGHT);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECTION_UP_ONE,0);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECTION_DOWN_ONE,0);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECTION_BEGIN,0);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECTION_END,0);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECTION_UP_COARSE,FURKMOD_SHIFT|SDLK_PAGEUP);
LOAD_KEYBIND(GUI_ACTION_PAT_SELECTION_DOWN_COARSE,FURKMOD_SHIFT|SDLK_PAGEDOWN);
LOAD_KEYBIND(GUI_ACTION_PAT_DELETE,SDLK_DELETE);
LOAD_KEYBIND(GUI_ACTION_PAT_PULL_DELETE,SDLK_BACKSPACE);
LOAD_KEYBIND(GUI_ACTION_PAT_INSERT,SDLK_INSERT);
LOAD_KEYBIND(GUI_ACTION_PAT_MUTE_CURSOR,FURKMOD_ALT|SDLK_F9);
LOAD_KEYBIND(GUI_ACTION_PAT_SOLO_CURSOR,FURKMOD_ALT|SDLK_F10);
LOAD_KEYBIND(GUI_ACTION_PAT_UNMUTE_ALL,FURKMOD_ALT|FURKMOD_SHIFT|SDLK_F9);
LOAD_KEYBIND(GUI_ACTION_PAT_NEXT_ORDER,0);
LOAD_KEYBIND(GUI_ACTION_PAT_PREV_ORDER,0);
LOAD_KEYBIND(GUI_ACTION_PAT_COLLAPSE,0);
LOAD_KEYBIND(GUI_ACTION_PAT_INCREASE_COLUMNS,0);
LOAD_KEYBIND(GUI_ACTION_PAT_DECREASE_COLUMNS,0);
LOAD_KEYBIND(GUI_ACTION_INS_LIST_ADD,0);
LOAD_KEYBIND(GUI_ACTION_INS_LIST_DUPLICATE,0);
LOAD_KEYBIND(GUI_ACTION_INS_LIST_OPEN,0);
LOAD_KEYBIND(GUI_ACTION_INS_LIST_SAVE,0);
LOAD_KEYBIND(GUI_ACTION_INS_LIST_MOVE_UP,0);
LOAD_KEYBIND(GUI_ACTION_INS_LIST_MOVE_DOWN,0);
LOAD_KEYBIND(GUI_ACTION_INS_LIST_DELETE,0);
LOAD_KEYBIND(GUI_ACTION_INS_LIST_EDIT,0);
LOAD_KEYBIND(GUI_ACTION_INS_LIST_UP,0);
LOAD_KEYBIND(GUI_ACTION_INS_LIST_DOWN,0);
LOAD_KEYBIND(GUI_ACTION_WAVE_LIST_ADD,0);
LOAD_KEYBIND(GUI_ACTION_WAVE_LIST_DUPLICATE,0);
LOAD_KEYBIND(GUI_ACTION_WAVE_LIST_OPEN,0);
LOAD_KEYBIND(GUI_ACTION_WAVE_LIST_SAVE,0);
LOAD_KEYBIND(GUI_ACTION_WAVE_LIST_MOVE_UP,0);
LOAD_KEYBIND(GUI_ACTION_WAVE_LIST_MOVE_DOWN,0);
LOAD_KEYBIND(GUI_ACTION_WAVE_LIST_DELETE,0);
LOAD_KEYBIND(GUI_ACTION_WAVE_LIST_EDIT,0);
LOAD_KEYBIND(GUI_ACTION_WAVE_LIST_UP,0);
LOAD_KEYBIND(GUI_ACTION_WAVE_LIST_DOWN,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_ADD,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_DUPLICATE,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_OPEN,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_SAVE,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_MOVE_UP,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_MOVE_DOWN,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_DELETE,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_EDIT,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_UP,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_DOWN,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_PREVIEW,0);
LOAD_KEYBIND(GUI_ACTION_SAMPLE_LIST_STOP_PREVIEW,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_UP,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_DOWN,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_LEFT,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_RIGHT,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_INCREASE,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_DECREASE,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_EDIT_MODE,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_LINK,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_ADD,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_DUPLICATE,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_DEEP_CLONE,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_DUPLICATE_END,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_DEEP_CLONE_END,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_REMOVE,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_MOVE_UP,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_MOVE_DOWN,0);
LOAD_KEYBIND(GUI_ACTION_ORDERS_REPLAY,0);
}
#define PUT_UI_COLOR(source) e->setConf(#source,(int)ImGui::GetColorU32(uiColors[source]));
#define SAVE_KEYBIND(x) e->setConf("keybind_" #x,actionKeys[x]);
void FurnaceGUI::commitSettings() {
e->setConf("mainFontSize",settings.mainFontSize);
@ -4006,6 +4157,150 @@ void FurnaceGUI::commitSettings() {
PUT_UI_COLOR(GUI_COLOR_EE_VALUE);
PUT_UI_COLOR(GUI_COLOR_PLAYBACK_STAT);
SAVE_KEYBIND(GUI_ACTION_OPEN);
SAVE_KEYBIND(GUI_ACTION_SAVE);
SAVE_KEYBIND(GUI_ACTION_UNDO);
SAVE_KEYBIND(GUI_ACTION_REDO);
SAVE_KEYBIND(GUI_ACTION_PLAY_TOGGLE);
SAVE_KEYBIND(GUI_ACTION_PLAY);
SAVE_KEYBIND(GUI_ACTION_STOP);
SAVE_KEYBIND(GUI_ACTION_PLAY_REPEAT);
SAVE_KEYBIND(GUI_ACTION_PLAY_CURSOR);
SAVE_KEYBIND(GUI_ACTION_STEP_ONE);
SAVE_KEYBIND(GUI_ACTION_OCTAVE_UP);
SAVE_KEYBIND(GUI_ACTION_OCTAVE_DOWN);
SAVE_KEYBIND(GUI_ACTION_INS_UP);
SAVE_KEYBIND(GUI_ACTION_INS_DOWN);
SAVE_KEYBIND(GUI_ACTION_STEP_UP);
SAVE_KEYBIND(GUI_ACTION_STEP_DOWN);
SAVE_KEYBIND(GUI_ACTION_TOGGLE_EDIT);
SAVE_KEYBIND(GUI_ACTION_METRONOME);
SAVE_KEYBIND(GUI_ACTION_REPEAT_PATTERN);
SAVE_KEYBIND(GUI_ACTION_FOLLOW_ORDERS);
SAVE_KEYBIND(GUI_ACTION_FOLLOW_PATTERN);
SAVE_KEYBIND(GUI_ACTION_PANIC);
SAVE_KEYBIND(GUI_ACTION_WINDOW_EDIT_CONTROLS);
SAVE_KEYBIND(GUI_ACTION_WINDOW_ORDERS);
SAVE_KEYBIND(GUI_ACTION_WINDOW_INS_LIST);
SAVE_KEYBIND(GUI_ACTION_WINDOW_INS_EDIT);
SAVE_KEYBIND(GUI_ACTION_WINDOW_SONG_INFO);
SAVE_KEYBIND(GUI_ACTION_WINDOW_PATTERN);
SAVE_KEYBIND(GUI_ACTION_WINDOW_WAVE_LIST);
SAVE_KEYBIND(GUI_ACTION_WINDOW_WAVE_EDIT);
SAVE_KEYBIND(GUI_ACTION_WINDOW_SAMPLE_LIST);
SAVE_KEYBIND(GUI_ACTION_WINDOW_SAMPLE_EDIT);
SAVE_KEYBIND(GUI_ACTION_WINDOW_ABOUT);
SAVE_KEYBIND(GUI_ACTION_WINDOW_SETTINGS);
SAVE_KEYBIND(GUI_ACTION_WINDOW_MIXER);
SAVE_KEYBIND(GUI_ACTION_WINDOW_DEBUG);
SAVE_KEYBIND(GUI_ACTION_WINDOW_VOL_METER);
SAVE_KEYBIND(GUI_ACTION_WINDOW_STATS);
SAVE_KEYBIND(GUI_ACTION_WINDOW_COMPAT_FLAGS);
SAVE_KEYBIND(GUI_ACTION_WINDOW_PIANO);
SAVE_KEYBIND(GUI_ACTION_WINDOW_NOTES);
SAVE_KEYBIND(GUI_ACTION_WINDOW_CHANNELS);
SAVE_KEYBIND(GUI_ACTION_COLLAPSE_WINDOW);
SAVE_KEYBIND(GUI_ACTION_CLOSE_WINDOW);
SAVE_KEYBIND(GUI_ACTION_PAT_NOTE_UP);
SAVE_KEYBIND(GUI_ACTION_PAT_NOTE_DOWN);
SAVE_KEYBIND(GUI_ACTION_PAT_OCTAVE_UP);
SAVE_KEYBIND(GUI_ACTION_PAT_OCTAVE_DOWN);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECT_ALL);
SAVE_KEYBIND(GUI_ACTION_PAT_CUT);
SAVE_KEYBIND(GUI_ACTION_PAT_COPY);
SAVE_KEYBIND(GUI_ACTION_PAT_PASTE);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_UP);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_DOWN);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_LEFT);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_RIGHT);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_UP_ONE);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_DOWN_ONE);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_LEFT_CHANNEL);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_RIGHT_CHANNEL);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_NEXT_CHANNEL);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_PREVIOUS_CHANNEL);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_BEGIN);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_END);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_UP_COARSE);
SAVE_KEYBIND(GUI_ACTION_PAT_CURSOR_DOWN_COARSE);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECTION_UP);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECTION_DOWN);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECTION_LEFT);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECTION_RIGHT);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECTION_UP_ONE);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECTION_DOWN_ONE);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECTION_BEGIN);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECTION_END);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECTION_UP_COARSE);
SAVE_KEYBIND(GUI_ACTION_PAT_SELECTION_DOWN_COARSE);
SAVE_KEYBIND(GUI_ACTION_PAT_DELETE);
SAVE_KEYBIND(GUI_ACTION_PAT_PULL_DELETE);
SAVE_KEYBIND(GUI_ACTION_PAT_INSERT);
SAVE_KEYBIND(GUI_ACTION_PAT_MUTE_CURSOR);
SAVE_KEYBIND(GUI_ACTION_PAT_SOLO_CURSOR);
SAVE_KEYBIND(GUI_ACTION_PAT_UNMUTE_ALL);
SAVE_KEYBIND(GUI_ACTION_PAT_NEXT_ORDER);
SAVE_KEYBIND(GUI_ACTION_PAT_PREV_ORDER);
SAVE_KEYBIND(GUI_ACTION_PAT_COLLAPSE);
SAVE_KEYBIND(GUI_ACTION_PAT_INCREASE_COLUMNS);
SAVE_KEYBIND(GUI_ACTION_PAT_DECREASE_COLUMNS);
SAVE_KEYBIND(GUI_ACTION_INS_LIST_ADD);
SAVE_KEYBIND(GUI_ACTION_INS_LIST_DUPLICATE);
SAVE_KEYBIND(GUI_ACTION_INS_LIST_OPEN);
SAVE_KEYBIND(GUI_ACTION_INS_LIST_SAVE);
SAVE_KEYBIND(GUI_ACTION_INS_LIST_MOVE_UP);
SAVE_KEYBIND(GUI_ACTION_INS_LIST_MOVE_DOWN);
SAVE_KEYBIND(GUI_ACTION_INS_LIST_DELETE);
SAVE_KEYBIND(GUI_ACTION_INS_LIST_EDIT);
SAVE_KEYBIND(GUI_ACTION_INS_LIST_UP);
SAVE_KEYBIND(GUI_ACTION_INS_LIST_DOWN);
SAVE_KEYBIND(GUI_ACTION_WAVE_LIST_ADD);
SAVE_KEYBIND(GUI_ACTION_WAVE_LIST_DUPLICATE);
SAVE_KEYBIND(GUI_ACTION_WAVE_LIST_OPEN);
SAVE_KEYBIND(GUI_ACTION_WAVE_LIST_SAVE);
SAVE_KEYBIND(GUI_ACTION_WAVE_LIST_MOVE_UP);
SAVE_KEYBIND(GUI_ACTION_WAVE_LIST_MOVE_DOWN);
SAVE_KEYBIND(GUI_ACTION_WAVE_LIST_DELETE);
SAVE_KEYBIND(GUI_ACTION_WAVE_LIST_EDIT);
SAVE_KEYBIND(GUI_ACTION_WAVE_LIST_UP);
SAVE_KEYBIND(GUI_ACTION_WAVE_LIST_DOWN);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_ADD);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_DUPLICATE);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_OPEN);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_SAVE);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_MOVE_UP);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_MOVE_DOWN);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_DELETE);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_EDIT);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_UP);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_DOWN);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_PREVIEW);
SAVE_KEYBIND(GUI_ACTION_SAMPLE_LIST_STOP_PREVIEW);
SAVE_KEYBIND(GUI_ACTION_ORDERS_UP);
SAVE_KEYBIND(GUI_ACTION_ORDERS_DOWN);
SAVE_KEYBIND(GUI_ACTION_ORDERS_LEFT);
SAVE_KEYBIND(GUI_ACTION_ORDERS_RIGHT);
SAVE_KEYBIND(GUI_ACTION_ORDERS_INCREASE);
SAVE_KEYBIND(GUI_ACTION_ORDERS_DECREASE);
SAVE_KEYBIND(GUI_ACTION_ORDERS_EDIT_MODE);
SAVE_KEYBIND(GUI_ACTION_ORDERS_LINK);
SAVE_KEYBIND(GUI_ACTION_ORDERS_ADD);
SAVE_KEYBIND(GUI_ACTION_ORDERS_DUPLICATE);
SAVE_KEYBIND(GUI_ACTION_ORDERS_DEEP_CLONE);
SAVE_KEYBIND(GUI_ACTION_ORDERS_DUPLICATE_END);
SAVE_KEYBIND(GUI_ACTION_ORDERS_DEEP_CLONE_END);
SAVE_KEYBIND(GUI_ACTION_ORDERS_REMOVE);
SAVE_KEYBIND(GUI_ACTION_ORDERS_MOVE_UP);
SAVE_KEYBIND(GUI_ACTION_ORDERS_MOVE_DOWN);
SAVE_KEYBIND(GUI_ACTION_ORDERS_REPLAY);
e->saveConf();
if (!e->switchMaster()) {
@ -6643,6 +6938,51 @@ bool FurnaceGUI::loop() {
return false;
}
void FurnaceGUI::parseKeybinds() {
actionMapGlobal.clear();
actionMapPat.clear();
actionMapInsList.clear();
actionMapWaveList.clear();
actionMapSampleList.clear();
actionMapOrders.clear();
for (int i=GUI_ACTION_GLOBAL_MIN+1; i<GUI_ACTION_GLOBAL_MAX; i++) {
if (actionKeys[i]&FURK_MASK) {
actionMapGlobal[actionKeys[i]]=i;
}
}
for (int i=GUI_ACTION_PAT_MIN+1; i<GUI_ACTION_PAT_MAX; i++) {
if (actionKeys[i]&FURK_MASK) {
actionMapPat[actionKeys[i]]=i;
}
}
for (int i=GUI_ACTION_INS_LIST_MIN+1; i<GUI_ACTION_INS_LIST_MAX; i++) {
if (actionKeys[i]&FURK_MASK) {
actionMapInsList[actionKeys[i]]=i;
}
}
for (int i=GUI_ACTION_WAVE_LIST_MIN+1; i<GUI_ACTION_INS_LIST_MAX; i++) {
if (actionKeys[i]&FURK_MASK) {
actionMapWaveList[actionKeys[i]]=i;
}
}
for (int i=GUI_ACTION_SAMPLE_LIST_MIN+1; i<GUI_ACTION_INS_LIST_MAX; i++) {
if (actionKeys[i]&FURK_MASK) {
actionMapSampleList[actionKeys[i]]=i;
}
}
for (int i=GUI_ACTION_ORDERS_MIN+1; i<GUI_ACTION_ORDERS_MAX; i++) {
if (actionKeys[i]&FURK_MASK) {
actionMapOrders[actionKeys[i]]=i;
}
}
}
#define IGFD_FileStyleByExtension IGFD_FileStyleByExtention
String getHomeDir() {

View file

@ -118,7 +118,8 @@ enum FurnaceGUIFMAlgs {
};
enum FurnaceGUIActions {
GUI_ACTION_OPEN=0,
GUI_ACTION_GLOBAL_MIN=0,
GUI_ACTION_OPEN,
GUI_ACTION_SAVE,
GUI_ACTION_UNDO,
GUI_ACTION_REDO,
@ -164,7 +165,9 @@ enum FurnaceGUIActions {
GUI_ACTION_COLLAPSE_WINDOW,
GUI_ACTION_CLOSE_WINDOW,
GUI_ACTION_GLOBAL_MAX,
GUI_ACTION_PAT_MIN,
GUI_ACTION_PAT_NOTE_UP,
GUI_ACTION_PAT_NOTE_DOWN,
GUI_ACTION_PAT_OCTAVE_UP,
@ -202,12 +205,15 @@ enum FurnaceGUIActions {
GUI_ACTION_PAT_INSERT,
GUI_ACTION_PAT_MUTE_CURSOR,
GUI_ACTION_PAT_SOLO_CURSOR,
GUI_ACTION_PAT_UNMUTE_ALL,
GUI_ACTION_PAT_NEXT_ORDER,
GUI_ACTION_PAT_PREV_ORDER,
GUI_ACTION_PAT_COLLAPSE,
GUI_ACTION_PAT_INCREASE_COLUMNS,
GUI_ACTION_PAT_DECREASE_COLUMNS,
GUI_ACTION_PAT_MAX,
GUI_ACTION_INS_LIST_MIN,
GUI_ACTION_INS_LIST_ADD,
GUI_ACTION_INS_LIST_DUPLICATE,
GUI_ACTION_INS_LIST_OPEN,
@ -218,7 +224,9 @@ enum FurnaceGUIActions {
GUI_ACTION_INS_LIST_EDIT,
GUI_ACTION_INS_LIST_UP,
GUI_ACTION_INS_LIST_DOWN,
GUI_ACTION_INS_LIST_MAX,
GUI_ACTION_WAVE_LIST_MIN,
GUI_ACTION_WAVE_LIST_ADD,
GUI_ACTION_WAVE_LIST_DUPLICATE,
GUI_ACTION_WAVE_LIST_OPEN,
@ -229,7 +237,9 @@ enum FurnaceGUIActions {
GUI_ACTION_WAVE_LIST_EDIT,
GUI_ACTION_WAVE_LIST_UP,
GUI_ACTION_WAVE_LIST_DOWN,
GUI_ACTION_WAVE_LIST_MAX,
GUI_ACTION_SAMPLE_LIST_MIN,
GUI_ACTION_SAMPLE_LIST_ADD,
GUI_ACTION_SAMPLE_LIST_DUPLICATE,
GUI_ACTION_SAMPLE_LIST_OPEN,
@ -242,7 +252,9 @@ enum FurnaceGUIActions {
GUI_ACTION_SAMPLE_LIST_DOWN,
GUI_ACTION_SAMPLE_LIST_PREVIEW,
GUI_ACTION_SAMPLE_LIST_STOP_PREVIEW,
GUI_ACTION_SAMPLE_LIST_MAX,
GUI_ACTION_ORDERS_MIN,
GUI_ACTION_ORDERS_UP,
GUI_ACTION_ORDERS_DOWN,
GUI_ACTION_ORDERS_LEFT,
@ -260,10 +272,17 @@ enum FurnaceGUIActions {
GUI_ACTION_ORDERS_MOVE_UP,
GUI_ACTION_ORDERS_MOVE_DOWN,
GUI_ACTION_ORDERS_REPLAY,
GUI_ACTION_ORDERS_MAX,
GUI_ACTION_MAX
};
#define FURKMOD_CTRL (1<<31)
#define FURKMOD_SHIFT (1<<29)
#define FURKMOD_META (1<<28)
#define FURKMOD_ALT (1<<27)
#define FURK_MASK 0x40ffffffff
struct SelectionPoint {
int xCoarse, xFine;
int y;
@ -426,14 +445,20 @@ class FurnaceGUI {
FurnaceGUIWindows curWindow;
float peak[2];
// bit 31: ctrl
// bit 30: reserved for SDL scancode mask
// bit 29: shift
// bit 28: meta (win)
// bit 27: alt
// bit 24-26: reserved
int actionKeys[GUI_ACTION_MAX];
std::map<int,FurnaceGUIActions> actionMapGlobal;
std::map<int,FurnaceGUIActions> actionMapPat;
std::map<int,FurnaceGUIActions> actionMapOrders;
std::map<int,FurnaceGUIActions> actionMapInsList;
std::map<int,FurnaceGUIActions> actionMapWaveList;
std::map<int,FurnaceGUIActions> actionMapSampleList;
std::map<int,int> actionMapGlobal;
std::map<int,int> actionMapPat;
std::map<int,int> actionMapOrders;
std::map<int,int> actionMapInsList;
std::map<int,int> actionMapWaveList;
std::map<int,int> actionMapSampleList;
std::vector<DivRegWrite> pgProgram;
int pgSys, pgAddr, pgVal;
@ -528,6 +553,8 @@ class FurnaceGUI {
void drawSettings();
void drawDebug();
void parseKeybinds();
void syncSettings();
void commitSettings();
void processDrags(int dragX, int dragY);