From 44e67c3566a5df365068f0ac5b51c515627fe024 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 27 Jul 2021 12:10:10 -0600 Subject: [PATCH] small API change to provide (debug) name to canvas cursor items --- gtk2_ardour/editor_canvas.cc | 4 ++-- gtk2_ardour/editor_cursors.cc | 8 ++++---- gtk2_ardour/editor_cursors.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index f79171b6be..81db9bb8c7 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -223,9 +223,9 @@ Editor::initialize_canvas () range_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_range_marker_bar_event), range_marker_bar)); transport_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_transport_marker_bar_event), transport_marker_bar)); - _playhead_cursor = new EditorCursor (*this, &Editor::canvas_playhead_cursor_event); + _playhead_cursor = new EditorCursor (*this, &Editor::canvas_playhead_cursor_event, X_("playhead")); - _snapped_cursor = new EditorCursor (*this); + _snapped_cursor = new EditorCursor (*this, X_("snapped")); _canvas_drop_zone = new ArdourCanvas::Rectangle (hv_scroll_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, 0.0)); /* this thing is transparent */ diff --git a/gtk2_ardour/editor_cursors.cc b/gtk2_ardour/editor_cursors.cc index e951f94424..64dce54588 100644 --- a/gtk2_ardour/editor_cursors.cc +++ b/gtk2_ardour/editor_cursors.cc @@ -35,11 +35,11 @@ using namespace ARDOUR; using namespace PBD; using namespace Gtk; -EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,ArdourCanvas::Item*)) +EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,ArdourCanvas::Item*), std::string const & name) : _editor (ed) , _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_cursor_scroll_group())) { - CANVAS_DEBUG_NAME (_track_canvas_item, "track canvas editor cursor"); + CANVAS_DEBUG_NAME (_track_canvas_item, string_compose ("track canvas editor cursor <%1>", name)); _track_canvas_item->set_show_head (0, true); _track_canvas_item->set_head_height (0, 9); @@ -57,11 +57,11 @@ EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,Ardour _current_sample = 1; /* force redraw at 0 */ } -EditorCursor::EditorCursor (Editor& ed) +EditorCursor::EditorCursor (Editor& ed, std::string const & name) : _editor (ed) , _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_hscroll_group())) { - CANVAS_DEBUG_NAME (_track_canvas_item, "track canvas cursor"); + CANVAS_DEBUG_NAME (_track_canvas_item, string_compose ("track canvas cursor <%1>", name)); _track_canvas_item->set_show_head (0, false); _track_canvas_item->set_show_head (1, false); diff --git a/gtk2_ardour/editor_cursors.h b/gtk2_ardour/editor_cursors.h index bcd3480e0c..bdba8fc7fe 100644 --- a/gtk2_ardour/editor_cursors.h +++ b/gtk2_ardour/editor_cursors.h @@ -34,8 +34,8 @@ class Editor; class EditorCursor { public: - EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*)); - EditorCursor (Editor&); + EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*), std::string const &); + EditorCursor (Editor&, std::string const &); ~EditorCursor (); void set_position (samplepos_t);