aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-22 19:12:33 -0500
committerDavid Robillard <d@drobilla.net>2024-11-24 19:12:14 -0500
commit57006d3bf443f2ade18abe7021f8aa8a11b08bcb (patch)
treec61b54c1b8133e4b05f4250c1dac48a933815908 /src/jalv.h
parentacdbc427a6c6bb55e0073b6f6910543184f35177 (diff)
downloadjalv-57006d3bf443f2ade18abe7021f8aa8a11b08bcb.tar.gz
jalv-57006d3bf443f2ade18abe7021f8aa8a11b08bcb.tar.bz2
jalv-57006d3bf443f2ade18abe7021f8aa8a11b08bcb.zip
Cleanly separate audio thread from the rest of the application
Diffstat (limited to 'src/jalv.h')
-rw-r--r--src/jalv.h72
1 files changed, 28 insertions, 44 deletions
diff --git a/src/jalv.h b/src/jalv.h
index 07e24e8..518f94d 100644
--- a/src/jalv.h
+++ b/src/jalv.h
@@ -14,10 +14,10 @@
#include "nodes.h"
#include "options.h"
#include "port.h"
+#include "process.h"
#include "settings.h"
#include "types.h"
#include "urids.h"
-#include "worker.h"
#if USE_SUIL
# include <suil/suil.h>
@@ -27,7 +27,6 @@
#include <lv2/atom/forge.h>
#include <lv2/core/lv2.h>
#include <lv2/urid/urid.h>
-#include <zix/ring.h>
#include <zix/sem.h>
#include <stdbool.h>
@@ -39,52 +38,37 @@ JALV_BEGIN_DECLS
/// Internal application state
struct JalvImpl {
- JalvOptions opts; ///< Command-line options
- LilvWorld* world; ///< Lilv World
- JalvMapper* mapper; ///< URI mapper/unmapper
- JalvURIDs urids; ///< URIDs
- JalvNodes nodes; ///< Nodes
- JalvLog log; ///< Log for error/warning/debug messages
- LV2_Atom_Forge forge; ///< Atom forge
- JalvDumper* dumper; ///< Atom dumper (console debug output)
- JalvBackend* backend; ///< Audio system backend
- JalvSettings settings; ///< Processing settings
- ZixRing* ui_to_plugin; ///< Port events from UI
- ZixRing* plugin_to_ui; ///< Port events from plugin
- void* audio_msg; ///< Buffer for messages in the audio thread
- void* ui_msg; ///< Buffer for messages in the UI thread
- JalvWorker* worker; ///< Worker thread implementation
- JalvWorker* state_worker; ///< Synchronous worker for state restore
- ZixSem work_lock; ///< Lock for plugin work() method
- ZixSem done; ///< Exit semaphore
- ZixSem paused; ///< Paused signal from process thread
- JalvRunState run_state; ///< Current process thread run state
- char* temp_dir; ///< Temporary plugin state directory
- char* save_dir; ///< Plugin save directory
- const LilvPlugin* plugin; ///< Plugin class (RDF data)
- LilvState* preset; ///< Current preset
- LilvUIs* uis; ///< All plugin UIs (RDF data)
- const LilvUI* ui; ///< Plugin UI (RDF data)
- const LilvNode* ui_type; ///< Plugin UI type (unwrapped)
- LilvInstance* instance; ///< Plugin instance (shared library)
+ JalvOptions opts; ///< Command-line options
+ LilvWorld* world; ///< Lilv World
+ JalvMapper* mapper; ///< URI mapper/unmapper
+ JalvURIDs urids; ///< URIDs
+ JalvNodes nodes; ///< Nodes
+ JalvLog log; ///< Log for error/warning/debug messages
+ LV2_Atom_Forge forge; ///< Atom forge
+ JalvDumper* dumper; ///< Atom dumper (console debug output)
+ JalvBackend* backend; ///< Audio system backend
+ JalvSettings settings; ///< Processing settings
+ void* ui_msg; ///< Buffer for messages in the UI thread
+ ZixSem work_lock; ///< Lock for plugin work() method
+ ZixSem done; ///< Exit semaphore
+ char* temp_dir; ///< Temporary plugin state directory
+ char* save_dir; ///< Plugin save directory
+ const LilvPlugin* plugin; ///< Plugin class (RDF data)
+ LilvState* preset; ///< Current preset
+ LilvUIs* uis; ///< All plugin UIs (RDF data)
+ const LilvUI* ui; ///< Plugin UI (RDF data)
+ const LilvNode* ui_type; ///< Plugin UI type (unwrapped)
+ JalvProcess process; ///< Process thread state
#if USE_SUIL
SuilHost* ui_host; ///< Plugin UI host support
SuilInstance* ui_instance; ///< Plugin UI instance (shared library)
#endif
- void* window; ///< Window (if applicable)
- JalvPort* ports; ///< Port array of size num_ports
- Controls controls; ///< Available plugin controls
- float* controls_buf; ///< Control port buffers array
- size_t msg_buf_size; ///< Maximum size of a single message
- uint32_t control_in; ///< Index of control input port
- uint32_t num_ports; ///< Total number of ports on the plugin
- uint32_t plugin_latency; ///< Latency reported by plugin (if any)
- uint32_t event_delta_t; ///< Frames since last update sent to UI
- uint32_t position; ///< Transport position in frames
- float bpm; ///< Transport tempo in beats per minute
- bool rolling; ///< Transport speed (0=stop, 1=play)
- bool has_ui; ///< True iff a control UI is present
- bool safe_restore; ///< Plugin restore() is thread-safe
+ void* window; ///< Window (if applicable)
+ JalvPort* ports; ///< Port array of size num_ports
+ Controls controls; ///< Available plugin controls
+ size_t ui_msg_size; ///< Maximum size of a single message
+ uint32_t num_ports; ///< Total number of ports on the plugin
+ bool safe_restore; ///< Plugin restore() is thread-safe
JalvFeatures features;
const LV2_Feature** feature_list;
};