ardour
control_point.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2007 Paul Davis
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __ardour_control_point_h__
21 #define __ardour_control_point_h__
22 
23 #include <sys/types.h>
24 #include <gdk/gdkevents.h>
25 
26 #include "ardour/automation_list.h"
27 
28 #include "selectable.h"
29 
30 class AutomationLine;
31 class ControlPoint;
32 class PointSelection;
33 class TimeAxisView;
35 class Selectable;
36 class Selection;
37 
38 namespace ArdourCanvas {
39  class Rectangle;
40  class Diamond;
41  class Item;
42 }
43 
44 class ControlPoint : public Selectable
45 {
46  public:
48  ControlPoint (const ControlPoint&, bool dummy_arg_to_force_special_copy_constructor);
49  virtual ~ControlPoint ();
50 
51  enum ShapeType {
55  };
56 
57  void move_to (double x, double y, ShapeType);
58  void reset (double x, double y, ARDOUR::AutomationList::iterator, uint32_t, ShapeType);
59  double get_x() const { return _x; }
60  double get_y() const { return _y; }
61 
62  void hide ();
63  void show ();
64  bool visible () const;
65 
66  double size () const {
67  return _size;
68  }
69 
70  void set_size (double);
71  void set_color ();
72 
73  bool can_slide() const { return _can_slide; }
74  void set_can_slide(bool yn) { _can_slide = yn; }
75  uint32_t view_index() const { return _view_index; }
76  void set_view_index(uint32_t i) { _view_index = i; }
77 
78  ArdourCanvas::Item& item() const;
79 
81  AutomationLine& line() const { return _line; }
82 
83  static PBD::Signal1<void, ControlPoint *> CatchDeletion;
84 
85  private:
86  ArdourCanvas::Rectangle* _item;
89  uint32_t _view_index;
90  bool _can_slide;
91  double _x;
92  double _y;
93  double _size;
95 
96  virtual bool event_handler (GdkEvent*);
97 
98 };
99 
100 
101 #endif /* __ardour_control_point_h__ */
102 
uint32_t _view_index
Definition: control_point.h:89
bool can_slide() const
Definition: control_point.h:73
AutomationLine & line() const
Definition: control_point.h:81
Lists of selected things.
Definition: selection.h:66
void reset(double x, double y, ARDOUR::AutomationList::iterator, uint32_t, ShapeType)
uint32_t view_index() const
Definition: control_point.h:75
double get_x() const
Definition: control_point.h:59
void move_to(double x, double y, ShapeType)
bool visible() const
static PBD::Signal1< void, ControlPoint * > CatchDeletion
Definition: control_point.h:83
ControlPoint(AutomationLine &al)
ArdourCanvas::Item & item() const
virtual bool event_handler(GdkEvent *)
AutomationLine & _line
Definition: control_point.h:87
void set_size(double)
void set_view_index(uint32_t i)
Definition: control_point.h:76
ARDOUR::AutomationList::iterator _model
Definition: control_point.h:88
virtual ~ControlPoint()
ShapeType _shape
Definition: control_point.h:94
ArdourCanvas::Rectangle * _item
Definition: control_point.h:86
ARDOUR::AutomationList::iterator model() const
Definition: control_point.h:80
void set_can_slide(bool yn)
Definition: control_point.h:74
double get_y() const
Definition: control_point.h:60
EventList::iterator iterator
Definition: ControlList.hpp:82
double size() const
Definition: control_point.h:66