From 11de5da8be4cc25f5f8df067b1b2fd0cfe2c4bf0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 22 Aug 2012 17:34:54 +0000 Subject: Fix state restoration. git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@4745 a436a847-0d15-0410-975c-d299462d15a1 --- src/jalv.c | 6 +----- src/state.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src') 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; -- cgit v1.2.1