Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
23 
24 #include <sys/types.h>
25 #include <gdk/gdkevents.h>
26 
27 #include "ardour/automation_list.h"
28 
29 #include "selectable.h"
30 
31 class AutomationLine;
32 class ControlPoint;
33 class PointSelection;
34 class TimeAxisView;
36 class Selectable;
37 class Selection;
38 
39 namespace ArdourCanvas {
40  class Rectangle;
41  class Diamond;
42  class Item;
43 }
44 
45 class ControlPoint : public Selectable
46 {
47 public:
49  ControlPoint (const ControlPoint&, bool dummy_arg_to_force_special_copy_constructor);
50  virtual ~ControlPoint ();
51 
52  enum ShapeType {
55  End
56  };
57 
58  void move_to (double x, double y);
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 
81 
82  /* used from ~EditorAutomationLine */
83  void unset_item () { _item = 0 ; }
84 
86  AutomationLine& line() const { return _line; }
87 
89 
90 private:
94  uint32_t _view_index;
95  bool _can_slide;
96  double _x;
97  double _y;
98  double _size;
100 
101  virtual bool event_handler (GdkEvent*);
102 
103 };
104 
105 
106 
bool can_slide() const
Definition: control_point.h:75
AutomationLine & line() const
Definition: control_point.h:86
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:91
ARDOUR::AutomationList::iterator model() const
Definition: control_point.h:85
AutomationLine & _line
Definition: control_point.h:92
void set_size(double)
virtual ~ControlPoint()
virtual bool event_handler(GdkEvent *)
ShapeType _shape
Definition: control_point.h:99
ControlPoint(AutomationLine &al)
void set_can_slide(bool yn)
Definition: control_point.h:76
double get_y() const
Definition: control_point.h:62
uint32_t view_index() const
Definition: control_point.h:77
void set_color()
void unset_item()
Definition: control_point.h:83
double size() const
Definition: control_point.h:68
void set_view_index(uint32_t i)
Definition: control_point.h:78
uint32_t _view_index
Definition: control_point.h:94
double get_x() const
Definition: control_point.h:61
ARDOUR::AutomationList::iterator _model
Definition: control_point.h:93
static PBD::Signal< void(ControlPoint *)> CatchDeletion
Definition: control_point.h:88
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.