summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/automation_streamview.cc19
-rw-r--r--gtk2_ardour/automation_streamview.h1
-rw-r--r--gtk2_ardour/automation_time_axis.cc13
3 files changed, 29 insertions, 4 deletions
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<RegionView *>::iterator i;
for (i = region_views.begin(); i != region_views.end(); ++i) {
boost::shared_ptr<AutomationLine> 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<AutomationLine> line = ((AutomationRegionView*) region_views.front())->line ();
+ if (!line || !line->the_list()) {
+ return Off;
+ }
+
+ return line->the_list()->automation_state ();
+}
diff --git a/gtk2_ardour/automation_streamview.h b/gtk2_ardour/automation_streamview.h
index 37f13774a4..9a40629438 100644
--- a/gtk2_ardour/automation_streamview.h
+++ b/gtk2_ardour/automation_streamview.h
@@ -46,6 +46,7 @@ class AutomationStreamView : public StreamView
~AutomationStreamView ();
void set_automation_state (ARDOUR::AutoState state);
+ ARDOUR::AutoState automation_state () const;
void redisplay_track ();
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index d2b43d33f9..35af325357 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -272,6 +272,11 @@ AutomationTimeAxisView::set_automation_state (AutoState state)
if (_view) {
_view->set_automation_state (state);
+
+ /* AutomationStreamViews don't signal when their automation state changes, so handle
+ our updates `manually'.
+ */
+ automation_state_changed ();
}
}
@@ -282,10 +287,12 @@ AutomationTimeAxisView::automation_state_changed ()
/* update button label */
- if (!_line) {
- state = Off;
- } else {
+ if (_line) {
state = _control->alist()->automation_state ();
+ } else if (_view) {
+ state = _view->automation_state ();
+ } else {
+ state = Off;
}
switch (state & (Off|Play|Touch|Write)) {