diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/gui/NodeModule.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
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<PatchCanvas> canvas, SharedPtr<NodeModel> 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<PortModel> port, bool resize_to_fit) { - Module::add_port(boost::shared_ptr<Port>(new Port( - PtrCast<NodeModule>(shared_from_this()), port))); + uint32_t index = _ports.size(); // FIXME: kluge, engine needs to tell us this + + Module::add_port(boost::shared_ptr<Port>( + new Port(PtrCast<NodeModule>(shared_from_this()), port))); + + port->signal_control.connect(sigc::bind<0>( + sigc::mem_fun(this, &NodeModule::control_change), index)); if (resize_to_fit) resize(); |