From b4b775fb90913f93646560cef250979a002f1fd1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 12 Oct 2008 17:59:33 +0000 Subject: Fix blank port names for plugins without human names (ie all LADSPA and internal ones, currently). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1663 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/NodeModule.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 7f891a51..742ad4c4 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -99,7 +99,7 @@ NodeModule::create(boost::shared_ptr canvas, SharedPtr n } if (human) - ret->show_human_names(human); + ret->show_human_names(human); // FIXME: double port iteration ret->resize(); ret->set_stacked_border(node->polyphonic()); @@ -123,13 +123,13 @@ NodeModule::show_human_names(bool b) uint32_t index = 0; for (PortVector::const_iterator i = ports().begin(); i != ports().end(); ++i) { + string name = node()->port(index)->symbol(); if (b) { string hn = ((PluginModel*)node()->plugin())->port_human_name(index); if (hn != "") - (*i)->set_name(hn); - } else { - (*i)->set_name(node()->port(index)->symbol()); + name = hn; } + (*i)->set_name(name); ++index; } @@ -234,8 +234,11 @@ NodeModule::add_port(SharedPtr port, bool resize_to_fit) uint32_t index = _ports.size(); // FIXME: kludge, engine needs to tell us this string name = port->path().name(); - if (App::instance().configuration()->name_style() == Configuration::HUMAN && node()->plugin()) - name = ((PluginModel*)node()->plugin())->port_human_name(index); + if (App::instance().configuration()->name_style() == Configuration::HUMAN && node()->plugin()) { + string hn = ((PluginModel*)node()->plugin())->port_human_name(index); + if (hn != "") + name = hn; + } Module::add_port(boost::shared_ptr( new Port(PtrCast(shared_from_this()), port, name))); -- cgit v1.2.1