don't bother doing port stuff if session is being deleted
[ardour.git] / gtk2_ardour / editor_markers.cc
index b95c29ee4200273ef89b465488456581e4eb1c10..c6a75015b52863f7d573000aff338a6d05924983 100644 (file)
@@ -24,6 +24,7 @@
 #include <libgnomecanvas/libgnomecanvas.h>
 #include <gtkmm2ext/gtk_ui.h>
 
+#include "ardour/session.h"
 #include "ardour/location.h"
 #include "ardour/profile.h"
 #include "pbd/memento_command.h"
@@ -827,7 +828,9 @@ Editor::marker_menu_range_to_next ()
                return;
        }
 
-       nframes_t end = session->locations()->first_mark_after (marker->position());
+       nframes64_t start;
+       nframes64_t end;
+       session->locations()->marks_either_side (marker->position(), start, end);
 
        if (end != max_frames) {
                string range_name = l->name();
@@ -1174,34 +1177,10 @@ Editor::marker_selection_changed ()
                }
        }
 
-       edit_point_clock_connection_a.disconnect();
-       edit_point_clock_connection_b.disconnect();
-
-       if (selection->markers.empty()) {
-               edit_point_clock.set (0);
-               return;
-       }
-
        for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) {
                (*x)->add_line (cursor_group, 0, _canvas_height);
                (*x)->show_line ();
        }
-
-       edit_point_clock.set (selection->markers.front()->position());
-
-       bool ignored;
-       Location* loc = find_location_from_marker (selection->markers.front(), ignored);
-
-       if (loc) {
-               edit_point_clock_connection_a = loc->changed.connect (mem_fun (*this, &Editor::selected_marker_moved));
-               edit_point_clock_connection_b = loc->start_changed.connect (mem_fun (*this, &Editor::selected_marker_moved));
-       }
-}
-
-void
-Editor::selected_marker_moved (Location* loc)
-{
-       edit_point_clock.set (loc->start());
 }
 
 struct SortLocationsByPosition {