fix: move CarlaHost to Engine struct and fix TUI plugin dialog access
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
9
gui.c
9
gui.c
@@ -46,7 +46,7 @@ static int loop_length = 8; /* beats */
|
||||
static int current_beat = 0;
|
||||
|
||||
/* Carla host and plugin URI input */
|
||||
static CarlaHost carla_host;
|
||||
/* CarlaHost is now stored in Engine struct */
|
||||
static char plugin_uri_input[256];
|
||||
static int plugin_uri_input_len = 0;
|
||||
static int selected_channel = 0;
|
||||
@@ -136,7 +136,7 @@ static void gui_update(void)
|
||||
mu_layout_row(ctx, 1, (int[]) { -1 }, 0);
|
||||
if (mu_button(ctx, "Add Plugin")) {
|
||||
if (plugin_uri_input_len > 0) {
|
||||
carla_add_plugin(&carla_host, selected_channel, plugin_uri_input, PLUGIN_TYPE_INTERNAL);
|
||||
carla_add_plugin(&g_engine->carla_host, selected_channel, plugin_uri_input, PLUGIN_TYPE_INTERNAL);
|
||||
plugin_uri_input_len = 0;
|
||||
plugin_uri_input[0] = '\0';
|
||||
}
|
||||
@@ -155,8 +155,7 @@ int gui_main(Engine *engine)
|
||||
{
|
||||
g_engine = engine;
|
||||
|
||||
/* Initialize Carla host */
|
||||
carla_init(&carla_host, engine->client);
|
||||
/* Carla host is now initialized in engine_init */
|
||||
|
||||
/* initialise microui */
|
||||
ctx = malloc(sizeof(mu_Context));
|
||||
@@ -259,7 +258,7 @@ int gui_main(Engine *engine)
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
carla_cleanup(&carla_host);
|
||||
carla_cleanup(&g_engine->carla_host);
|
||||
endwin();
|
||||
free(ctx);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user