From 8e07e115429a0869593d4f29dc3e6cf5c8b25049 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 18 Feb 2011 16:33:28 +0000 Subject: Use port name from SLV2 for labels where possible (fix ticket #636). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2991 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/Controls.cpp | 14 +++++++------- src/gui/Controls.hpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/gui') diff --git a/src/gui/Controls.cpp b/src/gui/Controls.cpp index 0d99b0dc..1a443ec7 100644 --- a/src/gui/Controls.cpp +++ b/src/gui/Controls.cpp @@ -73,6 +73,12 @@ Control::init(ControlPanel* panel, SharedPtr pm) _control_connection.disconnect(); _control_connection = pm->signal_value_changed.connect(sigc::mem_fun(this, &Control::set_value)); + + boost::shared_ptr parent = PtrCast(_port_model->parent()); + if (parent) + set_label(parent->port_label(pm)); + else + set_label(pm->symbol().c_str()); } @@ -95,7 +101,7 @@ Control::disable() void -Control::set_name(const string& name) +Control::set_label(const string& name) { const string name_markup = string("") + name + ""; _name_label->set_markup(name_markup); @@ -137,8 +143,6 @@ SliderControl::init(ControlPanel* panel, SharedPtr pm) assert(_name_label); assert(_slider); - set_name(pm->path().symbol()); - _slider->set_draw_value(false); signal_button_press_event().connect(sigc::mem_fun(*this, &SliderControl::clicked)); @@ -320,8 +324,6 @@ ToggleControl::init(ControlPanel* panel, SharedPtr pm) assert(_name_label); assert(_checkbutton); - set_name(pm->path().symbol()); - _checkbutton->signal_toggled().connect(sigc::mem_fun(*this, &ToggleControl::toggled)); set_value(pm->value()); @@ -385,8 +387,6 @@ StringControl::init(ControlPanel* panel, SharedPtr pm) assert(_name_label); assert(_entry); - set_name(pm->path().symbol()); - _entry->signal_activate().connect(sigc::mem_fun(*this, &StringControl::activated)); set_value(pm->value()); diff --git a/src/gui/Controls.hpp b/src/gui/Controls.hpp index a26dfd41..1818cc75 100644 --- a/src/gui/Controls.hpp +++ b/src/gui/Controls.hpp @@ -54,7 +54,7 @@ protected: virtual void set_value(const Raul::Atom& value) = 0; virtual void set_range(float min, float max) {} - void set_name(const std::string& name); + void set_label(const std::string& name); void menu_properties(); ControlPanel* _control_panel; -- cgit v1.2.1