aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-09-21 00:51:19 +0200
committerDavid Robillard <d@drobilla.net>2018-09-21 09:30:31 +0200
commit518bf9042406940fa8e0eacf327fc1015df55244 (patch)
tree9ddfa04ecac7e99d460c9ebb778741601cc36752
parent399a5586a60b81daf483d543adefd025e705c6ed (diff)
downloadjalv-518bf9042406940fa8e0eacf327fc1015df55244.tar.gz
jalv-518bf9042406940fa8e0eacf327fc1015df55244.tar.bz2
jalv-518bf9042406940fa8e0eacf327fc1015df55244.zip
Factor out running show-interface UIs from the console front-end
-rw-r--r--src/jalv_console.c16
1 files 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];