Fix thinkos in cubasish theme
[ardour.git] / gtk2_ardour / control_point.h
1 /*
2  * Copyright (C) 2007-2011 David Robillard <d@drobilla.net>
3  * Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2012-2014 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2015-2017 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 __ardour_control_point_h__
23 #define __ardour_control_point_h__
24
25 #include <sys/types.h>
26 #include <gdk/gdkevents.h>
27
28 #include "ardour/automation_list.h"
29
30 #include "selectable.h"
31
32 class AutomationLine;
33 class ControlPoint;
34 class PointSelection;
35 class TimeAxisView;
36 class AutomationTimeAxisView;
37 class Selectable;
38 class Selection;
39
40 namespace ArdourCanvas {
41         class Rectangle;
42         class Diamond;
43         class Item;
44 }
45
46 class ControlPoint : public Selectable
47 {
48 public:
49         ControlPoint (AutomationLine& al);
50         ControlPoint (const ControlPoint&, bool dummy_arg_to_force_special_copy_constructor);
51         virtual ~ControlPoint ();
52
53         enum ShapeType {
54                 Full,
55                 Start,
56                 End
57         };
58
59         void move_to (double x, double y, ShapeType);
60         void reset (double x, double y, ARDOUR::AutomationList::iterator, uint32_t, ShapeType);
61         double get_x() const { return _x; }
62         double get_y() const { return _y; }
63
64         void hide ();
65         void show ();
66         bool visible () const;
67
68         double size () const {
69                 return _size;
70         }
71
72         void set_size (double);
73         void set_color ();
74
75         bool     can_slide() const          { return _can_slide; }
76         void     set_can_slide(bool yn)     { _can_slide = yn; }
77         uint32_t view_index() const         { return _view_index; }
78         void     set_view_index(uint32_t i) { _view_index = i; }
79
80         ArdourCanvas::Item& item() const;
81
82         ARDOUR::AutomationList::iterator model() const { return _model; }
83         AutomationLine&                  line()  const { return _line; }
84
85         static PBD::Signal1<void, ControlPoint *> CatchDeletion;
86
87 private:
88         ArdourCanvas::Rectangle*        _item;
89         AutomationLine&                  _line;
90         ARDOUR::AutomationList::iterator _model;
91         uint32_t                         _view_index;
92         bool                             _can_slide;
93         double                           _x;
94         double                           _y;
95         double                           _size;
96         ShapeType                        _shape;
97
98         virtual bool event_handler (GdkEvent*);
99
100 };
101
102
103 #endif /* __ardour_control_point_h__ */
104