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/state.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/state.c') 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