13
0

small API change to provide (debug) name to canvas cursor items

This commit is contained in:
Paul Davis 2021-07-27 12:10:10 -06:00
parent 2bad9e0a85
commit 44e67c3566
3 changed files with 8 additions and 8 deletions

View File

@ -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)); 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)); 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)); _canvas_drop_zone = new ArdourCanvas::Rectangle (hv_scroll_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, 0.0));
/* this thing is transparent */ /* this thing is transparent */

View File

@ -35,11 +35,11 @@ using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace Gtk; 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) : _editor (ed)
, _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_cursor_scroll_group())) , _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_show_head (0, true);
_track_canvas_item->set_head_height (0, 9); _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 */ _current_sample = 1; /* force redraw at 0 */
} }
EditorCursor::EditorCursor (Editor& ed) EditorCursor::EditorCursor (Editor& ed, std::string const & name)
: _editor (ed) : _editor (ed)
, _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_hscroll_group())) , _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 (0, false);
_track_canvas_item->set_show_head (1, false); _track_canvas_item->set_show_head (1, false);

View File

@ -34,8 +34,8 @@ class Editor;
class EditorCursor class EditorCursor
{ {
public: public:
EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*)); EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*), std::string const &);
EditorCursor (Editor&); EditorCursor (Editor&, std::string const &);
~EditorCursor (); ~EditorCursor ();
void set_position (samplepos_t); void set_position (samplepos_t);