From 5f2690ac65487d3ac3c61ca1608889ad9c06b979 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 16 Oct 2011 21:58:29 +0000 Subject: [PATCH] Remove unused method transport_marker_context_menu(). Allow loop / punch markers to be removed (#4379). git-svn-id: svn://localhost/ardour2/branches/3.0@10210 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor.h | 3 +-- gtk2_ardour/editor_markers.cc | 28 +++++++++++++--------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index ffc9534809..d2c626cb78 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1482,9 +1482,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void new_transport_marker_menu_popdown (); void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*); void tempo_or_meter_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*); - void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*); void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*); - void build_range_marker_menu (bool); + void build_range_marker_menu (bool, bool); void build_marker_menu (ARDOUR::Location *); void build_tempo_or_meter_marker_menu (bool); void build_new_transport_marker_menu (); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index c1f06a18c1..58a65fad53 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -765,7 +765,7 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item) if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range ()) { if (transport_marker_menu == 0) { - build_range_marker_menu (true); + build_range_marker_menu (loc == transport_loop_location() || loc == transport_punch_location(), loc->is_session_range()); } marker_menu_item = item; @@ -795,7 +795,7 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item) } else if (loc->is_range_marker()) { if (range_marker_menu == 0) { - build_range_marker_menu (false); + build_range_marker_menu (false, false); } marker_menu_item = item; range_marker_menu->popup (1, ev->time); @@ -813,16 +813,6 @@ Editor::new_transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Ite } -void -Editor::transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item*) -{ - if (transport_marker_menu == 0) { - build_range_marker_menu (true); - } - - transport_marker_menu->popup (1, ev->time); -} - void Editor::build_marker_menu (Location* loc) { @@ -863,10 +853,12 @@ Editor::build_marker_menu (Location* loc) } void -Editor::build_range_marker_menu (bool loop_or_punch_or_session) +Editor::build_range_marker_menu (bool loop_or_punch, bool session) { using namespace Menu_Helpers; + bool const loop_or_punch_or_session = loop_or_punch | session; + Menu *markerMenu = new Menu; if (loop_or_punch_or_session) { transport_marker_menu = markerMenu; @@ -894,10 +886,16 @@ Editor::build_range_marker_menu (bool loop_or_punch_or_session) if (!loop_or_punch_or_session) { items.push_back (MenuElem (_("Hide Range"), sigc::mem_fun(*this, &Editor::marker_menu_hide))); items.push_back (MenuElem (_("Rename Range"), sigc::mem_fun(*this, &Editor::marker_menu_rename))); - items.push_back (MenuElem (_("Remove Range"), sigc::mem_fun(*this, &Editor::marker_menu_remove))); - items.push_back (SeparatorElem()); } + if (!session) { + items.push_back (MenuElem (_("Remove Range"), sigc::mem_fun(*this, &Editor::marker_menu_remove))); + } + + if (loop_or_punch_or_session) { + items.push_back (SeparatorElem()); + } + items.push_back (MenuElem (_("Separate Regions in Range"), sigc::mem_fun(*this, &Editor::marker_menu_separate_regions_using_location))); items.push_back (MenuElem (_("Select All in Range"), sigc::mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range))); if (!Profile->get_sae()) {