diff options
author | David Robillard <d@drobilla.net> | 2013-02-24 01:46:15 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-02-24 01:46:15 +0000 |
commit | 4ff4c69ff0d22e88b8799f36f277de263232de4f (patch) | |
tree | 1fa73050181683a01799a1afea246b3d463f9699 /src/gui | |
parent | c09203d0caa4695bec58a8bf84e31ff69de5eb61 (diff) | |
download | ingen-4ff4c69ff0d22e88b8799f36f277de263232de4f.tar.gz ingen-4ff4c69ff0d22e88b8799f36f277de263232de4f.tar.bz2 ingen-4ff4c69ff0d22e88b8799f36f277de263232de4f.zip |
Don't send port values to UI for audio ports (fix Calf crash).
Don't set ingen:value property for non-control ports.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5081 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/NodeModule.cpp | 27 | ||||
-rw-r--r-- | src/gui/NodeModule.hpp | 1 |
2 files changed, 23 insertions, 5 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index e0509c51..a03c1693 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -170,12 +170,29 @@ NodeModule::port_activity(uint32_t index, const Atom& value) return; } + if (_block->get_port(index)->is_a(Raul::URI(LV2_ATOM__AtomPort))) { + _plugin_ui->port_event(index, + lv2_atom_total_size(value.atom()), + uris.atom_eventTransfer, + value.atom()); + } +} + +void +NodeModule::port_value_changed(uint32_t index, const Atom& value) +{ + const URIs& uris = app().uris(); + if (!_plugin_ui) { + return; + } + if (value.type() == uris.atom_Float) { _plugin_ui->port_event(index, sizeof(float), 0, value.ptr<float>()); } else { - const LV2_Atom* const atom = value.atom(); - _plugin_ui->port_event( - index, lv2_atom_total_size(atom), uris.atom_eventTransfer, atom); + _plugin_ui->port_event(index, + lv2_atom_total_size(value.atom()), + uris.atom_eventTransfer, + value.atom()); } } @@ -249,7 +266,7 @@ NodeModule::new_port_view(SPtr<const PortModel> port) app().world()->conf().option("human-names").get<int32_t>()); port->signal_value_changed().connect( - sigc::bind<0>(sigc::mem_fun(this, &NodeModule::port_activity), + sigc::bind<0>(sigc::mem_fun(this, &NodeModule::port_value_changed), port->index())); port->signal_activity().connect( @@ -336,7 +353,7 @@ NodeModule::set_control_values() uint32_t index = 0; for (const auto& p : _block->ports()) { if (app().can_control(p.get())) { - port_activity(index, p->value()); + port_value_changed(index, p->value()); } ++index; } diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp index 1092cdf3..e38859ef 100644 --- a/src/gui/NodeModule.hpp +++ b/src/gui/NodeModule.hpp @@ -83,6 +83,7 @@ protected: void new_port_view(SPtr<const Client::PortModel> port); void port_activity(uint32_t index, const Atom& value); + void port_value_changed(uint32_t index, const Atom& value); void plugin_changed(); void set_control_values(); |