mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
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
This commit is contained in:
parent
8d048aa472
commit
f33b1d1900
3 changed files with 29 additions and 4 deletions
|
|
@ -146,9 +146,10 @@ AutomationStreamView::set_automation_state (AutoState state)
|
||||||
std::list<RegionView *>::iterator i;
|
std::list<RegionView *>::iterator i;
|
||||||
for (i = region_views.begin(); i != region_views.end(); ++i) {
|
for (i = region_views.begin(); i != region_views.end(); ++i) {
|
||||||
boost::shared_ptr<AutomationLine> line = ((AutomationRegionView*)(*i))->line();
|
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);
|
line->the_list()->set_automation_state (state);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -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 ();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ class AutomationStreamView : public StreamView
|
||||||
~AutomationStreamView ();
|
~AutomationStreamView ();
|
||||||
|
|
||||||
void set_automation_state (ARDOUR::AutoState state);
|
void set_automation_state (ARDOUR::AutoState state);
|
||||||
|
ARDOUR::AutoState automation_state () const;
|
||||||
|
|
||||||
void redisplay_track ();
|
void redisplay_track ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -272,6 +272,11 @@ AutomationTimeAxisView::set_automation_state (AutoState state)
|
||||||
|
|
||||||
if (_view) {
|
if (_view) {
|
||||||
_view->set_automation_state (state);
|
_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 */
|
/* update button label */
|
||||||
|
|
||||||
if (!_line) {
|
if (_line) {
|
||||||
state = Off;
|
|
||||||
} else {
|
|
||||||
state = _control->alist()->automation_state ();
|
state = _control->alist()->automation_state ();
|
||||||
|
} else if (_view) {
|
||||||
|
state = _view->automation_state ();
|
||||||
|
} else {
|
||||||
|
state = Off;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (state & (Off|Play|Touch|Write)) {
|
switch (state & (Off|Play|Touch|Write)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue