summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_controller.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-07-15 20:50:26 +0200
committerRobin Gareus <robin@gareus.org>2017-07-16 16:58:00 +0200
commit5aecfc5acb41f6d05804a88b99eec159e96a66c9 (patch)
treefbe3b294fc30297e479d4c776e5fc74cb033dd34 /gtk2_ardour/automation_controller.cc
parent69ecb0db70996a5c1092efe712d195ffcff5e8b1 (diff)
Remove Timers to watch Controllable values
Depend on Changed() signals alone, which are usually much less frequent than rapid-timer events. As side-effect we now need to make the widgets insensitive when playing automation. Previously the user could not change the value because the Timer periodically reset it.
Diffstat (limited to 'gtk2_ardour/automation_controller.cc')
-rw-r--r--gtk2_ardour/automation_controller.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc
index 3809dc215f..6816bffa93 100644
--- a/gtk2_ardour/automation_controller.cc
+++ b/gtk2_ardour/automation_controller.cc
@@ -114,10 +114,13 @@ AutomationController::AutomationController(boost::shared_ptr<AutomationControl>
_adjustment->signal_value_changed().connect(
sigc::mem_fun(*this, &AutomationController::value_adjusted));
- _screen_update_connection = Timers::rapid_connect (
- sigc::mem_fun (*this, &AutomationController::display_effective_value));
+ ac->Changed.connect (_changed_connections, invalidator (*this), boost::bind (&AutomationController::display_effective_value, this), gui_context());
+ display_effective_value ();
- ac->Changed.connect (_changed_connection, invalidator (*this), boost::bind (&AutomationController::display_effective_value, this), gui_context());
+ if (ac->alist ()) {
+ ac->alist()->automation_state_changed.connect (_changed_connections, invalidator (*this), boost::bind (&AutomationController::automation_state_changed, this), gui_context());
+ automation_state_changed ();
+ }
add(*_widget);
show_all();
@@ -148,7 +151,14 @@ AutomationController::create(const Evoral::Parameter& param,
}
void
-AutomationController::display_effective_value()
+AutomationController::automation_state_changed ()
+{
+ bool x = _controllable->alist()->automation_state() & Play;
+ _widget->set_sensitive (!x);
+}
+
+void
+AutomationController::display_effective_value ()
{
double const interface_value = _controllable->internal_to_interface(_controllable->get_value());