summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorHans Fugal <hans@fugal.net>2006-08-12 22:00:34 +0000
committerHans Fugal <hans@fugal.net>2006-08-12 22:00:34 +0000
commit37bfd8900c82702d1cb6f2caa3eb753f30a62372 (patch)
treec98e7ac4880064d772c179749df636fd548bebfe /gtk2_ardour
parent66054fe5d61a225c1af03e514c23b5e1a5dbc547 (diff)
parent57f7f71ce3c1acae5a50e903d2dd472743df8043 (diff)
r257@gwythaint (orig r797): fugalh | 2006-08-12 15:49:20 -0600
r316@gandalf: fugalh | 2006-08-11 17:06:48 -0600 Reconstitution. Comiples, untested. git-svn-id: svn://localhost/ardour2/trunk@803 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.cc1
-rw-r--r--gtk2_ardour/audio_region_view.cc4
-rw-r--r--gtk2_ardour/automation_line.cc11
-rw-r--r--gtk2_ardour/automation_time_axis.cc12
-rw-r--r--gtk2_ardour/editor.cc6
-rw-r--r--gtk2_ardour/editor_audio_import.cc2
-rw-r--r--gtk2_ardour/editor_keyboard.cc2
-rw-r--r--gtk2_ardour/editor_markers.cc14
-rw-r--r--gtk2_ardour/editor_mouse.cc48
-rw-r--r--gtk2_ardour/editor_ops.cc76
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc12
-rw-r--r--gtk2_ardour/editor_timefx.cc2
-rw-r--r--gtk2_ardour/gain_automation_time_axis.cc2
-rw-r--r--gtk2_ardour/location_ui.cc6
-rw-r--r--gtk2_ardour/pan_automation_time_axis.cc2
-rw-r--r--gtk2_ardour/redirect_automation_time_axis.cc2
-rw-r--r--gtk2_ardour/region_gain_line.cc8
-rw-r--r--gtk2_ardour/route_time_axis.cc6
-rw-r--r--gtk2_ardour/route_ui.cc4
19 files changed, 114 insertions, 106 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 12c2d63b80..8a75396ed2 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -1488,6 +1488,7 @@ ARDOUR_UI::restore_state (string name)
name = session->name();
}
session->restore_state (name);
+ session->restore_history (name);
}
}
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index bdea3d39a2..915fa05750 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -906,13 +906,13 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
XMLNode &before = audio_region().get_state();
audio_region().set_envelope_active(true);
XMLNode &after = audio_region().get_state();
- trackview.session().add_command (new MementoCommand<AudioRegion>(audio_region(), before, after));
+ trackview.session().add_command (new MementoCommand<AudioRegion>(audio_region(), &before, &after));
}
audio_region().envelope().add (fx, y);
XMLNode &after = audio_region().envelope().get_state();
- trackview.session().add_command (new MementoCommand<Curve>(audio_region().envelope(), before, after));
+ trackview.session().add_command (new MementoCommand<Curve>(audio_region().envelope(), &before, &after));
trackview.session().commit_reversible_command ();
}
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index f3e30c4523..c0ba957af8 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -244,6 +244,9 @@ AutomationLine::AutomationLine (const string & name, TimeAxisView& tv, ArdourCan
line->signal_event().connect (mem_fun (*this, &AutomationLine::event_handler));
alist.StateChanged.connect (mem_fun(*this, &AutomationLine::list_changed));
+
+ trackview.session().register_with_memento_command_factory(_id, this);
+
}
AutomationLine::~AutomationLine ()
@@ -888,7 +891,7 @@ AutomationLine::start_drag (ControlPoint* cp, float fraction)
}
trackview.editor.current_session()->begin_reversible_command (str);
- trackview.editor.current_session()->add_command (new MementoUndoCommand<AutomationLine>(*this, get_state()));
+ trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, &get_state(), 0));
first_drag_fraction = fraction;
last_drag_fraction = fraction;
@@ -937,7 +940,7 @@ AutomationLine::end_drag (ControlPoint* cp)
update_pending = false;
- trackview.editor.current_session()->add_command (new MementoRedoCommand<AutomationLine>(*this, get_state()));
+ trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, 0, &get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}
@@ -1018,7 +1021,7 @@ AutomationLine::remove_point (ControlPoint& cp)
alist.erase (mr.start, mr.end);
- trackview.editor.current_session()->add_command(new MementoCommand<AutomationLine>(*this, before, get_state()));
+ trackview.editor.current_session()->add_command(new MementoCommand<AutomationLine>(*this, &before, &get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}
@@ -1228,7 +1231,7 @@ AutomationLine::clear ()
/* parent must create command */
XMLNode &before = get_state();
alist.clear();
- trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, before, get_state()));
+ trackview.editor.current_session()->add_command (new MementoCommand<AutomationLine>(*this, &before, &get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index 7025a11178..80ed2acd16 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -482,7 +482,7 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
case Cut:
if ((what_we_got = alist.cut (selection.time.front().start, selection.time.front().end)) != 0) {
editor.get_cut_buffer().add (what_we_got);
- _session.add_command(new MementoCommand<AutomationList>(alist, before, alist.get_state()));
+ _session.add_command(new MementoCommand<AutomationList>(alist, &before, &alist.get_state()));
ret = true;
}
break;
@@ -494,7 +494,7 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
case Clear:
if ((what_we_got = alist.cut (selection.time.front().start, selection.time.front().end)) != 0) {
- _session.add_command(new MementoCommand<AutomationList>(alist, before, alist.get_state()));
+ _session.add_command(new MementoCommand<AutomationList>(alist, &before, &alist.get_state()));
delete what_we_got;
what_we_got = 0;
ret = true;
@@ -526,7 +526,7 @@ AutomationTimeAxisView::reset_objects_one (AutomationLine& line, PointSelection&
{
AutomationList& alist (line.the_list());
- _session.add_command (new MementoUndoCommand<AutomationList>(alist, alist.get_state()));
+ _session.add_command (new MementoCommand<AutomationList>(alist, &alist.get_state(), 0));
for (PointSelection::iterator i = selection.begin(); i != selection.end(); ++i) {
@@ -569,7 +569,7 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS
case Cut:
if ((what_we_got = alist.cut ((*i).start, (*i).end)) != 0) {
editor.get_cut_buffer().add (what_we_got);
- _session.add_command (new MementoCommand<AutomationList>(alist, before, alist.get_state()));
+ _session.add_command (new MementoCommand<AutomationList>(alist, &before, &alist.get_state()));
ret = true;
}
break;
@@ -581,7 +581,7 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS
case Clear:
if ((what_we_got = alist.cut ((*i).start, (*i).end)) != 0) {
- _session.add_command (new MementoCommand<AutomationList>(alist, before, alist.get_state()));
+ _session.add_command (new MementoCommand<AutomationList>(alist, &before, &alist.get_state()));
delete what_we_got;
what_we_got = 0;
ret = true;
@@ -640,7 +640,7 @@ AutomationTimeAxisView::paste_one (AutomationLine& line, jack_nframes_t pos, flo
XMLNode &before = alist.get_state();
alist.paste (copy, pos, times);
- _session.add_command (new MementoCommand<AutomationList>(alist, before, alist.get_state()));
+ _session.add_command (new MementoCommand<AutomationList>(alist, &before, &alist.get_state()));
return true;
}
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 513251085c..74822fc7ea 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -705,6 +705,7 @@ Editor::Editor (AudioEngine& eng)
ControlProtocol::ScrollTimeline.connect (mem_fun (*this, &Editor::control_scroll));
constructed = true;
instant_save ();
+
}
Editor::~Editor()
@@ -1339,6 +1340,9 @@ Editor::connect_to_session (Session *t)
no_route_list_redisplay = false;
redisplay_route_list ();
}
+
+ /* register for undo history */
+ session->register_with_memento_command_factory(_id, this);
}
void
@@ -2888,7 +2892,7 @@ void
Editor::commit_reversible_command ()
{
if (session) {
- session->commit_reversible_command (new MementoCommand<Editor>(*this, *before, get_state()));
+ session->commit_reversible_command (new MementoCommand<Editor>(*this, before, &get_state()));
}
}
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc
index 7524f9605c..8887135374 100644
--- a/gtk2_ardour/editor_audio_import.cc
+++ b/gtk2_ardour/editor_audio_import.cc
@@ -323,7 +323,7 @@ Editor::finish_bringing_in_audio (AudioRegion& region, uint32_t in_chans, uint32
begin_reversible_command (_("insert sndfile"));
XMLNode &before = playlist->get_state();
playlist->add_region (*copy, pos);
- session->add_command (new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+ session->add_command (new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
commit_reversible_command ();
pos += region.length();
diff --git a/gtk2_ardour/editor_keyboard.cc b/gtk2_ardour/editor_keyboard.cc
index f48d860d15..95289c7f5a 100644
--- a/gtk2_ardour/editor_keyboard.cc
+++ b/gtk2_ardour/editor_keyboard.cc
@@ -108,7 +108,7 @@ Editor::kbd_mute_unmute_region ()
entered_regionview->region().set_muted (!entered_regionview->region().muted());
XMLNode &after = entered_regionview->region().playlist()->get_state();
- session->add_command (new MementoCommand<ARDOUR::Playlist>(*(entered_regionview->region().playlist()), before, after));
+ session->add_command (new MementoCommand<ARDOUR::Playlist>(*(entered_regionview->region().playlist()), &before, &after));
commit_reversible_command();
}
}
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index ccc1415888..40f00c2e10 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -294,7 +294,7 @@ Editor::mouse_add_new_marker (jack_nframes_t where)
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
XMLNode &after = session->locations()->get_state();
- session->add_command (new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
}
}
@@ -334,7 +334,7 @@ Editor::really_remove_marker (Location* loc)
XMLNode &before = session->locations()->get_state();
session->locations()->remove (loc);
XMLNode &after = session->locations()->get_state();
- session->add_command (new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
return FALSE;
}
@@ -847,7 +847,7 @@ Editor::marker_menu_rename ()
loc->set_name (txt);
XMLNode &after = session->locations()->get_state();
- session->add_command (new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
commit_reversible_command ();
}
@@ -876,14 +876,14 @@ Editor::new_transport_marker_menu_set_loop ()
session->locations()->add (loc, true);
session->set_auto_loop_location (loc);
XMLNode &after = session->locations()->get_state();
- session->add_command (new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
}
else {
XMLNode &before = tll->get_state();
tll->set_hidden (false, this);
tll->set (temp_location->start(), temp_location->end());
XMLNode &after = tll->get_state();
- session->add_command (new MementoCommand<Location>(*tll, before, after));
+ session->add_command (new MementoCommand<Location>(*tll, &before, &after));
}
commit_reversible_command ();
@@ -904,13 +904,13 @@ Editor::new_transport_marker_menu_set_punch ()
session->locations()->add (tpl, true);
session->set_auto_punch_location (tpl);
XMLNode &after = session->locations()->get_state();
- session->add_command (new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
} else {
XMLNode &before = tpl->get_state();
tpl->set_hidden(false, this);
tpl->set(temp_location->start(), temp_location->end());
XMLNode &after = tpl->get_state();
- session->add_command (new MementoCommand<Location>(*tpl, before, after));
+ session->add_command (new MementoCommand<Location>(*tpl, &before, &after));
}
commit_reversible_command ();
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 18c7f0727d..db42e0c414 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -1824,8 +1824,8 @@ Editor::fade_in_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* even
XMLNode &after = arv->audio_region().get_state();
session->add_command(new MementoCommand<ARDOUR::AudioRegion>(arv->audio_region(),
- before,
- after));
+ &before,
+ &after));
commit_reversible_command ();
fade_in_drag_motion_callback (item, event);
}
@@ -1920,7 +1920,7 @@ Editor::fade_out_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* eve
arv->audio_region().set_fade_out_length (fade_length);
XMLNode &after = arv->region().get_state();
- session->add_command(new MementoCommand<ARDOUR::Region>(arv->region(), before, after));
+ session->add_command(new MementoCommand<ARDOUR::Region>(arv->region(), &before, &after));
commit_reversible_command ();
fade_out_drag_motion_callback (item, event);
@@ -2175,7 +2175,7 @@ Editor::marker_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
}
XMLNode &after = session->locations()->get_state();
- session->add_command(new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
commit_reversible_command ();
marker_drag_line->hide();
@@ -2292,7 +2292,7 @@ Editor::meter_marker_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent*
XMLNode &before = map.get_state();
map.add_meter (marker->meter(), when);
XMLNode &after = map.get_state();
- session->add_command(new MementoCommand<TempoMap>(map, before, after));
+ session->add_command(new MementoCommand<TempoMap>(map, &before, &after));
commit_reversible_command ();
// delete the dummy marker we used for visual representation of copying.
@@ -2303,7 +2303,7 @@ Editor::meter_marker_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent*
XMLNode &before = map.get_state();
map.move_meter (marker->meter(), when);
XMLNode &after = map.get_state();
- session->add_command(new MementoCommand<TempoMap>(map, before, after));
+ session->add_command(new MementoCommand<TempoMap>(map, &before, &after));
commit_reversible_command ();
}
}
@@ -2424,7 +2424,7 @@ Editor::tempo_marker_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent*
XMLNode &before = map.get_state();
map.add_tempo (marker->tempo(), when);
XMLNode &after = map.get_state();
- session->add_command (new MementoCommand<TempoMap>(map, before, after));
+ session->add_command (new MementoCommand<TempoMap>(map, &before, &after));
commit_reversible_command ();
// delete the dummy marker we used for visual representation of copying.
@@ -2435,7 +2435,7 @@ Editor::tempo_marker_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent*
XMLNode &before = map.get_state();
map.move_tempo (marker->tempo(), when);
XMLNode &after = map.get_state();
- session->add_command (new MementoCommand<TempoMap>(map, before, after));
+ session->add_command (new MementoCommand<TempoMap>(map, &before, &after));
commit_reversible_command ();
}
}
@@ -2799,7 +2799,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
insert_result = affected_playlists.insert (to_playlist);
if (insert_result.second) {
- session->add_command (new MementoUndoCommand<Playlist>(*to_playlist, to_playlist->get_state()));
+ session->add_command (new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0));
}
latest_regionview = 0;
@@ -3235,7 +3235,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
insert_result = motion_frozen_playlists.insert (pl);
if (insert_result.second) {
pl->freeze();
- session->add_command(new MementoUndoCommand<Playlist>(*pl, pl->get_state()));
+ session->add_command(new MementoCommand<Playlist>(*pl, &pl->get_state(), 0));
}
}
}
@@ -3363,7 +3363,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
insert_result = motion_frozen_playlists.insert(to_playlist);
if (insert_result.second) {
to_playlist->freeze();
- session->add_command(new MementoUndoCommand<Playlist>(*to_playlist, to_playlist->get_state()));
+ session->add_command(new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0));
}
}
@@ -3445,7 +3445,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
out:
for (set<Playlist*>::iterator p = motion_frozen_playlists.begin(); p != motion_frozen_playlists.end(); ++p) {
(*p)->thaw ();
- session->add_command (new MementoRedoCommand<Playlist>(*(*p), (*p)->get_state()));
+ session->add_command (new MementoCommand<Playlist>(*(*p), 0, & (*p)->get_state()));
}
motion_frozen_playlists.clear ();
@@ -3640,10 +3640,10 @@ Editor::start_selection_grab (ArdourCanvas::Item* item, GdkEvent* event)
Playlist* playlist = clicked_trackview->playlist();
- before = &(playlist->get_state());
+ XMLNode *before = &(playlist->get_state());
clicked_trackview->playlist()->add_region (*region, selection->time[clicked_selection].start);
- XMLNode &after = playlist->get_state();
- session->add_command(new MementoCommand<Playlist>(*playlist, *before, after));
+ XMLNode *after = &(playlist->get_state());
+ session->add_command(new MementoCommand<Playlist>(*playlist, before, after));
commit_reversible_command ();
@@ -4010,7 +4010,7 @@ Editor::trim_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
Playlist * pl = (*i)->region().playlist();
insert_result = motion_frozen_playlists.insert (pl);
if (insert_result.second) {
- session->add_command(new MementoUndoCommand<Playlist>(*pl, pl->get_state()));
+ session->add_command(new MementoCommand<Playlist>(*pl, &pl->get_state(), 0));
}
}
}
@@ -4200,7 +4200,7 @@ Editor::trim_finished_callback (ArdourCanvas::Item* item, GdkEvent* event)
for (set<Playlist*>::iterator p = motion_frozen_playlists.begin(); p != motion_frozen_playlists.end(); ++p) {
//(*p)->thaw ();
- session->add_command (new MementoRedoCommand<Playlist>(*(*p), (*p)->get_state()));
+ session->add_command (new MementoCommand<Playlist>(*(*p), 0, &(*p)->get_state()));
}
motion_frozen_playlists.clear ();
@@ -4238,7 +4238,7 @@ Editor::point_trim (GdkEvent* event)
XMLNode &before = pl->get_state();
(*i)->region().trim_front (new_bound, this);
XMLNode &after = pl->get_state();
- session->add_command(new MementoCommand<Playlist>(*pl, before, after));
+ session->add_command(new MementoCommand<Playlist>(*pl, &before, &after));
}
}
@@ -4249,7 +4249,7 @@ Editor::point_trim (GdkEvent* event)
XMLNode &before = pl->get_state();
rv->region().trim_front (new_bound, this);
XMLNode &after = pl->get_state();
- session->add_command(new MementoCommand<Playlist>(*pl, before, after));
+ session->add_command(new MementoCommand<Playlist>(*pl, &before, &after));
}
}
@@ -4269,7 +4269,7 @@ Editor::point_trim (GdkEvent* event)
XMLNode &before = pl->get_state();
(*i)->region().trim_end (new_bound, this);
XMLNode &after = pl->get_state();
- session->add_command(new MementoCommand<Playlist>(*pl, before, after));
+ session->add_command(new MementoCommand<Playlist>(*pl, &before, &after));
}
}
@@ -4280,7 +4280,7 @@ Editor::point_trim (GdkEvent* event)
XMLNode &before = pl->get_state();
rv->region().trim_end (new_bound, this);
XMLNode &after = pl->get_state();
- session->add_command (new MementoCommand<Playlist>(*pl, before, after));
+ session->add_command (new MementoCommand<Playlist>(*pl, &before, &after));
}
}
@@ -4303,7 +4303,7 @@ Editor::thaw_region_after_trim (RegionView& rv)
region.thaw (_("trimmed region"));
XMLNode &after = region.playlist()->get_state();
- session->add_command (new MementoRedoCommand<Playlist>(*(region.playlist()), after));
+ session->add_command (new MementoCommand<Playlist>(*(region.playlist()), 0, &after));
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(&rv);
if (arv)
@@ -4448,7 +4448,7 @@ Editor::end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
newloc = new Location(temp_location->start(), temp_location->end(), "unnamed", Location::IsRangeMarker);
session->locations()->add (newloc, true);
XMLNode &after = session->locations()->get_state();
- session->add_command(new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
commit_reversible_command ();
range_bar_drag_rect->hide();
@@ -4831,7 +4831,7 @@ Editor::mouse_brush_insert_region (RegionView* rv, jack_nframes_t pos)
XMLNode &before = playlist->get_state();
playlist->add_region (*(new AudioRegion (arv->audio_region())), (jack_nframes_t) (pos * speed));
XMLNode &after = playlist->get_state();
- session->add_command(new MementoCommand<Playlist>(*playlist, before, after));
+ session->add_command(new MementoCommand<Playlist>(*playlist, &before, &after));
// playlist is frozen, so we have to update manually
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 1e5f336e52..55a863c6e3 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -213,7 +213,7 @@ Editor::split_regions_at (jack_nframes_t where, RegionSelection& regions)
XMLNode &before = pl->get_state();
pl->split_region ((*a)->region(), where);
XMLNode &after = pl->get_state();
- session->add_command(new MementoCommand<Playlist>(*pl, before, after));
+ session->add_command(new MementoCommand<Playlist>(*pl, &before, &after));
}
a = tmp;
@@ -236,7 +236,7 @@ Editor::remove_clicked_region ()
XMLNode &before = playlist->get_state();
playlist->remove_region (&clicked_regionview->region());
XMLNode &after = playlist->get_state();
- session->add_command(new MementoCommand<Playlist>(*playlist, before, after));
+ session->add_command(new MementoCommand<Playlist>(*playlist, &before, &after));
commit_reversible_command ();
}
@@ -412,7 +412,7 @@ Editor::nudge_forward (bool next)
XMLNode &before = r.playlist()->get_state();
r.set_position (r.position() + distance, this);
XMLNode &after = r.playlist()->get_state();
- session->add_command (new MementoCommand<Playlist>(*(r.playlist()), before, after));
+ session->add_command (new MementoCommand<Playlist>(*(r.playlist()), &before, &after));
}
commit_reversible_command ();
@@ -452,7 +452,7 @@ Editor::nudge_backward (bool next)
r.set_position (0, this);
}
XMLNode &after = r.playlist()->get_state();
- session->add_command(new MementoCommand<Playlist>(*(r.playlist()), before, after));
+ session->add_command(new MementoCommand<Playlist>(*(r.playlist()), &before, &after));
}
commit_reversible_command ();
@@ -488,7 +488,7 @@ Editor::nudge_forward_capture_offset ()
XMLNode &before = r.playlist()->get_state();
r.set_position (r.position() + distance, this);
XMLNode &after = r.playlist()->get_state();
- session->add_command(new MementoCommand<Playlist>(*(r.playlist()), before, after));
+ session->add_command(new MementoCommand<Playlist>(*(r.playlist()), &before, &after));
}
commit_reversible_command ();
@@ -520,7 +520,7 @@ Editor::nudge_backward_capture_offset ()
r.set_position (0, this);
}
XMLNode &after = r.playlist()->get_state();
- session->add_command(new MementoCommand<Playlist>(*(r.playlist()), before, after));
+ session->add_command(new MementoCommand<Playlist>(*(r.playlist()), &before, &after));
}
commit_reversible_command ();
@@ -1300,7 +1300,7 @@ Editor::add_location_from_selection ()
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
XMLNode &after = session->locations()->get_state();
- session->add_command(new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
}
@@ -1314,7 +1314,7 @@ Editor::add_location_from_playhead_cursor ()
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
XMLNode &after = session->locations()->get_state();
- session->add_command(new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
}
@@ -1333,7 +1333,7 @@ Editor::add_location_from_audio_region ()
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
XMLNode &after = session->locations()->get_state();
- session->add_command(new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
}
@@ -1752,7 +1752,7 @@ Editor::clear_markers ()
XMLNode &before = session->locations()->get_state();
session->locations()->clear_markers ();
XMLNode &after = session->locations()->get_state();
- session->add_command(new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
}
}
@@ -1773,7 +1773,7 @@ Editor::clear_ranges ()
if (punchloc) session->locations()->add (punchloc);
XMLNode &after = session->locations()->get_state();
- session->add_command(new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
}
}
@@ -1785,7 +1785,7 @@ Editor::clear_locations ()
XMLNode &before = session->locations()->get_state();
session->locations()->clear ();
XMLNode &after = session->locations()->get_state();
- session->add_command(new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
session->locations()->clear ();
}
@@ -1835,7 +1835,7 @@ Editor::insert_region_list_drag (AudioRegion& region, int x, int y)
begin_reversible_command (_("insert dragged region"));
XMLNode &before = playlist->get_state();
playlist->add_region (*(new AudioRegion (region)), where, 1.0);
- session->add_command(new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+ session->add_command(new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
commit_reversible_command ();
}
@@ -1871,7 +1871,7 @@ Editor::insert_region_list_selection (float times)
begin_reversible_command (_("insert region"));
XMLNode &before = playlist->get_state();
playlist->add_region (*(createRegion (*region)), edit_cursor->current_frame, times);
- session->add_command(new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+ session->add_command(new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
commit_reversible_command ();
}
@@ -2308,7 +2308,7 @@ Editor::separate_region_from_selection ()
}
if (doing_undo)
- session->add_command(new MementoCommand<Playlist>(*playlist, *before, playlist->get_state()));
+ session->add_command(new MementoCommand<Playlist>(*playlist, before, &playlist->get_state()));
}
}
}
@@ -2359,7 +2359,7 @@ Editor::separate_regions_using_location (Location& loc)
playlist->partition ((jack_nframes_t)(loc.start() * speed), (jack_nframes_t)(loc.end() * speed), true);
if (doing_undo)
- session->add_command(new MementoCommand<Playlist>(*playlist, *before, playlist->get_state()));
+ session->add_command(new MementoCommand<Playlist>(*playlist, before, &playlist->get_state()));
}
}
}
@@ -2433,7 +2433,7 @@ Editor::crop_region_to_selection ()
XMLNode &before = (*i)->get_state();
region->trim_to (start, cnt, this);
XMLNode &after = (*i)->get_state();
- session->add_command (new MementoCommand<Playlist>(*(*i), before, after));
+ session->add_command (new MementoCommand<Playlist>(*(*i), &before, &after));
}
commit_reversible_command ();
@@ -2476,7 +2476,7 @@ Editor::region_fill_track ()
XMLNode &before = pl->get_state();
pl->add_region (*(new AudioRegion (*ar)), ar->last_frame(), times);
- session->add_command (new MementoCommand<Playlist>(*pl, before, pl->get_state()));
+ session->add_command (new MementoCommand<Playlist>(*pl, &before, &pl->get_state()));
}
commit_reversible_command ();
@@ -2526,7 +2526,7 @@ Editor::region_fill_selection ()
XMLNode &before = playlist->get_state();
playlist->add_region (*(createRegion (*region)), start, times);
- session->add_command (new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+ session->add_command (new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
}
commit_reversible_command ();
@@ -2544,7 +2544,7 @@ Editor::set_a_regions_sync_position (Region& region, jack_nframes_t position)
XMLNode &before = region.playlist()->get_state();
region.set_sync_position (position);
XMLNode &after = region.playlist()->get_state();
- session->add_command(new MementoCommand<Playlist>(*(region.playlist()), before, after));
+ session->add_command(new MementoCommand<Playlist>(*(region.playlist()), &before, &after));
commit_reversible_command ();
}
@@ -2565,7 +2565,7 @@ Editor::set_region_sync_from_edit_cursor ()
XMLNode &before = region.playlist()->get_state();
region.set_sync_position (edit_cursor->current_frame);
XMLNode &after = region.playlist()->get_state();
- session->add_command(new MementoCommand<Playlist>(*(region.playlist()), before, after));
+ session->add_command(new MementoCommand<Playlist>(*(region.playlist()), &before, &after));
commit_reversible_command ();
}
@@ -2578,7 +2578,7 @@ Editor::remove_region_sync ()
XMLNode &before = region.playlist()->get_state();
region.clear_sync_position ();
XMLNode &after = region.playlist()->get_state();
- session->add_command(new MementoCommand<Playlist>(*(region.playlist()), before, after));
+ session->add_command(new MementoCommand<Playlist>(*(region.playlist()), &before, &after));
commit_reversible_command ();
}
}
@@ -2594,7 +2594,7 @@ Editor::naturalize ()
XMLNode &before = (*i)->region().get_state();
(*i)->region().move_to_natural_position (this);
XMLNode &after = (*i)->region().get_state();
- session->add_command (new MementoCommand<Region>((*i)->region(), before, after));
+ session->add_command (new MementoCommand<Region>((*i)->region(), &before, &after));
}
commit_reversible_command ();
}
@@ -2669,7 +2669,7 @@ Editor::align_selection_relative (RegionPoint point, jack_nframes_t position)
}
XMLNode &after = region.playlist()->get_state();
- session->add_command(new MementoCommand<Playlist>(*(region.playlist()), before, after));
+ session->add_command(new MementoCommand<Playlist>(*(region.playlist()), &before, &after));
}
@@ -2722,7 +2722,7 @@ Editor::align_region_internal (Region& region, RegionPoint point, jack_nframes_t
}
XMLNode &after = region.playlist()->get_state();
- session->add_command(new MementoCommand<Playlist>(*(region.playlist()), before, after));
+ session->add_command(new MementoCommand<Playlist>(*(region.playlist()), &before, &after));
}
void
@@ -2747,7 +2747,7 @@ Editor::trim_region_to_edit_cursor ()
XMLNode &before = region.playlist()->get_state();
region.trim_end( session_frame_to_track_frame(edit_cursor->current_frame, speed), this);
XMLNode &after = region.playlist()->get_state();
- session->add_command(new MementoCommand<Playlist>(*(region.playlist()), before, after));
+ session->add_command(new MementoCommand<Playlist>(*(region.playlist()), &before, &after));
commit_reversible_command ();
}
@@ -2773,7 +2773,7 @@ Editor::trim_region_from_edit_cursor ()
XMLNode &before = region.playlist()->get_state();
region.trim_front ( session_frame_to_track_frame(edit_cursor->current_frame, speed), this);
XMLNode &after = region.playlist()->get_state();
- session->add_command(new MementoCommand<Playlist>(*(region.playlist()), before, after));
+ session->add_command(new MementoCommand<Playlist>(*(region.playlist()), &before, &after));
commit_reversible_command ();
}
@@ -2888,7 +2888,7 @@ Editor::bounce_range_selection ()
XMLNode &before = playlist->get_state();
atv->audio_track()->bounce_range (start, cnt, itt);
XMLNode &after = playlist->get_state();
- session->add_command (new MementoCommand<Playlist> (*playlist, before, after));
+ session->add_command (new MementoCommand<Playlist> (*playlist, &before, &after));
}
commit_reversible_command ();
@@ -3006,7 +3006,7 @@ Editor::cut_copy_regions (CutCopyOp op)
insert_result = freezelist.insert (pl);
if (insert_result.second) {
pl->freeze ();
- session->add_command (new MementoUndoCommand<Playlist>(*pl, pl->get_state()));
+ session->add_command (new MementoCommand<Playlist>(*pl, &pl->get_state(), 0));
}
}
}
@@ -3070,7 +3070,7 @@ Editor::cut_copy_regions (CutCopyOp op)
for (set<Playlist*>::iterator pl = freezelist.begin(); pl != freezelist.end(); ++pl) {
(*pl)->thaw ();
- session->add_command (new MementoRedoCommand<Playlist>(*(*pl), (*pl)->get_state()));
+ session->add_command (new MementoCommand<Playlist>(*(*pl), 0, &(*pl)->get_state()));
}
}
@@ -3185,7 +3185,7 @@ Editor::paste_named_selection (float times)
XMLNode &before = apl->get_state();
apl->paste (**chunk, edit_cursor->current_frame, times);
- session->add_command(new MementoCommand<AudioPlaylist>(*apl, before, apl->get_state()));
+ session->add_command(new MementoCommand<AudioPlaylist>(*apl, &before, &apl->get_state()));
if (tmp != ns->playlists.end()) {
chunk = tmp;
@@ -3216,7 +3216,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times)
playlist = (*i)->region().playlist();
XMLNode &before = playlist->get_state();
playlist->duplicate (r, r.last_frame(), times);
- session->add_command(new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+ session->add_command(new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
c.disconnect ();
@@ -3257,7 +3257,7 @@ Editor::duplicate_selection (float times)
XMLNode &before = playlist->get_state();
playlist->duplicate (**ri, selection->time[clicked_selection].end, times);
XMLNode &after = playlist->get_state();
- session->add_command (new MementoCommand<Playlist>(*playlist, before, after));
+ session->add_command (new MementoCommand<Playlist>(*playlist, &before, &after));
++ri;
if (ri == new_regions.end()) {
@@ -3308,7 +3308,7 @@ Editor::clear_playlist (Playlist& playlist)
XMLNode &before = playlist.get_state();
playlist.clear ();
XMLNode &after = playlist.get_state();
- session->add_command (new MementoCommand<Playlist>(playlist, before, after));
+ session->add_command (new MementoCommand<Playlist>(playlist, &before, &after));
commit_reversible_command ();
}
@@ -3345,7 +3345,7 @@ Editor::nudge_track (bool use_edit_cursor, bool forwards)
XMLNode &before = playlist->get_state();
playlist->nudge_after (start, distance, forwards);
XMLNode &after = playlist->get_state();
- session->add_command (new MementoCommand<Playlist>(*playlist, before, after));
+ session->add_command (new MementoCommand<Playlist>(*playlist, &before, &after));
}
commit_reversible_command ();
@@ -3401,7 +3401,7 @@ Editor::normalize_region ()
continue;
XMLNode &before = arv->region().get_state();
arv->audio_region().normalize_to (0.0f);
- session->add_command (new MementoCommand<Region>(arv->region(), before, arv->region().get_state()));
+ session->add_command (new MementoCommand<Region>(arv->region(), &before, &arv->region().get_state()));
}
commit_reversible_command ();
@@ -3428,7 +3428,7 @@ Editor::denormalize_region ()
continue;
XMLNode &before = arv->region().get_state();
arv->audio_region().set_scale_amplitude (1.0f);
- session->add_command (new MementoCommand<Region>(arv->region(), before, arv->region().get_state()));
+ session->add_command (new MementoCommand<Region>(arv->region(), &before, &arv->region().get_state()));
}
commit_reversible_command ();
@@ -3475,7 +3475,7 @@ Editor::apply_filter (AudioFilter& filter, string command)
XMLNode &before = playlist->get_state();
playlist->replace_region (arv->region(), *(filter.results.front()), arv->region().position());
XMLNode &after = playlist->get_state();
- session->add_command(new MementoCommand<Playlist>(*playlist, before, after));
+ session->add_command(new MementoCommand<Playlist>(*playlist, &before, &after));
} else {
goto out;
}
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index 9f7fe7cf09..91710c5fc9 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -277,7 +277,7 @@ Editor::mouse_add_new_tempo_event (jack_nframes_t frame)
XMLNode &before = map.get_state();
map.add_tempo (Tempo (bpm), requested);
XMLNode &after = map.get_state();
- session->add_command(new MementoCommand<TempoMap>(map, before, after));
+ session->add_command(new MementoCommand<TempoMap>(map, &before, &after));
commit_reversible_command ();
map.dump (cerr);
@@ -317,7 +317,7 @@ Editor::mouse_add_new_meter_event (jack_nframes_t frame)
begin_reversible_command (_("add meter mark"));
XMLNode &before = map.get_state();
map.add_meter (Meter (bpb, note_type), requested);
- session->add_command(new MementoCommand<TempoMap>(map, before, map.get_state()));
+ session->add_command(new MementoCommand<TempoMap>(map, &before, &map.get_state()));
commit_reversible_command ();
map.dump (cerr);
@@ -369,7 +369,7 @@ Editor::edit_meter_section (MeterSection* section)
XMLNode &before = session->tempo_map().get_state();
session->tempo_map().replace_meter (*section, Meter (bpb, note_type));
XMLNode &after = session->tempo_map().get_state();
- session->add_command(new MementoCommand<TempoMap>(session->tempo_map(), before, after));
+ session->add_command(new MementoCommand<TempoMap>(session->tempo_map(), &before, &after));
commit_reversible_command ();
}
@@ -399,7 +399,7 @@ Editor::edit_tempo_section (TempoSection* section)
session->tempo_map().replace_tempo (*section, Tempo (bpm));
session->tempo_map().move_tempo (*section, when);
XMLNode &after = session->tempo_map().get_state();
- session->add_command (new MementoCommand<TempoMap>(session->tempo_map(), before, after));
+ session->add_command (new MementoCommand<TempoMap>(session->tempo_map(), &before, &after));
commit_reversible_command ();
}
@@ -448,7 +448,7 @@ Editor::real_remove_tempo_marker (TempoSection *section)
XMLNode &before = session->tempo_map().get_state();
session->tempo_map().remove_tempo (*section);
XMLNode &after = session->tempo_map().get_state();
- session->add_command(new MementoCommand<TempoMap>(session->tempo_map(), before, after));
+ session->add_command(new MementoCommand<TempoMap>(session->tempo_map(), &before, &after));
commit_reversible_command ();
return FALSE;
@@ -482,7 +482,7 @@ Editor::real_remove_meter_marker (MeterSection *section)
XMLNode &before = session->tempo_map().get_state();
session->tempo_map().remove_meter (*section);
XMLNode &after = session->tempo_map().get_state();
- session->add_command(new MementoCommand<TempoMap>(session->tempo_map(), before, after));
+ session->add_command(new MementoCommand<TempoMap>(session->tempo_map(), &before, &after));
commit_reversible_command ();
return FALSE;
}
diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc
index 3fe0023d07..a3288ea8d0 100644
--- a/gtk2_ardour/editor_timefx.cc
+++ b/gtk2_ardour/editor_timefx.cc
@@ -210,7 +210,7 @@ Editor::do_timestretch (TimeStretchDialog& dialog)
XMLNode &before = playlist->get_state();
playlist->replace_region (region, *new_region, region.position());
XMLNode &after = playlist->get_state();
- session->add_command (new MementoCommand<Playlist>(*playlist, before, after));
+ session->add_command (new MementoCommand<Playlist>(*playlist, &before, &after));
i = tmp;
}
diff --git a/gtk2_ardour/gain_automation_time_axis.cc b/gtk2_ardour/gain_automation_time_axis.cc
index c86c1390f3..47657e3292 100644
--- a/gtk2_ardour/gain_automation_time_axis.cc
+++ b/gtk2_ardour/gain_automation_time_axis.cc
@@ -67,7 +67,7 @@ GainAutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkE
XMLNode &before = curve.get_state();
curve.add (when, y);
XMLNode &after = curve.get_state();
- _session.add_command(new MementoCommand<ARDOUR::Curve>(curve, before, after));
+ _session.add_command(new MementoCommand<ARDOUR::Curve>(curve, &before, &after));
_session.commit_reversible_command ();
_session.set_dirty ();
}
diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc
index deb4c1da36..12e7079de2 100644
--- a/gtk2_ardour/location_ui.cc
+++ b/gtk2_ardour/location_ui.cc
@@ -658,7 +658,7 @@ gint LocationUI::do_location_remove (ARDOUR::Location *loc)
XMLNode &before = session->locations()->get_state();
session->locations()->remove (loc);
XMLNode &after = session->locations()->get_state();
- session->add_command(new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
return FALSE;
@@ -777,7 +777,7 @@ LocationUI::add_new_location()
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
XMLNode &after = session->locations()->get_state();
- session->add_command (new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
}
@@ -794,7 +794,7 @@ LocationUI::add_new_range()
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
XMLNode &after = session->locations()->get_state();
- session->add_command (new MementoCommand<Locations>(*(session->locations()), before, after));
+ session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
}
}
diff --git a/gtk2_ardour/pan_automation_time_axis.cc b/gtk2_ardour/pan_automation_time_axis.cc
index ec884151b5..bbd4b3b06c 100644
--- a/gtk2_ardour/pan_automation_time_axis.cc
+++ b/gtk2_ardour/pan_automation_time_axis.cc
@@ -92,7 +92,7 @@ PanAutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEv
XMLNode &before = alist.get_state();
alist.add (when, y);
XMLNode &after = alist.get_state();
- _session.add_command(new MementoCommand<AutomationList>(alist, before, after));
+ _session.add_command(new MementoCommand<AutomationList>(alist, &before, &after));
_session.commit_reversible_command ();
_session.set_dirty ();
}
diff --git a/gtk2_ardour/redirect_automation_time_axis.cc b/gtk2_ardour/redirect_automation_time_axis.cc
index e527fd1d5e..f1e8eae9eb 100644
--- a/gtk2_ardour/redirect_automation_time_axis.cc
+++ b/gtk2_ardour/redirect_automation_time_axis.cc
@@ -102,7 +102,7 @@ RedirectAutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item,
XMLNode &before = alist.get_state();
alist.add (when, y);
XMLNode &after = alist.get_state();
- _session.add_command(new MementoCommand<AutomationList>(alist, before, after));
+ _session.add_command(new MementoCommand<AutomationList>(alist, &before, &after));
_session.commit_reversible_command ();
_session.set_dirty ();
}
diff --git a/gtk2_ardour/region_gain_line.cc b/gtk2_ardour/region_gain_line.cc
index 0a4a3d29ea..e2b1d6c826 100644
--- a/gtk2_ardour/region_gain_line.cc
+++ b/gtk2_ardour/region_gain_line.cc
@@ -48,7 +48,7 @@ AudioRegionGainLine::start_drag (ControlPoint* cp, float fraction)
{
AutomationLine::start_drag(cp,fraction);
if (!rv.audio_region().envelope_active()) {
- trackview.session().add_command(new MementoUndoCommand<AudioRegion>(rv.audio_region(), rv.audio_region().get_state()));
+ trackview.session().add_command(new MementoCommand<AudioRegion>(rv.audio_region(), &rv.audio_region().get_state(), 0));
rv.audio_region().set_envelope_active(false);
}
}
@@ -68,12 +68,12 @@ AudioRegionGainLine::remove_point (ControlPoint& cp)
XMLNode &before = rv.audio_region().get_state();
rv.audio_region().set_envelope_active(true);
XMLNode &after = rv.audio_region().get_state();
- trackview.session().add_command(new MementoCommand<AudioRegion>(rv.audio_region(), before, after));
+ trackview.session().add_command(new MementoCommand<AudioRegion>(rv.audio_region(), &before, &after));
}
alist.erase (mr.start, mr.end);
- trackview.editor.current_session()->add_command (new MementoCommand<AudioRegionGainLine>(*this, before, get_state()));
+ trackview.editor.current_session()->add_command (new MementoCommand<AudioRegionGainLine>(*this, &before, &get_state()));
trackview.editor.current_session()->commit_reversible_command ();
trackview.editor.current_session()->set_dirty ();
}
@@ -83,7 +83,7 @@ AudioRegionGainLine::end_drag (ControlPoint* cp)
{
if (!rv.audio_region().envelope_active()) {
rv.audio_region().set_envelope_active(true);
- trackview.session().add_command(new MementoRedoCommand<AudioRegion>(rv.audio_region(), rv.audio_region().get_state()));
+ trackview.session().add_command(new MementoCommand<AudioRegion>(rv.audio_region(), 0, &rv.audio_region().get_state()));
}
AutomationLine::end_drag(cp);
}
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index e2e1fb2149..6e578a13e7 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -1054,7 +1054,7 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
case Cut:
if ((what_we_got = playlist->cut (time)) != 0) {
editor.get_cut_buffer().add (what_we_got);
- _session.add_command( new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+ _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
ret = true;
}
break;
@@ -1066,7 +1066,7 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
case Clear:
if ((what_we_got = playlist->cut (time)) != 0) {
- _session.add_command( new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+ _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
what_we_got->unref ();
ret = true;
}
@@ -1097,7 +1097,7 @@ RouteTimeAxisView::paste (jack_nframes_t pos, float times, Selection& selection,
XMLNode &before = playlist->get_state();
playlist->paste (**p, pos, times);
- _session.add_command( new MementoCommand<Playlist>(*playlist, before, playlist->get_state()));
+ _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
return true;
}
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index 863e73d33e..998385f66b 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -575,7 +575,7 @@ RouteUI::reversibly_apply_route_boolean (string name, void (Route::*func)(bool,
XMLNode &before = _route->get_state();
bind(mem_fun(*_route, func), yn, arg)();
XMLNode &after = _route->get_state();
- _session.add_command (new MementoCommand<Route>(*_route, before, after));
+ _session.add_command (new MementoCommand<Route>(*_route, &before, &after));
_session.commit_reversible_command ();
}
@@ -586,7 +586,7 @@ RouteUI::reversibly_apply_audio_track_boolean (string name, void (AudioTrack::*f
XMLNode &before = audio_track()->get_state();
bind (mem_fun (*audio_track(), func), yn, arg)();
XMLNode &after = audio_track()->get_state();
- _session.add_command (new MementoCommand<AudioTrack>(*audio_track(), before, after));
+ _session.add_command (new MementoCommand<AudioTrack>(*audio_track(), &before, &after));
_session.commit_reversible_command ();
}