From bcb3e75cecb8bb8fdcdd3c8ba8b03159231ed889 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 16 Mar 2021 16:49:49 -0600 Subject: [PATCH] GUI to remove xrun markers --- gtk2_ardour/editor.h | 1 + gtk2_ardour/editor_ops.cc | 15 +++++++++++++++ gtk2_ardour/editor_rulers.cc | 1 + 3 files changed, 17 insertions(+) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 954b5d10a2..3ca36de884 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1471,6 +1471,7 @@ private: void scroll_tracks_up (); void set_mark (); void clear_markers (); + void clear_xrun_markers (); void clear_ranges (); void clear_locations (); void unhide_markers (); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index a0d2794471..06205f8ac2 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2509,6 +2509,21 @@ Editor::clear_markers () } } +void +Editor::clear_xrun_markers () +{ + if (_session) { + begin_reversible_command (_("clear xrun markers")); + + XMLNode &before = _session->locations()->get_state(); + _session->locations()->clear_xrun_markers (); + XMLNode &after = _session->locations()->get_state(); + _session->add_command(new MementoCommand(*(_session->locations()), &before, &after)); + + commit_reversible_command (); + } +} + void Editor::clear_ranges () { diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 0ce2d567d2..186af8a8dd 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -219,6 +219,7 @@ Editor::popup_ruler_menu (samplepos_t where, ItemType t) case MarkerBarItem: ruler_items.push_back (MenuElem (_("New location marker"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, false))); ruler_items.push_back (MenuElem (_("Clear all locations"), sigc::mem_fun(*this, &Editor::clear_markers))); + ruler_items.push_back (MenuElem (_("Clear all xruns"), sigc::mem_fun(*this, &Editor::clear_xrun_markers))); ruler_items.push_back (MenuElem (_("Unhide locations"), sigc::mem_fun(*this, &Editor::unhide_markers))); break;