+}
+
+void
+Editor::marker_selection_changed ()
+{
+ if (_session && _session->deletion_in_progress()) {
+ return;
+ }
+
+ for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
+ LocationMarkers* lam = i->second;
+
+ if (lam->start) {
+ lam->start->hide_line();
+ }
+
+ if (lam->end) {
+ lam->end->hide_line();
+ }
+ }
+
+ for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) {
+ (*x)->add_line (cursor_group, 0, _canvas_height);
+ (*x)->show_line ();
+ }
+}
+
+struct SortLocationsByPosition {
+ bool operator() (Location* a, Location* b) {
+ return a->start() < b->start();
+ }
+};
+
+void
+Editor::goto_nth_marker (int n)
+{
+ if (!_session) {
+ return;
+ }
+ const Locations::LocationList& l (_session->locations()->list());
+ Locations::LocationList ordered;
+ ordered = l;
+
+ SortLocationsByPosition cmp;
+ ordered.sort (cmp);
+
+ for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) {
+ if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
+ if (n == 0) {
+ _session->request_locate ((*i)->start(), _session->transport_rolling());
+ break;
+ }
+ --n;
+ }
+ }
+}
+
+void
+Editor::toggle_marker_menu_glue ()
+{
+ Marker* marker;
+
+ if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
+ fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
+ /*NOTREACHED*/
+ }
+
+ Location* loc;
+ bool ignored;
+
+ loc = find_location_from_marker (marker, ignored);
+
+ if (!loc) {
+ return;
+ }
+
+ if (loc->position_lock_style() == MusicTime) {
+ loc->set_position_lock_style (AudioTime);
+ } else {
+ loc->set_position_lock_style (MusicTime);
+ }