aboutsummaryrefslogtreecommitdiffstats
path: root/src/frontend.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-30 18:17:40 -0400
committerDavid Robillard <d@drobilla.net>2022-08-17 13:50:20 -0400
commitd0a79a7547369bdb341af5bc5f7b52b879a89d03 (patch)
tree373b61fc40d6162b5d8e48ebef38567029d82816 /src/frontend.h
parent0f84c369fe82c6228b4827b54d6402ff894c6f92 (diff)
downloadjalv-d0a79a7547369bdb341af5bc5f7b52b879a89d03.tar.gz
jalv-d0a79a7547369bdb341af5bc5f7b52b879a89d03.tar.bz2
jalv-d0a79a7547369bdb341af5bc5f7b52b879a89d03.zip
Clearly separate frontends from common internals
Diffstat (limited to 'src/frontend.h')
-rw-r--r--src/frontend.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/frontend.h b/src/frontend.h
new file mode 100644
index 0000000..b2e722d
--- /dev/null
+++ b/src/frontend.h
@@ -0,0 +1,55 @@
+// Copyright 2007-2022 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef JALV_UI_H
+#define JALV_UI_H
+
+#include "jalv_internal.h"
+
+#include "lilv/lilv.h"
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Interface that must be implemented by UIs
+
+/// Read command-line arguments and set `opts` accordingly
+int
+jalv_frontend_init(int* argc, char*** argv, JalvOptions* opts);
+
+/// Return the URI of the "native" LV2 UI type
+const char*
+jalv_frontend_ui_type(void);
+
+/// Return true if an interactive frontend is available
+bool
+jalv_frontend_discover(Jalv* jalv);
+
+/// Return the ideal refresh rate of the frontend in Hz
+float
+jalv_frontend_refresh_rate(Jalv* jalv);
+
+/// Return the scale factor of the frontend (for example 2.0 for double sized)
+float
+jalv_frontend_scale_factor(Jalv* jalv);
+
+/// Attempt to get a plugin URI selection from the user
+LilvNode*
+jalv_frontend_select_plugin(Jalv* jalv);
+
+/// Open and run the frontend interface, signalling jalv.done when finished
+int
+jalv_frontend_open(Jalv* jalv);
+
+/// Quit and close the frontend interface
+int
+jalv_frontend_close(Jalv* jalv);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // JALV_UI_H