summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-02-18 16:33:28 +0000
committerDavid Robillard <d@drobilla.net>2011-02-18 16:33:28 +0000
commit8e07e115429a0869593d4f29dc3e6cf5c8b25049 (patch)
tree68cfdc5ee4a1c932d05ee8988f2738f31c119218 /src/gui
parent7ef2c6553339a3c38f8784d764a8f2610bde5d89 (diff)
downloadingen-8e07e115429a0869593d4f29dc3e6cf5c8b25049.tar.gz
ingen-8e07e115429a0869593d4f29dc3e6cf5c8b25049.tar.bz2
ingen-8e07e115429a0869593d4f29dc3e6cf5c8b25049.zip
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
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/Controls.cpp14
-rw-r--r--src/gui/Controls.hpp2
2 files changed, 8 insertions, 8 deletions
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<PortModel> pm)
_control_connection.disconnect();
_control_connection = pm->signal_value_changed.connect(sigc::mem_fun(this, &Control::set_value));
+
+ boost::shared_ptr<NodeModel> parent = PtrCast<NodeModel>(_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("<span weight=\"bold\">") + name + "</span>";
_name_label->set_markup(name_markup);
@@ -137,8 +143,6 @@ SliderControl::init(ControlPanel* panel, SharedPtr<PortModel> 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<PortModel> 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<PortModel> 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;