summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-01-02 21:25:37 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-01-02 21:25:37 +0000
commitb5f497c0c98501cf6a9deff7593e286613b7dc0c (patch)
treee2ba01eeb6f9cad6a547351f653e933e0dbf472f /gtk2_ardour
parent8fabcf4f760e68e10573efc0ef1da9d6d8453885 (diff)
patches from Stephane Letz for JACK, and Nimal Ratnayake for play range and play region
git-svn-id: svn://localhost/ardour2/trunk@1260 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_markers.cc27
2 files changed, 28 insertions, 0 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index dd35d36c05..e64ccf461d 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -1205,6 +1205,7 @@ class Editor : public PublicEditor
void marker_menu_select_all_selectables_using_range ();
void marker_menu_separate_regions_using_location ();
void marker_menu_play_from ();
+ void marker_menu_play_range ();
void marker_menu_set_playhead ();
void marker_menu_set_from_playhead ();
void marker_menu_set_from_selection ();
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 ()
{