summaryrefslogtreecommitdiffstats
path: root/src/progs/ingenuity/ControlGroups.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-04-11 04:38:56 +0000
committerDavid Robillard <d@drobilla.net>2007-04-11 04:38:56 +0000
commitef4daed2d72e43ad700da9ca243318b8e43bb5e8 (patch)
tree612b1e406c0e1c493eb8e8b0f5e616bd1772d13b /src/progs/ingenuity/ControlGroups.cpp
parent6adcdbad95f04d10fffc58a92265dcb0a3f3dd46 (diff)
downloadingen-ef4daed2d72e43ad700da9ca243318b8e43bb5e8.tar.gz
ingen-ef4daed2d72e43ad700da9ca243318b8e43bb5e8.tar.bz2
ingen-ef4daed2d72e43ad700da9ca243318b8e43bb5e8.zip
Fix control range restoring when reattaching to the engine (properly store port min/max metadata as floats).
git-svn-id: http://svn.drobilla.net/lad/ingen@439 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/ingenuity/ControlGroups.cpp')
-rw-r--r--src/progs/ingenuity/ControlGroups.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/progs/ingenuity/ControlGroups.cpp b/src/progs/ingenuity/ControlGroups.cpp
index e6008fae..5234e9fe 100644
--- a/src/progs/ingenuity/ControlGroups.cpp
+++ b/src/progs/ingenuity/ControlGroups.cpp
@@ -201,8 +201,8 @@ SliderControlGroup::disable()
void
SliderControlGroup::min_changed()
{
- double min = _min_spinner->get_value();
- const double max = _max_spinner->get_value();
+ float min = _min_spinner->get_value();
+ const float max = _max_spinner->get_value();
if (min >= max) {
min = max - 1.0;
@@ -211,19 +211,16 @@ SliderControlGroup::min_changed()
_slider->set_range(min, max);
- if (_enable_signal) {
- char temp_buf[16];
- snprintf(temp_buf, 16, "%f", min);
- App::instance().engine()->set_metadata(_port_model->path(), "min", temp_buf);
- }
+ if (_enable_signal)
+ App::instance().engine()->set_metadata(_port_model->path(), "min", min);
}
void
SliderControlGroup::max_changed()
{
- const double min = _min_spinner->get_value();
- double max = _max_spinner->get_value();
+ const float min = _min_spinner->get_value();
+ float max = _max_spinner->get_value();
if (max <= min) {
max = min + 1.0;
@@ -232,11 +229,8 @@ SliderControlGroup::max_changed()
_slider->set_range(min, max);
- if (_enable_signal) {
- char temp_buf[16];
- snprintf(temp_buf, 16, "%f", max);
- App::instance().engine()->set_metadata(_port_model->path(), "max", temp_buf);
- }
+ if (_enable_signal)
+ App::instance().engine()->set_metadata(_port_model->path(), "max", max);
}