Unconditionally save instant.xml on session-close
[ardour.git] / gtk2_ardour / editor_cursors.h
1 /*
2  * Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
3  * Copyright (C) 2012-2014 David Robillard <d@drobilla.net>
4  * Copyright (C) 2012-2017 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef __gtk_ardour_editor_cursors_h__
23 #define __gtk_ardour_editor_cursors_h__
24
25 #include "pbd/signals.h"
26 #include "ardour/types.h"
27
28 #include "canvas/arrow.h"
29 #include "canvas/line.h"
30 #include "canvas/types.h"
31
32 class Editor;
33
34 class EditorCursor
35 {
36 public:
37         EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
38         EditorCursor (Editor&);
39         ~EditorCursor ();
40
41         void set_position (samplepos_t);
42
43
44         void show ();
45         void hide ();
46         void set_color (Gtkmm2ext::Color);
47         void set_sensitive (bool);
48
49         samplepos_t current_sample () const {
50                 return _current_sample;
51         }
52
53         ArdourCanvas::Arrow& track_canvas_item () {
54                 return *_track_canvas_item;
55         }
56
57         PBD::Signal1<void, samplepos_t> PositionChanged;
58
59 private:
60         Editor&               _editor;
61         ArdourCanvas::Arrow*  _track_canvas_item;
62         samplepos_t           _current_sample;
63 };
64
65 #endif // __gtk_ardour_editor_cursors_h__