Make Clear option work for MIDI automation tracks. Fixes part of #3137.
git-svn-id: svn://localhost/ardour2/branches/3.0@7523 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
1f07948972
commit
97c8ad6564
|
@ -1121,16 +1121,13 @@ AutomationLine::reset ()
|
|||
void
|
||||
AutomationLine::clear ()
|
||||
{
|
||||
/* parent must create command */
|
||||
/* parent must create and commit command */
|
||||
XMLNode &before = alist->get_state();
|
||||
alist->clear();
|
||||
|
||||
trackview.editor().session()->add_command (
|
||||
new MementoCommand<AutomationList> (memento_command_binder (), &before, &alist->get_state())
|
||||
);
|
||||
|
||||
trackview.editor().session()->commit_reversible_command ();
|
||||
trackview.editor().session()->set_dirty ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -64,7 +64,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible
|
|||
|
||||
void queue_reset ();
|
||||
void reset ();
|
||||
void clear();
|
||||
void clear ();
|
||||
|
||||
std::list<ControlPoint*> point_selection_to_control_points (PointSelection const &);
|
||||
void set_selected_points (PointSelection&);
|
||||
|
|
|
@ -262,3 +262,14 @@ AutomationStreamView::interpolation () const
|
|||
|
||||
return v->line()->the_list()->interpolation ();
|
||||
}
|
||||
|
||||
/** Clear all automation displayed in this view */
|
||||
void
|
||||
AutomationStreamView::clear ()
|
||||
{
|
||||
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
AutomationRegionView* arv = dynamic_cast<AutomationRegionView*> (*i);
|
||||
assert (arv);
|
||||
arv->line()->clear ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,6 +59,8 @@ class AutomationStreamView : public StreamView
|
|||
void set_interpolation (ARDOUR::AutomationList::InterpolationStyle);
|
||||
ARDOUR::AutomationList::InterpolationStyle interpolation () const;
|
||||
|
||||
void clear ();
|
||||
|
||||
private:
|
||||
void setup_rec_box ();
|
||||
|
||||
|
|
|
@ -379,10 +379,18 @@ AutomationTimeAxisView::set_interpolation (AutomationList::InterpolationStyle st
|
|||
void
|
||||
AutomationTimeAxisView::clear_clicked ()
|
||||
{
|
||||
assert (_line || _view);
|
||||
|
||||
_session->begin_reversible_command (_("clear automation"));
|
||||
|
||||
if (_line) {
|
||||
_session->begin_reversible_command (_("clear automation"));
|
||||
_line->clear ();
|
||||
} else if (_view) {
|
||||
_view->clear ();
|
||||
}
|
||||
|
||||
_session->commit_reversible_command ();
|
||||
_session->set_dirty ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue
Block a user