add/clarify "set range (location) from (range|region) selection" operation (on marker...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 9 Jan 2013 21:47:10 +0000 (21:47 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 9 Jan 2013 21:47:10 +0000 (21:47 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13825 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.h
gtk2_ardour/editor_markers.cc

index a55fef191335fdb8bc26431e70ce05f762291bb9..e95be847cd6d49793b3ada22396bab27f54ef91b 100644 (file)
@@ -1521,7 +1521,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void marker_menu_play_range ();
        void marker_menu_set_playhead ();
        void marker_menu_set_from_playhead ();
-       void marker_menu_set_from_selection ();
+       void marker_menu_set_from_selection (bool force_regions);
        void marker_menu_range_to_next ();
        void marker_menu_zoom_to_range ();
        void new_transport_marker_menu_set_loop ();
index 1eae5d7b3863d02830d7d474c7cffbe8ab7dcf8f..a6e7fadb0b763e003221d25044b665f591116f30 100644 (file)
@@ -901,7 +901,8 @@ Editor::build_range_marker_menu (bool loop_or_punch, bool session)
        }
        items.push_back (MenuElem (_("Set Range Mark from Playhead"), sigc::mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
        if (!Profile->get_sae()) {
-               items.push_back (MenuElem (_("Set Range from Range Selection"), sigc::mem_fun(*this, &Editor::marker_menu_set_from_selection)));
+               items.push_back (MenuElem (_("Set Range from Range/Region Selection"), sigc::bind (sigc::mem_fun(*this, &Editor::marker_menu_set_from_selection), false)));
+               items.push_back (MenuElem (_("Set Range from Region Selection"), sigc::bind (sigc::mem_fun(*this, &Editor::marker_menu_set_from_selection), true)));
        }
 
        items.push_back (MenuElem (_("Zoom to Range"), sigc::mem_fun (*this, &Editor::marker_menu_zoom_to_range)));
@@ -1154,7 +1155,7 @@ Editor::marker_menu_set_from_playhead ()
 }
 
 void
-Editor::marker_menu_set_from_selection ()
+Editor::marker_menu_set_from_selection (bool force_regions)
 {
        Marker* marker;
 
@@ -1175,7 +1176,7 @@ Editor::marker_menu_set_from_selection ()
 
                        /* if range selection use first to last */
 
-                       if (!selection->time.empty()) {
+                       if (!selection->time.empty() && !force_regions) {
                                l->set_start (selection->time.start());
                                l->set_end (selection->time.end_frame());
                        }