summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Fugal <hans@fugal.net>2006-08-12 23:20:11 +0000
committerHans Fugal <hans@fugal.net>2006-08-12 23:20:11 +0000
commitb13dc9884e926fc96f34334ce2bc9498dccd8178 (patch)
tree4aad966194f945976f050c2b1b43337199183ec9
parentf99a016f17a890aa4c71f2aa8771e52314492db7 (diff)
parent92ab1124809b247707515b7fb03b8c37326fd57c (diff)
r268@gwythaint (orig r808): fugalh | 2006-08-12 16:31:45 -0600
r269@gwythaint (orig r809): fugalh | 2006-08-12 16:33:00 -0600 r321@gandalf: fugalh | 2006-08-12 15:48:28 -0600 Behold serialized undo. r270@gwythaint (orig r810): fugalh | 2006-08-12 16:33:10 -0600 r322@gandalf: fugalh | 2006-08-12 15:49:05 -0600 A few ardev and ardbg enhancements. r271@gwythaint (orig r811): fugalh | 2006-08-12 16:33:20 -0600 r329@gandalf: fugalh | 2006-08-12 15:54:49 -0600 Cleaning up some printf debugging r272@gwythaint (orig r812): fugalh | 2006-08-12 16:33:38 -0600 r273@gwythaint (orig r813): fugalh | 2006-08-12 16:33:48 -0600 r338@gandalf: fugalh | 2006-08-12 16:30:19 -0600 Oops, forgot one r274@gwythaint (orig r814): fugalh | 2006-08-12 17:19:56 -0600 Remove -x from ardbg, fix bug in memento command factory git-svn-id: svn://localhost/ardour2/trunk@815 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rwxr-xr-xgtk2_ardour/ardbg2
-rw-r--r--gtk2_ardour/ardour_ui.cc1
-rw-r--r--libs/ardour/location.cc11
-rw-r--r--libs/ardour/session_command.cc16
4 files changed, 27 insertions, 3 deletions
diff --git a/gtk2_ardour/ardbg b/gtk2_ardour/ardbg
index cac20f3c2f..dde203219e 100755
--- a/gtk2_ardour/ardbg
+++ b/gtk2_ardour/ardbg
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
dir=`dirname "$0"`
source $dir/ardev_common.sh
exec gdb $dir/ardour.bin $*
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index c054de9808..e5367d6280 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -1486,7 +1486,6 @@ ARDOUR_UI::restore_state (string name)
name = session->name();
}
session->restore_state (name);
- session->restore_history (name);
}
}
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index 5b5f733138..ca88a2851b 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -834,3 +834,14 @@ Locations::num_range_markers () const
}
return cnt;
}
+
+Location *
+Locations::get_location_by_id(PBD::ID id)
+{
+ LocationList::iterator it;
+ for (it = locations.begin(); it != locations.end(); it++)
+ if (id == (*it)->id())
+ return *it;
+
+ return 0;
+}
diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc
index 8c1a4b32cf..dbe0ffccdd 100644
--- a/libs/ardour/session_command.cc
+++ b/libs/ardour/session_command.cc
@@ -24,6 +24,7 @@ Command *Session::memento_command_factory(XMLNode *n)
{
PBD::ID id;
XMLNode *before = 0, *after = 0;
+ XMLNode *child;
/* get id */
id = PBD::ID(n->property("obj_id")->value());
@@ -33,10 +34,23 @@ Command *Session::memento_command_factory(XMLNode *n)
{
before = new XMLNode(*n->children().front());
after = new XMLNode(*n->children().back());
+ child = before;
} else if (n->name() == "MementoUndoCommand")
+ {
before = new XMLNode(*n->children().front());
+ child = before;
+ }
else if (n->name() == "MementoRedoCommand")
+ {
after = new XMLNode(*n->children().front());
+ child = after;
+ }
+
+ if (!child)
+ {
+ error << _("Tried to reconstitute a MementoCommand with no contents, failing. id=") << id.to_s() << endmsg;
+ return 0;
+ }
/* create command */
@@ -59,7 +73,7 @@ Command *Session::memento_command_factory(XMLNode *n)
return new MementoCommand<TempoMap>(*_tempo_map, before, after);
else if (obj_T == "Playlist" || obj_T == "AudioPlaylist")
{
- if (Playlist *pl = playlist_by_name(before->property("name")->value()))
+ if (Playlist *pl = playlist_by_name(child->property("name")->value()))
return new MementoCommand<Playlist>(*pl, before, after);
}
else if (obj_T == "Route") // inlcudes AudioTrack