From 05d020a36581fdc9c5038339e52208f7d9f3e60e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 2 Feb 2013 16:14:11 +0000 Subject: Fix truncation of atom events sent to plugin UIs. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5023 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/NodeModule.cpp | 15 +++------------ src/gui/NodeModule.hpp | 1 - 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 51cbf038..1ddabdec 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -162,15 +162,6 @@ NodeModule::show_human_names(bool b) } } -void -NodeModule::value_changed(uint32_t index, const Raul::Atom& value) -{ - if (!_plugin_ui) - return; - - _plugin_ui->port_event(index, value.size(), value.type(), value.get_body()); -} - void NodeModule::port_activity(uint32_t index, const Raul::Atom& value) { @@ -182,7 +173,7 @@ NodeModule::port_activity(uint32_t index, const Raul::Atom& value) // FIXME: Well, this sucks... LV2_Atom* atom = (LV2_Atom*)malloc(sizeof(LV2_Atom) + value.size()); atom->type = value.type(); - atom->size = value.type(); + atom->size = value.size(); memcpy(LV2_ATOM_BODY(atom), value.get_body(), value.size()); _plugin_ui->port_event( index, lv2_atom_total_size(atom), uris.atom_eventTransfer, atom); @@ -259,7 +250,7 @@ NodeModule::new_port_view(SPtr port) app().world()->conf().option("human-names").get_bool()); port->signal_value_changed().connect( - sigc::bind<0>(sigc::mem_fun(this, &NodeModule::value_changed), + sigc::bind<0>(sigc::mem_fun(this, &NodeModule::port_activity), port->index())); port->signal_activity().connect( @@ -346,7 +337,7 @@ NodeModule::set_control_values() uint32_t index = 0; for (const auto& p : _block->ports()) { if (app().can_control(p.get())) { - value_changed(index, p->value()); + port_activity(index, p->value()); } ++index; } diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp index f1521c5f..6edad27b 100644 --- a/src/gui/NodeModule.hpp +++ b/src/gui/NodeModule.hpp @@ -82,7 +82,6 @@ protected: void new_port_view(SPtr port); - void value_changed(uint32_t index, const Raul::Atom& value); void port_activity(uint32_t index, const Raul::Atom& value); void plugin_changed(); void set_control_values(); -- cgit v1.2.1