aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv_internal.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-07-31 15:24:34 -0400
committerDavid Robillard <d@drobilla.net>2016-07-31 15:24:34 -0400
commitf4ee02db64ee39f1653cbc5373abaa748707e580 (patch)
tree1d036b3f382f2266700c16d484c96f876e12c7f0 /src/jalv_internal.h
parent005f9bf2051725a197c3b79e769214f78bb23b16 (diff)
downloadjalv-f4ee02db64ee39f1653cbc5373abaa748707e580.tar.gz
jalv-f4ee02db64ee39f1653cbc5373abaa748707e580.tar.bz2
jalv-f4ee02db64ee39f1653cbc5373abaa748707e580.zip
Support thread-safe state restoration
Diffstat (limited to 'src/jalv_internal.h')
-rw-r--r--src/jalv_internal.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jalv_internal.h b/src/jalv_internal.h
index 7aa9e9e..818f19c 100644
--- a/src/jalv_internal.h
+++ b/src/jalv_internal.h
@@ -237,12 +237,14 @@ typedef enum {
} JalvPlayState;
typedef struct {
+ Jalv* jalv; ///< Pointer back to Jalv
jack_ringbuffer_t* requests; ///< Requests to the worker
jack_ringbuffer_t* responses; ///< Responses from the worker
void* response; ///< Worker response buffer
ZixSem sem; ///< Worker semaphore
ZixThread thread; ///< Worker thread
const LV2_Worker_Interface* iface; ///< Plugin worker interface
+ bool threaded; ///< Run work in another thread
} JalvWorker;
struct Jalv {
@@ -264,6 +266,7 @@ struct Jalv {
jack_ringbuffer_t* plugin_events; ///< Port events from plugin
void* ui_event_buf; ///< Buffer for reading UI port events
JalvWorker worker; ///< Worker thread implementation
+ JalvWorker state_worker; ///< Synchronous worker for state restore
ZixSem* done; ///< Exit semaphore
ZixSem paused; ///< Paused signal from process thread
JalvPlayState play_state; ///< Current play state
@@ -296,7 +299,8 @@ struct Jalv {
bool buf_size_set; ///< True iff buffer size callback fired
bool exit; ///< True iff execution is finished
bool has_ui; ///< True iff a control UI is present
- bool state_changed; ///< Plugin state has changed
+ bool request_update; ///< True iff a plugin update is needed
+ bool safe_restore; ///< Plugin restore() is thread-safe
};
int