Ardour  8.12
control_point.h
Go to the documentation of this file.
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;
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:
50  ControlPoint (const ControlPoint&, bool dummy_arg_to_force_special_copy_constructor);
51  virtual ~ControlPoint ();
52 
53  enum ShapeType {
56  End
57  };
58 
59  void move_to (double x, double y);
60  void move_to (double x, double y, ShapeType);
61  void reset (double x, double y, ARDOUR::AutomationList::iterator, uint32_t, ShapeType);
62  double get_x() const { return _x; }
63  double get_y() const { return _y; }
64 
65  void hide ();
66  void show ();
67  bool visible () const;
68 
69  double size () const {
70  return _size;
71  }
72 
73  void set_size (double);
74  void set_color ();
75 
76  bool can_slide() const { return _can_slide; }
77  void set_can_slide(bool yn) { _can_slide = yn; }
78  uint32_t view_index() const { return _view_index; }
79  void set_view_index(uint32_t i) { _view_index = i; }
80 
82 
83  /* used from ~AutomationLine */
84  void unset_item () { _item = 0 ; }
85 
87  AutomationLine& line() const { return _line; }
88 
89  static PBD::Signal1<void, ControlPoint *> CatchDeletion;
90 
91 private:
95  uint32_t _view_index;
96  bool _can_slide;
97  double _x;
98  double _y;
99  double _size;
101 
102  virtual bool event_handler (GdkEvent*);
103 
104 };
105 
106 
107 #endif /* __ardour_control_point_h__ */
108 
bool can_slide() const
Definition: control_point.h:76
AutomationLine & line() const
Definition: control_point.h:87
void move_to(double x, double y, ShapeType)
bool visible() const
void move_to(double x, double y)
ArdourCanvas::Item & item() const
ArdourCanvas::Rectangle * _item
Definition: control_point.h:92
ARDOUR::AutomationList::iterator model() const
Definition: control_point.h:86
AutomationLine & _line
Definition: control_point.h:93
void set_size(double)
virtual ~ControlPoint()
virtual bool event_handler(GdkEvent *)
ShapeType _shape
ControlPoint(AutomationLine &al)
void set_can_slide(bool yn)
Definition: control_point.h:77
double get_y() const
Definition: control_point.h:63
uint32_t view_index() const
Definition: control_point.h:78
void set_color()
void unset_item()
Definition: control_point.h:84
double size() const
Definition: control_point.h:69
static PBD::Signal1< void, ControlPoint * > CatchDeletion
Definition: control_point.h:89
void set_view_index(uint32_t i)
Definition: control_point.h:79
uint32_t _view_index
Definition: control_point.h:95
double get_x() const
Definition: control_point.h:62
ARDOUR::AutomationList::iterator _model
Definition: control_point.h:94
void reset(double x, double y, ARDOUR::AutomationList::iterator, uint32_t, ShapeType)
ControlPoint(const ControlPoint &, bool dummy_arg_to_force_special_copy_constructor)
EventList::iterator iterator
Definition: ControlList.h:93
Lists of selected things.