From f33b1d1900fb269d466eda1ed15faf8d0c578239 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 22 May 2010 01:33:13 +0000 Subject: Handle automation modes better with region-based (MIDI) automation. Should fix #3135. git-svn-id: svn://localhost/ardour2/branches/3.0@7138 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/automation_streamview.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/automation_streamview.cc') diff --git a/gtk2_ardour/automation_streamview.cc b/gtk2_ardour/automation_streamview.cc index e861522fd7..4177e729fe 100644 --- a/gtk2_ardour/automation_streamview.cc +++ b/gtk2_ardour/automation_streamview.cc @@ -146,8 +146,9 @@ AutomationStreamView::set_automation_state (AutoState state) std::list::iterator i; for (i = region_views.begin(); i != region_views.end(); ++i) { boost::shared_ptr line = ((AutomationRegionView*)(*i))->line(); - if (line && line->the_list()) + if (line && line->the_list()) { line->the_list()->set_automation_state (state); + } } } @@ -191,3 +192,19 @@ AutomationStreamView::color_handler () }*/ } +AutoState +AutomationStreamView::automation_state () const +{ + /* XXX: bit of a hack: just return the state of our first RegionView */ + + if (region_views.empty()) { + return Off; + } + + boost::shared_ptr line = ((AutomationRegionView*) region_views.front())->line (); + if (!line || !line->the_list()) { + return Off; + } + + return line->the_list()->automation_state (); +} -- cgit v1.2.3