summaryrefslogtreecommitdiff
path: root/gtk2_ardour/selection.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-10-20 00:05:31 +0000
committerCarl Hetherington <carl@carlh.net>2011-10-20 00:05:31 +0000
commitabedf1fae33bb1215d4e2f2c3b84e1ced80a6e9d (patch)
tree828c6814006549cdaffe3c6ff3b9dee54b6ae1dc /gtk2_ardour/selection.cc
parent0bc8832e208154a0f172d34182ed6b0bc8bba52f (diff)
Save marker selection state in instant.xml (#4203).
git-svn-id: svn://localhost/ardour2/branches/3.0@10245 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/selection.cc')
-rw-r--r--gtk2_ardour/selection.cc25
1 files changed, 25 insertions, 0 deletions
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;