13
0

tweak recent change to marker context menu

git-svn-id: svn://localhost/ardour2/branches/3.0@13826 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2013-01-10 14:07:46 +00:00
parent 3a7eeb17bc
commit 31172d0c71

View File

@ -894,15 +894,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/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 (_("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)));
@ -1155,7 +1153,7 @@ Editor::marker_menu_set_from_playhead ()
}
void
Editor::marker_menu_set_from_selection (bool force_regions)
Editor::marker_menu_set_from_selection (bool /*force_regions*/)
{
Marker* marker;
@ -1170,21 +1168,15 @@ Editor::marker_menu_set_from_selection (bool force_regions)
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 */
if (!selection->time.empty() && !force_regions) {
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());
}
}
}