aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-22 17:34:54 +0000
committerDavid Robillard <d@drobilla.net>2012-08-22 17:34:54 +0000
commit11de5da8be4cc25f5f8df067b1b2fd0cfe2c4bf0 (patch)
treeef73eb325a2365be8e88a78ea4058e9ca3f6a5d6
parent868fd3a72aca98a849c3c323c114c97b6b0b5645 (diff)
downloadjalv-11de5da8be4cc25f5f8df067b1b2fd0cfe2c4bf0.tar.gz
jalv-11de5da8be4cc25f5f8df067b1b2fd0cfe2c4bf0.tar.bz2
jalv-11de5da8be4cc25f5f8df067b1b2fd0cfe2c4bf0.zip
Fix state restoration.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@4745 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/jalv.c6
-rw-r--r--src/state.c11
2 files changed, 9 insertions, 8 deletions
diff --git a/src/jalv.c b/src/jalv.c
index 9f4784e..caa0ece 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -560,8 +560,7 @@ jack_session_cb(jack_session_event_t* event, void* arg)
event->command_line = malloc(MAX_CMD_LEN);
snprintf(event->command_line, MAX_CMD_LEN, "%s -u %s -l \"${SESSION_DIR}\"",
jalv->prog_name,
- event->client_uuid,
- event->session_dir);
+ event->client_uuid);
switch (event->type) {
case JackSessionSave:
@@ -654,9 +653,6 @@ jalv_ui_write(SuilController controller,
const void* buffer)
{
Jalv* const jalv = (Jalv*)controller;
- if (!jalv->has_ui) {
- return;
- }
if (protocol != 0 && protocol != jalv->urids.atom_eventTransfer) {
fprintf(stderr, "UI write with unsupported protocol %d (%s)\n",
diff --git a/src/state.c b/src/state.c
index 8975df9..166cd0e 100644
--- a/src/state.c
+++ b/src/state.c
@@ -147,11 +147,16 @@ set_port_value(const char* port_symbol,
return;
}
- // Send value to plugin
- jalv_ui_write(jalv, port->index, sizeof(fvalue), 0, &fvalue);
+ if (jalv->play_state != JALV_RUNNING) {
+ // Set value on port struct directly
+ port->control = fvalue;
+ } else {
+ // Send value to running plugin
+ jalv_ui_write(jalv, port->index, sizeof(fvalue), 0, &fvalue);
+ }
- // Update UI
if (jalv->has_ui) {
+ // Update UI
char buf[sizeof(ControlChange) + sizeof(fvalue)];
ControlChange* ev = (ControlChange*)buf;
ev->index = port->index;