X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_markers.cc;h=abe6d8a6588e83e7077de610408d48ddad4b015d;hb=2dc3c8b3650266eba09cf7fe53c39c6728d4d5b6;hp=782c1e5f9a5bcf2d4be256851f5471d2b28a7825;hpb=30b087ab3d28f1585987fa3f6ae006562ae192e3;p=ardour.git 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))); @@ -1086,6 +1088,24 @@ Editor::marker_menu_hide () } } +void +Editor::marker_menu_set_origin () +{ + ArdourMarker* marker; + + if ((marker = reinterpret_cast (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 () {