Right-clicking on the Loop/Punch ruler should "Do Something".

This commit is contained in:
Ben Loftis 2015-03-13 16:24:55 -05:00
parent 94e36450d2
commit ffd32ae5e1
3 changed files with 36 additions and 1 deletions

View File

@ -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);

View File

@ -673,6 +673,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)
{

View File

@ -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: