summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/editor.h2
-rw-r--r--gtk2_ardour/editor_markers.cc32
-rw-r--r--gtk2_ardour/editor_rulers.cc3
3 files changed, 36 insertions, 1 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 86d6126892..e7f1cd2807 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -678,6 +678,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void hide_marker (ArdourCanvas::Item*, GdkEvent*);
void clear_marker_display ();
void mouse_add_new_range (framepos_t);
+ void mouse_add_new_loop (framepos_t);
+ void mouse_add_new_punch (framepos_t);
bool choose_new_marker_name(std::string &name);
void update_cd_marker_display ();
void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index d982de3a32..78f806310e 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -674,6 +674,38 @@ Editor::mouse_add_new_marker (framepos_t where, bool is_cd, bool is_xrun)
}
void
+Editor::mouse_add_new_loop (framepos_t where)
+{
+ if (!_session) {
+ return;
+ }
+
+ /* Make this marker 1/8th of the visible area of the session so that
+ it's reasonably easy to manipulate after creation.
+ */
+
+ framepos_t const end = where + current_page_samples() / 8;
+
+ set_loop_range (where, end, _("set loop range"));
+}
+
+void
+Editor::mouse_add_new_punch (framepos_t where)
+{
+ if (!_session) {
+ return;
+ }
+
+ /* Make this marker 1/8th of the visible area of the session so that
+ it's reasonably easy to manipulate after creation.
+ */
+
+ framepos_t const end = where + current_page_samples() / 8;
+
+ set_punch_range (where, end, _("set punch range"));
+}
+
+void
Editor::mouse_add_new_range (framepos_t where)
{
if (!_session) {
diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc
index 1c3469da9a..0fc49f522b 100644
--- a/gtk2_ardour/editor_rulers.cc
+++ b/gtk2_ardour/editor_rulers.cc
@@ -221,7 +221,8 @@ Editor::popup_ruler_menu (framepos_t where, ItemType t)
break;
case TransportMarkerBarItem:
-
+ ruler_items.push_back (MenuElem (_("Make Loop range"), sigc::bind (sigc::mem_fun (*this, &Editor::mouse_add_new_loop), where)));
+ ruler_items.push_back (MenuElem (_("Make Punch range"), sigc::bind (sigc::mem_fun (*this, &Editor::mouse_add_new_punch), where)));
break;
case CdMarkerBarItem: