diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2015-03-13 16:24:55 -0500 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2015-03-13 16:25:59 -0500 |
commit | ffd32ae5e184b42aa9f38903f146751b36b87092 (patch) | |
tree | 5a8423132b80e8a39e46900ced752635de1b472d | |
parent | 94e36450d2bb7fad5f27d9313035f6b4535931b8 (diff) |
Right-clicking on the Loop/Punch ruler should "Do Something".
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_markers.cc | 32 | ||||
-rw-r--r-- | gtk2_ardour/editor_rulers.cc | 3 |
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: |