summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-02 01:06:29 +0000
committerDavid Robillard <d@drobilla.net>2007-10-02 01:06:29 +0000
commit2ffed40ae657daf54dfaeeb15a3877a1f852b42e (patch)
tree5a8f21e8cd26b9d134afda043bf44db6b370982b /src
parent46bbe8f34a222cbea12ca27c3135087fd0b7814c (diff)
downloadingen-2ffed40ae657daf54dfaeeb15a3877a1f852b42e.tar.gz
ingen-2ffed40ae657daf54dfaeeb15a3877a1f852b42e.tar.bz2
ingen-2ffed40ae657daf54dfaeeb15a3877a1f852b42e.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/libs/gui/NodeModule.cpp17
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();