diff options
Diffstat (limited to 'src/synth_gui.c')
| -rw-r--r-- | src/synth_gui.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/synth_gui.c b/src/synth_gui.c index f96cccb..f7a541f 100644 --- a/src/synth_gui.c +++ b/src/synth_gui.c @@ -861,7 +861,7 @@ void draw_load_patch(synth_t *synth) { static bool save_name_edit = false; static char save_text[1024] = ""; // TODO default to current patch name - GuiPanel((Rectangle){ WIDTH / 2.0 - 200, HEIGHT / 2.0 - 140, 400, 280 }, "Save patch"); + GuiPanel((Rectangle){ WIDTH / 2.0 - 200, HEIGHT / 2.0 - 140, 400, 280 }, "Load patch"); if (GuiButton( (Rectangle){WIDTH / 2.0 - 50 - 50 - 3, HEIGHT / 2.0 - 12, 100, 24}, "load")) { @@ -870,6 +870,7 @@ void draw_load_patch(synth_t *synth) { fprintf(stderr, "Can't load %s\n", save_text); return; } + synth->patch_name = strdup(save_text); synth->gui.popup = POPUP_NONE; } } @@ -1262,6 +1263,12 @@ draw_main(synth_t *synth) synth->gui.popup = POPUP_LOAD_PATCH; } + if ( GuiButton((Rectangle){ WIDTH - 100 - 50, 50 + 24 + 6 + 24 + 6 + 24 + 6 + 24 + 6 + 24 + 6 + 24 + 6 + 24 + 6, 100, 24 }, "reLOAD!")) { + if (synth->patch_name && load_synth(synth, synth->patch_name)) { + fprintf(stderr, "Can't load %s\n", synth->patch_name); + } + } + // signals draw_signals(synth, 20, 390, WIDTH - 2*20, 200); |
