From 02b16c6c80b4dd2d52fe3f34a800fef67e31611b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 4 Feb 2010 19:21:46 +0000 Subject: Follow lv2:name for nodes as well (when human names are visible). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2425 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/NodeModule.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 58366377..9f10ffe7 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -121,16 +121,20 @@ NodeModule::create(boost::shared_ptr canvas, SharedPtr n void NodeModule::show_human_names(bool b) { + const LV2URIMap& uris = App::instance().uris(); + if (b && node()->plugin()) { Glib::Mutex::Lock lock(App::instance().world()->rdf_world->mutex()); - set_name(node()->plugin_model()->human_name()); + const Raul::Atom& name_property = node()->get_property(uris.lv2_name); + if (name_property.type() == Atom::STRING) + set_name(name_property.get_string()); + else + set_name(node()->plugin_model()->human_name()); } else { b = false; set_name(node()->symbol().c_str()); } - const LV2URIMap& uris = App::instance().uris(); - for (PortVector::const_iterator i = ports().begin(); i != ports().end(); ++i) { SharedPtr port = PtrCast(*i); Glib::ustring label(port->model()->symbol().c_str()); @@ -417,6 +421,12 @@ NodeModule::set_property(const URI& key, const Atom& value) _canvas.lock()->unselect_item(shared_from_this()); } } + break; + case Atom::STRING: + if (key == uris.lv2_name + && App::instance().configuration()->name_style() == Configuration::HUMAN) { + set_name(value.get_string()); + } default: break; } } -- cgit v1.2.1