From 518bf9042406940fa8e0eacf327fc1015df55244 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 21 Sep 2018 00:51:19 +0200 Subject: Factor out running show-interface UIs from the console front-end --- src/jalv_console.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/jalv_console.c b/src/jalv_console.c index d012012..f78641c 100644 --- a/src/jalv_console.c +++ b/src/jalv_console.c @@ -166,9 +166,10 @@ jalv_discover_ui(Jalv* jalv) return jalv->opts.show_ui; } -int -jalv_open_ui(Jalv* jalv) +static bool +jalv_run_custom_ui(Jalv* jalv) { +#ifdef HAVE_SUIL const LV2UI_Idle_Interface* idle_iface = NULL; const LV2UI_Show_Interface* show_iface = NULL; if (jalv->ui && jalv->opts.show_ui) { @@ -192,8 +193,17 @@ jalv_open_ui(Jalv* jalv) } show_iface->hide(suil_instance_get_handle(jalv->ui_instance)); + return true; + } +#endif + + return false; +} - } else if (!jalv->opts.non_interactive) { +int +jalv_open_ui(Jalv* jalv) +{ + if (!jalv_run_custom_ui(jalv) && !jalv->opts.non_interactive) { // Primitive command prompt for setting control values while (!zix_sem_try_wait(jalv->done)) { char line[128]; -- cgit v1.2.1