summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/ControlGroups.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-21 19:46:07 +0000
committerDavid Robillard <d@drobilla.net>2007-10-21 19:46:07 +0000
commit5ae4d4d5e805e828b51b98767ac51da24c3b21f1 (patch)
tree6f84f0ffff4e7b65cd144e9c3134f66ab6515bd7 /src/libs/gui/ControlGroups.cpp
parent608aeac60ef43243b85c0dcc5894ccc79f35fba5 (diff)
downloadingen-5ae4d4d5e805e828b51b98767ac51da24c3b21f1.tar.gz
ingen-5ae4d4d5e805e828b51b98767ac51da24c3b21f1.tar.bz2
ingen-5ae4d4d5e805e828b51b98767ac51da24c3b21f1.zip
Fix various client-side variable state problems.
Fix port ranges. Close ticket 102. git-svn-id: http://svn.drobilla.net/lad/ingen@895 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/ControlGroups.cpp')
-rw-r--r--src/libs/gui/ControlGroups.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libs/gui/ControlGroups.cpp b/src/libs/gui/ControlGroups.cpp
index b7828a48..236f782e 100644
--- a/src/libs/gui/ControlGroups.cpp
+++ b/src/libs/gui/ControlGroups.cpp
@@ -127,6 +127,8 @@ SliderControlGroup::init(ControlPanel* panel, SharedPtr<PortModel> pm)
} else {
_slider->set_increments(0, 0);
}
+
+ 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()));
//_value_spinner->set_range(min, max);
@@ -184,6 +186,16 @@ SliderControlGroup::set_value(float val)
_enable_signal = true;
}
+
+void
+SliderControlGroup::port_variable_change(const string& key, const Atom& value)
+{
+ if ( (key == "ingen:minimum") && value.type() == Atom::FLOAT)
+ set_range(value.get_float(), _slider->get_adjustment()->get_upper());
+ else if ( (key == "ingen:maximum") && value.type() == Atom::FLOAT)
+ set_range(_slider->get_adjustment()->get_lower(), value.get_float());
+}
+
void
SliderControlGroup::set_range(float min, float max)