From 2ffed40ae657daf54dfaeeb15a3877a1f852b42e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 2 Oct 2007 01:06:29 +0000 Subject: Fix LV2 GUI updating on initial plugin creation (ie w/o having to restart GUI). git-svn-id: http://svn.drobilla.net/lad/ingen@797 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/NodeModule.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index 7a20b4cf..0ab3cfa8 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -91,12 +91,12 @@ NodeModule::create(boost::shared_ptr canvas, SharedPtr n for (MetadataMap::const_iterator m = node->metadata().begin(); m != node->metadata().end(); ++m) ret->set_metadata(m->first, m->second); - uint32_t index = 0; + //uint32_t index = 0; for (PortModelList::const_iterator p = node->ports().begin(); p != node->ports().end(); ++p) { ret->add_port(*p, false); - (*p)->signal_control.connect(sigc::bind<0>( - sigc::mem_fun(ret.get(), &NodeModule::control_change), index)); - ++index; + //(*p)->signal_control.connect(sigc::bind<0>( + // sigc::mem_fun(ret.get(), &NodeModule::control_change), index)); + //++index; } ret->resize(); @@ -222,8 +222,13 @@ NodeModule::rename() void NodeModule::add_port(SharedPtr port, bool resize_to_fit) { - Module::add_port(boost::shared_ptr(new Port( - PtrCast(shared_from_this()), port))); + uint32_t index = _ports.size(); // FIXME: kluge, engine needs to tell us this + + Module::add_port(boost::shared_ptr( + new Port(PtrCast(shared_from_this()), port))); + + port->signal_control.connect(sigc::bind<0>( + sigc::mem_fun(this, &NodeModule::control_change), index)); if (resize_to_fit) resize(); -- cgit v1.2.1