From b98fd4bc7b8548cc2be538a91ce799fabbd3054f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 9 Oct 2007 03:45:24 +0000 Subject: Fix OSC patching. Add OSC "bang" LV2 plugin, with GUI (just a button). Make OSC metronome suck slightly less. git-svn-id: http://svn.drobilla.net/lad/ingen@857 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/NodeModule.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/libs/gui') diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index a0ca3992..1f4f8d91 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -111,7 +111,8 @@ NodeModule::control_change(uint32_t index, float control) if (_slv2_ui) { const LV2UI_Descriptor* const ui_descriptor = slv2_ui_instance_get_descriptor(_slv2_ui); LV2UI_Handle ui_handle = slv2_ui_instance_get_handle(_slv2_ui); - ui_descriptor->port_event(ui_handle, index, 4, &control); + if (ui_descriptor->port_event) + ui_descriptor->port_event(ui_handle, index, 4, &control); } } @@ -190,9 +191,11 @@ NodeModule::embed_gui(bool embed) _gui_item = NULL; } - slv2_ui_instance_free(_slv2_ui); - _slv2_ui = NULL; - _gui = NULL; + if (_slv2_ui) { + slv2_ui_instance_free(_slv2_ui); + _slv2_ui = NULL; + _gui = NULL; + } _ports_y_offset = 0; _minimum_width = 0; // resize() takes care of it.. -- cgit v1.2.1