summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-07-07 08:16:57 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-07-07 08:16:57 -0400
commit4685a15b1fda18046a11473cd89854ddd96b5c51 (patch)
treeb044003060396335f7441117d49f9e9ebc50778f /gtk2_ardour
parenta1bc2cb10e1cc6fa05b04c85f98cf0622afe99f1 (diff)
add new variant of EditorCursor that creates an insensitive full-canvas-height line, and fix destructor leak
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_cursors.cc17
-rw-r--r--gtk2_ardour/editor_cursors.h1
2 files changed, 17 insertions, 1 deletions
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);