summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_controller.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-11-01 07:25:47 +0100
committerRobin Gareus <robin@gareus.org>2014-11-01 07:27:35 +0100
commit52f44dc4dad15a70b9dff6284abc07e67ee65941 (patch)
treea26848fe54b6c2c56dd9b5bbb89784ba7b2409b0 /gtk2_ardour/automation_controller.cc
parentc855d17e09a4b8a977ff9e026dd1b01e80c3bf65 (diff)
convert interface <> internal values for all automation
fixes Send-Fader, Gain-Automation and various Plugin-Slider ranges
Diffstat (limited to 'gtk2_ardour/automation_controller.cc')
-rw-r--r--gtk2_ardour/automation_controller.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc
index 3174980a7b..77b8d39406 100644
--- a/gtk2_ardour/automation_controller.cc
+++ b/gtk2_ardour/automation_controller.cc
@@ -69,18 +69,19 @@ AutomationController::create(
const Evoral::Parameter& param,
boost::shared_ptr<AutomationControl> ac)
{
+ double const lo = ac->internal_to_interface(param.min());
+ double const up = ac->internal_to_interface(param.max());
Gtk::Adjustment* adjustment = manage (
- new Gtk::Adjustment (
- param.normal(),
- param.min(),
- param.max(),
- (param.max() - param.min()) / 100.0,
- (param.max() - param.min()) / 10.0
- )
- );
-
- assert (ac);
- assert(ac->parameter() == param);
+ new Gtk::Adjustment (
+ ac->internal_to_interface(param.normal()),
+ lo, up,
+ // TODO we should use explicit step-sizes if provided by Plugin::ParameterDescriptor
+ (up - lo) / 100, (up - lo) / 10
+ )
+ );
+
+ assert (ac);
+ assert(ac->parameter() == param);
return boost::shared_ptr<AutomationController>(new AutomationController(printer, ac, adjustment));
}
@@ -94,7 +95,7 @@ AutomationController::get_label (double& xpos)
void
AutomationController::display_effective_value()
{
- double const interface_value = _controllable->get_value();
+ double const interface_value = _controllable->internal_to_interface(_controllable->get_value());
if (_adjustment->get_value () != interface_value) {
_ignore_change = true;
@@ -107,7 +108,7 @@ void
AutomationController::value_adjusted ()
{
if (!_ignore_change) {
- _controllable->set_value (_adjustment->get_value());
+ _controllable->set_value (_controllable->interface_to_internal(_adjustment->get_value()));
}
}