From ecb0cd5d119d28092a8f48e4521ac5eba197bb54 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 25 Jun 2010 20:47:09 +0000 Subject: Make MIDI region `automation' respect the automation mode so that it is only played back if the automation mode is set to "Play". Munge AutoState for AutomationRegionViews so that they reflect their AutomationTimeAxisView's setting. Fixes #3135. git-svn-id: svn://localhost/ardour2/branches/3.0@7304 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/automatable.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libs/ardour/automatable.cc') diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index 3d705b3ea7..1e5b497bf7 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -150,6 +150,16 @@ Automatable::add_control(boost::shared_ptr ac) ControlSet::add_control(ac); _can_automate_list.insert(param); auto_state_changed(param); // sync everything up + + /* connect to automation_state_changed so that we can emit a signal when one of our controls' + automation state changes + */ + boost::shared_ptr c = boost::dynamic_pointer_cast (ac); + if (c) { + c->alist()->automation_state_changed.connect_same_thread ( + _control_connections, boost::bind (&Automatable::automation_state_changed, this, c->parameter()) + ); + } } void @@ -469,3 +479,8 @@ Automatable::automation_control (const Evoral::Parameter& id) const return boost::dynamic_pointer_cast(Evoral::ControlSet::control(id)); } +void +Automatable::automation_state_changed (Evoral::Parameter const & p) +{ + AutomationStateChanged (p); /* EMIT SIGNAL */ +} -- cgit v1.2.3