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);
+ }
}
}
}*/
}
+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 ();
+}
if (_view) {
_view->set_automation_state (state);
+
+ /* AutomationStreamViews don't signal when their automation state changes, so handle
+ our updates `manually'.
+ */
+ 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)) {