From 4685a15b1fda18046a11473cd89854ddd96b5c51 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 7 Jul 2014 08:16:57 -0400 Subject: add new variant of EditorCursor that creates an insensitive full-canvas-height line, and fix destructor leak --- gtk2_ardour/editor_cursors.cc | 17 ++++++++++++++++- gtk2_ardour/editor_cursors.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/editor_cursors.cc b/gtk2_ardour/editor_cursors.cc index ffe6fc0d01..740b96f965 100644 --- a/gtk2_ardour/editor_cursors.cc +++ b/gtk2_ardour/editor_cursors.cc @@ -52,9 +52,24 @@ EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,Ardour _current_frame = 1; /* force redraw at 0 */ } -EditorCursor::~EditorCursor () +EditorCursor::EditorCursor (Editor& ed) + : _editor (ed) + , _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_hscroll_group())) + , _length (1.0) { + CANVAS_DEBUG_NAME (_track_canvas_item, "track canvas cursor"); + + _track_canvas_item->set_show_head (0, false); + _track_canvas_item->set_show_head (1, false); + _track_canvas_item->set_y1 (ArdourCanvas::COORD_MAX); + _track_canvas_item->set_ignore_events (true); + _current_frame = 1; /* force redraw at 0 */ +} + +EditorCursor::~EditorCursor () +{ + delete _track_canvas_item; } void diff --git a/gtk2_ardour/editor_cursors.h b/gtk2_ardour/editor_cursors.h index 50958d1ac0..eb4ab1cbde 100644 --- a/gtk2_ardour/editor_cursors.h +++ b/gtk2_ardour/editor_cursors.h @@ -29,6 +29,7 @@ class Editor; class EditorCursor { public: EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*)); + EditorCursor (Editor&); ~EditorCursor (); void set_position (framepos_t); -- cgit v1.2.3