diff options
author | Robin Gareus <robin@gareus.org> | 2017-11-23 00:10:36 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-11-23 00:13:44 +0100 |
commit | 98439cf88c4fa217549cdb01bd401cabcc90b414 (patch) | |
tree | 0911da189f223bc71a303affa9bff621c8b2fd89 /gtk2_ardour/editor_markers.cc | |
parent | 15150c57c1e10e8ec2182a667c8e93627f446b60 (diff) |
GUI to set clock-origin marker
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r-- | gtk2_ardour/editor_markers.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 782c1e5f9a..abe6d8a658 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -911,6 +911,7 @@ Editor::build_marker_menu (Location* loc) items.push_back (MenuElem (_("Create Range to Next Marker"), sigc::mem_fun(*this, &Editor::marker_menu_range_to_next))); + items.push_back (MenuElem (_("Promote to Time Origin"), sigc::mem_fun(*this, &Editor::marker_menu_set_origin))); items.push_back (MenuElem (_("Hide"), sigc::mem_fun(*this, &Editor::marker_menu_hide))); items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &Editor::marker_menu_rename))); @@ -970,6 +971,7 @@ Editor::build_range_marker_menu (Location* loc, bool loop_or_punch, bool session items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_range))); items.push_back (SeparatorElem()); + items.push_back (MenuElem (_("Promote to Time Origin"), sigc::mem_fun(*this, &Editor::marker_menu_set_origin))); if (!loop_or_punch_or_session) { items.push_back (MenuElem (_("Hide Range"), sigc::mem_fun(*this, &Editor::marker_menu_hide))); items.push_back (MenuElem (_("Rename Range..."), sigc::mem_fun(*this, &Editor::marker_menu_rename))); @@ -1087,6 +1089,24 @@ Editor::marker_menu_hide () } void +Editor::marker_menu_set_origin () +{ + ArdourMarker* marker; + + if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) { + fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg; + abort(); /*NOTREACHED*/ + } + + Location* l; + bool is_start; + + if ((l = find_location_from_marker (marker, is_start)) != 0) { + _session->locations()->set_clock_origin (l, this); + } +} + +void Editor::marker_menu_select_using_range () { ArdourMarker* marker; |