From abedf1fae33bb1215d4e2f2c3b84e1ced80a6e9d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 20 Oct 2011 00:05:31 +0000 Subject: Save marker selection state in instant.xml (#4203). git-svn-id: svn://localhost/ardour2/branches/3.0@10245 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/selection.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gtk2_ardour/selection.cc') diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 35998a2a1d..5b7a88c81e 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -1141,6 +1141,16 @@ Selection::get_state () const } } + for (MarkerSelection::const_iterator i = markers.begin(); i != markers.end(); ++i) { + XMLNode* t = node->add_child (X_("Marker")); + + bool is_start; + Location* loc = editor->find_location_from_marker (*i, is_start); + + t->add_property (X_("id"), atoi (loc->id().to_s().c_str())); + t->add_property (X_("start"), is_start ? X_("yes") : X_("no")); + } + return *node; } @@ -1186,7 +1196,22 @@ Selection::set_state (XMLNode const & node, int) add (atv.get()); } } + + } else if ((*i)->name() == X_("Marker")) { + + XMLProperty* prop_id = (*i)->property (X_("id")); + XMLProperty* prop_start = (*i)->property (X_("start")); + assert (prop_id); + assert (prop_start); + + PBD::ID id (prop_id->value ()); + Marker* m = editor->find_marker_from_location_id (id, string_is_affirmative (prop_start->value ())); + if (m) { + add (m); + } + } + } return 0; -- cgit v1.2.3