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>
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.
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.
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.
22 #ifndef __ardour_control_point_h__
23 #define __ardour_control_point_h__
25 #include <sys/types.h>
26 #include <gdk/gdkevents.h>
28 #include "ardour/automation_list.h"
30 #include "selectable.h"
36 class AutomationTimeAxisView;
40 namespace ArdourCanvas {
46 class ControlPoint : public Selectable
49 ControlPoint (AutomationLine& al);
50 ControlPoint (const ControlPoint&, bool dummy_arg_to_force_special_copy_constructor);
51 virtual ~ControlPoint ();
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; }
66 bool visible () const;
68 double size () const {
72 void set_size (double);
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; }
80 ArdourCanvas::Item& item() const;
82 ARDOUR::AutomationList::iterator model() const { return _model; }
83 AutomationLine& line() const { return _line; }
85 static PBD::Signal1<void, ControlPoint *> CatchDeletion;
88 ArdourCanvas::Rectangle* _item;
89 AutomationLine& _line;
90 ARDOUR::AutomationList::iterator _model;
98 virtual bool event_handler (GdkEvent*);
103 #endif /* __ardour_control_point_h__ */