summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-03-14 14:40:40 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-03-14 14:40:40 +0000
commitc309e2a323ffbb95945b4aa177fa93c3cc74bb8f (patch)
treec54c742d2247b40d72ed7b029ad839b241d52a6f
parent29f6f0cf05893371a64fb14f8868a3e0e4effd39 (diff)
add "Select Range" to range marker context menu
git-svn-id: svn://localhost/ardour2/trunk@1589 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_markers.cc19
2 files changed, 20 insertions, 0 deletions
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)));
}
@@ -560,6 +561,24 @@ Editor::marker_menu_hide ()
}
void
+Editor::marker_menu_select_using_range ()
+{
+ 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* 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 ()
{
Marker* marker;