edit_items.push_back (MenuElem (_("Bounce Range to Region List With Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, true)));
edit_items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_selection)));
if (ARDOUR_UI::instance()->video_timeline->get_duration() > 0) {
- edit_items.push_back (MenuElem (_("Export Video Range..."), sigc::bind (sigc::mem_fun(*this, &Editor::export_video), true)));
+ edit_items.push_back (MenuElem (_("Export Video Range..."), sigc::bind (sigc::mem_fun(*(ARDOUR_UI::instance()), &ARDOUR_UI::export_video), true)));
}
}
{
selection_op_cmd_depth = 0;
selection_op_history_it = 0;
- selection_op_history.clear();
+
+ while(!selection_op_history.empty()) {
+ delete selection_op_history.front();
+ selection_op_history.pop_front();
+ }
+
selection_undo_action->set_sensitive (false);
selection_redo_action->set_sensitive (false);
selection_op_history.push_front (&_selection_memento->get_state ());
if (selection_op_cmd_depth == 1) {
if (selection_op_history_it > 0 && selection_op_history_it < selection_op_history.size()) {
- /* the user has undone some selection ops and then made a new one */
+ /**
+ The user has undone some selection ops and then made a new one,
+ making anything earlier in the list invalid.
+ */
+
list<XMLNode *>::iterator it = selection_op_history.begin();
- advance (it, selection_op_history_it);
- selection_op_history.erase (selection_op_history.begin(), it);
+ list<XMLNode *>::iterator e_it = it;
+ advance (e_it, selection_op_history_it);
+
+ for ( ; it != e_it; ++it) {
+ delete *it;
+ }
+ selection_op_history.erase (selection_op_history.begin(), e_it);
}
selection_op_history.push_front (&_selection_memento->get_state ());
}
}
+void
+Editor::abort_reversible_command ()
+{
+ if (_session) {
+ while(!before.empty()) {
+ delete before.front();
+ before.pop_front();
+ }
+ _session->abort_reversible_command ();
+ }
+}
+
void
Editor::commit_reversible_command ()
{
if (_session) {
if (before.size() == 1) {
_session->add_command (new MementoCommand<SelectionMemento>(*(_selection_memento), before.front(), &_selection_memento->get_state ()));
+ redo_action->set_sensitive(false);
undo_action->set_sensitive(true);
begin_selection_op_history ();
}
RouteTimeAxisView *rtv;
list<RouteTimeAxisView*> new_views;
+ TrackViewList new_selection;
+ bool from_scratch = (track_views.size() == 0);
for (RouteList::iterator x = routes.begin(); x != routes.end(); ++x) {
boost::shared_ptr<Route> route = (*x);
new_views.push_back (rtv);
track_views.push_back (rtv);
+ new_selection.push_back (rtv);
rtv->effective_gain_display ();
_summary->routes_added (new_views);
}
+ if (!from_scratch) {
+ selection->tracks.clear();
+ selection->add (new_selection);
+ begin_selection_op_history();
+ }
+
if (show_editor_mixer_when_tracks_arrive) {
show_editor_mixer (true);
}