summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/ControlGroups.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-05-19 21:36:34 +0000
committerDavid Robillard <d@drobilla.net>2008-05-19 21:36:34 +0000
commitf9eba59332ee7e45ffbfebcd0ce79e8e0cfd9ec4 (patch)
treefa8a4a74ee4072987ed79ffdcf766730bcdc0790 /src/libs/gui/ControlGroups.cpp
parentee173c38c5c0a385c46bec12e3f52c57e0e074a0 (diff)
downloadingen-f9eba59332ee7e45ffbfebcd0ce79e8e0cfd9ec4.tar.gz
ingen-f9eba59332ee7e45ffbfebcd0ce79e8e0cfd9ec4.tar.bz2
ingen-f9eba59332ee7e45ffbfebcd0ce79e8e0cfd9ec4.zip
More (but not yet completely) type safe value_changed notification.
git-svn-id: http://svn.drobilla.net/lad/ingen@1216 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/ControlGroups.cpp')
-rw-r--r--src/libs/gui/ControlGroups.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libs/gui/ControlGroups.cpp b/src/libs/gui/ControlGroups.cpp
index 236f782e..114bb79d 100644
--- a/src/libs/gui/ControlGroups.cpp
+++ b/src/libs/gui/ControlGroups.cpp
@@ -64,7 +64,7 @@ ControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm)
assert(_port_model);
assert(panel);
- _control_connection = pm->signal_control.connect(sigc::mem_fun(this, &ControlGroup::set_value));
+ _control_connection = pm->signal_value_changed.connect(sigc::mem_fun(this, &ControlGroup::set_value));
}
@@ -130,7 +130,7 @@ SliderControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm)
pm->signal_variable.connect(sigc::mem_fun(this, &SliderControlGroup::port_variable_change));
- _slider->set_range(std::min(min, pm->value()), std::max(max, pm->value()));
+ _slider->set_range(std::min(min, pm->value().get_float()), std::max(max, pm->value().get_float()));
//_value_spinner->set_range(min, max);
set_value(pm->value());
@@ -165,8 +165,10 @@ SliderControlGroup::menu_properties()
void
-SliderControlGroup::set_value(float val)
+SliderControlGroup::set_value(const Atom& atom)
{
+ float val = atom.get_float();
+
if (_port_model->is_integer())
val = lrintf(val);