From c309e2a323ffbb95945b4aa177fa93c3cc74bb8f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 14 Mar 2007 14:40:40 +0000 Subject: [PATCH] add "Select Range" to range marker context menu git-svn-id: svn://localhost/ardour2/trunk@1589 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor.h | 1 + gtk2_ardour/editor_markers.cc | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index ac861bc544..c3829f32fc 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1239,6 +1239,7 @@ class Editor : public PublicEditor void marker_menu_hide (); void marker_menu_loop_range (); void marker_menu_select_all_selectables_using_range (); + void marker_menu_select_using_range (); void marker_menu_separate_regions_using_location (); void marker_menu_play_from (); void marker_menu_play_range (); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 3245b79c59..06e99d0fbb 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -510,6 +510,7 @@ Editor::build_range_marker_menu (bool loop_or_punch) items.push_back (MenuElem (_("Separate Regions in Range"), mem_fun(*this, &Editor::marker_menu_separate_regions_using_location))); items.push_back (MenuElem (_("Select All in Range"), mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range))); + items.push_back (MenuElem (_("Select Range"), mem_fun(*this, &Editor::marker_menu_select_using_range))); } @@ -559,6 +560,24 @@ Editor::marker_menu_hide () } } +void +Editor::marker_menu_select_using_range () +{ + Marker* marker; + + if ((marker = reinterpret_cast (marker_menu_item->get_data ("marker"))) == 0) { + fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg; + /*NOTREACHED*/ + } + + Location* l; + bool is_start; + + if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) { + set_selection_from_range (*l); + } +} + void Editor::marker_menu_select_all_selectables_using_range () {