diff options
author | David Robillard <d@drobilla.net> | 2010-02-03 19:27:29 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-03 19:27:29 +0000 |
commit | 3e495d47f06cca50521076e8f77a966dfec521ab (patch) | |
tree | 8ee0d2ab6c9625d419469a7cc94935f45f3abb0e /src/gui | |
parent | 3bfa32ee840e1f5abbfc392a2323e9ba0c4a78ce (diff) | |
download | ingen-3e495d47f06cca50521076e8f77a966dfec521ab.tar.gz ingen-3e495d47f06cca50521076e8f77a966dfec521ab.tar.bz2 ingen-3e495d47f06cca50521076e8f77a966dfec521ab.zip |
Make human names work with LADSPA plugins as well (fix ticket #477).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2416 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/NodeModule.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 024e054d..cb6a06af 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -123,24 +123,29 @@ NodeModule::show_human_names(bool b) { if (b && node()->plugin()) { Glib::Mutex::Lock lock(App::instance().world()->rdf_world->mutex()); - set_name(((PluginModel*)node()->plugin())->human_name()); + set_name(node()->plugin_model()->human_name()); } else { b = false; + set_name(node()->symbol().c_str()); } - if (!b) - set_name(node()->symbol().c_str()); + const LV2URIMap& uris = App::instance().uris(); - uint32_t index = 0; for (PortVector::const_iterator i = ports().begin(); i != ports().end(); ++i) { - Glib::ustring label(node()->port(index)->symbol().c_str()); + SharedPtr<Ingen::GUI::Port> port = PtrCast<Ingen::GUI::Port>(*i); + Glib::ustring label(port->model()->symbol().c_str()); if (b) { - Glib::ustring hn = ((PluginModel*)node()->plugin())->port_human_name(index); - if (hn != "") - label = hn; + const Raul::Atom& name_property = port->model()->get_property(uris.lv2_name); + if (name_property.type() == Atom::STRING) { + label = name_property.get_string(); + } else { + Glib::ustring hn = node()->plugin_model()->port_human_name( + port->model()->index()); + if (hn != "") + label = hn; + } } (*i)->set_name(label); - ++index; } resize(); |