diff options
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r-- | gtk2_ardour/editor_markers.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 6da479bafe..29b57e449a 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -481,6 +481,7 @@ Editor::build_range_marker_menu () items.push_back (MenuElem (_("Locate to Range Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead))); items.push_back (MenuElem (_("Play from Range Mark"), mem_fun(*this, &Editor::marker_menu_play_from))); + items.push_back (MenuElem (_("Play Range"), mem_fun(*this, &Editor::marker_menu_play_range))); items.push_back (MenuElem (_("Loop Range"), mem_fun(*this, &Editor::marker_menu_loop_range))); items.push_back (MenuElem (_("Set Range Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead))); items.push_back (MenuElem (_("Set Range from Range Selection"), mem_fun(*this, &Editor::marker_menu_set_from_selection))); @@ -726,6 +727,32 @@ Editor::marker_menu_set_from_selection () } } + +void +Editor::marker_menu_play_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) { + + if (l->is_mark()) { + session->request_locate (l->start(), true); + } + else { + session->request_bounded_roll (l->start(), l->end()); + + } + } +} + void Editor::marker_menu_loop_range () { |