diff options
author | Robin Gareus <robin@gareus.org> | 2018-07-18 10:55:41 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-07-18 10:57:57 +0200 |
commit | 0e79253412af587eb6cd8f3f72b841f5517dd47c (patch) | |
tree | bac0615018b179bdec14e0d7692d95f03d50f101 /gtk2_ardour | |
parent | 14517e13ecb160511a36f0104f6e4b5210751fc7 (diff) |
Fix generic UI sliders w/rangesteps
Leave the user in control while the slider is being dragged.
Previously there was a feedback loop:
User-drags slider -> value changes -> value is rounded
-> slider is updated with rounded value (while the user still drags)
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/automation_controller.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/automation_controller.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index 0b040a30d9..c7860c53cb 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -70,6 +70,7 @@ AutomationController::AutomationController(boost::shared_ptr<AutomationControl> , _controllable(ac) , _adjustment(adj) , _ignore_change(false) + , _grabbed(false) { if (ac->toggled()) { ArdourButton* but = manage(new ArdourButton()); @@ -165,6 +166,13 @@ AutomationController::display_effective_value () { double const interface_value = _controllable->internal_to_interface(_controllable->get_value()); + if (_grabbed) { + /* we cannot use _controllable->touching() here + * because that's only set in Write or Touch mode. + * Besides ctrl-surfaces may also set touching() + */ + return; + } if (_adjustment->get_value () != interface_value) { _ignore_change = true; _adjustment->set_value (interface_value); @@ -197,6 +205,7 @@ AutomationController::value_adjusted () void AutomationController::start_touch() { + _grabbed = true; _controllable->start_touch (_controllable->session().transport_sample()); } @@ -204,6 +213,10 @@ void AutomationController::end_touch () { _controllable->stop_touch (_controllable->session().transport_sample()); + if (_grabbed) { + _grabbed = false; + display_effective_value (); + } } bool diff --git a/gtk2_ardour/automation_controller.h b/gtk2_ardour/automation_controller.h index 12b31f6d86..ac87ee300f 100644 --- a/gtk2_ardour/automation_controller.h +++ b/gtk2_ardour/automation_controller.h @@ -102,6 +102,7 @@ private: sigc::connection _screen_update_connection; PBD::ScopedConnectionList _changed_connections; bool _ignore_change; + bool _grabbed; }; |