X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_markers.cc;h=6dee565287967b0912cbe4ac7bc4237e34bb0993;hb=d176cbc80476cdc8ca082631efc171ea39116d63;hp=28706ac7bc7d822146757edf5c8ef79354f6fef8;hpb=d54fb5f54ec4e3cfb88887a6a0ab5ee9407af0b5;p=ardour.git diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 28706ac7bc..6dee565287 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -17,7 +17,6 @@ */ -#include #include #include @@ -859,14 +858,14 @@ Editor::build_marker_menu (Location* loc) items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &Editor::marker_menu_rename))); items.push_back (CheckMenuElem (_("Lock"))); - CheckMenuItem* lock_item = static_cast (&items.back()); + Gtk::CheckMenuItem* lock_item = static_cast (&items.back()); if (loc->locked ()) { lock_item->set_active (); } lock_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_lock)); items.push_back (CheckMenuElem (_("Glue to Bars and Beats"))); - CheckMenuItem* glue_item = static_cast (&items.back()); + Gtk::CheckMenuItem* glue_item = static_cast (&items.back()); if (loc->position_lock_style() == MusicTime) { glue_item->set_active (); } @@ -894,14 +893,13 @@ Editor::build_range_marker_menu (bool loop_or_punch, bool session) markerMenu->set_name ("ArdourContextMenu"); items.push_back (MenuElem (_("Play Range"), sigc::mem_fun(*this, &Editor::marker_menu_play_range))); - items.push_back (MenuElem (_("Locate to Range Mark"), sigc::mem_fun(*this, &Editor::marker_menu_set_playhead))); - items.push_back (MenuElem (_("Play from Range Mark"), sigc::mem_fun(*this, &Editor::marker_menu_play_from))); - if (!loop_or_punch_or_session) { - items.push_back (MenuElem (_("Loop Range"), sigc::mem_fun(*this, &Editor::marker_menu_loop_range))); - } - items.push_back (MenuElem (_("Set Range Mark from Playhead"), sigc::mem_fun(*this, &Editor::marker_menu_set_from_playhead))); + items.push_back (MenuElem (_("Locate to Marker"), sigc::mem_fun(*this, &Editor::marker_menu_set_playhead))); + items.push_back (MenuElem (_("Play from Marker"), sigc::mem_fun(*this, &Editor::marker_menu_play_from))); + items.push_back (MenuElem (_("Loop Range"), sigc::mem_fun(*this, &Editor::marker_menu_loop_range))); + + items.push_back (MenuElem (_("Set Marker 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 Selection"), sigc::bind (sigc::mem_fun(*this, &Editor::marker_menu_set_from_selection), false))); } items.push_back (MenuElem (_("Zoom to Range"), sigc::mem_fun (*this, &Editor::marker_menu_zoom_to_range))); @@ -1154,7 +1152,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; @@ -1169,23 +1167,15 @@ Editor::marker_menu_set_from_selection () if ((l = find_location_from_marker (marker, is_start)) != 0) { if (l->is_mark()) { - // nothing for now - } - else { - /* if range selection use first to last */ + // nothing for now - if (mouse_mode == Editing::MouseRange) { - if (!selection->time.empty()) { - l->set_start (selection->time.start()); - l->set_end (selection->time.end_frame()); - } - } - else { - if (!selection->regions.empty()) { - l->set_start (selection->regions.start()); - l->set_end (selection->regions.end_frame()); - } + } else { + + if (!selection->time.empty()) { + l->set (selection->time.start(), selection->time.end_frame()); + } else if (!selection->regions.empty()) { + l->set (selection->regions.start(), selection->regions.end_frame()); } } }