fix math bug with numthreads computation
[ardour2.git] / gtk2_ardour / control_point.h
blob0264015f93b0210d96de648d11e22b02757d7297
1 /*
2 Copyright (C) 2002-2007 Paul Davis
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.
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.
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.
20 #ifndef __ardour_control_point_h__
21 #define __ardour_control_point_h__
23 #include <sys/types.h>
25 #include "ardour/automation_list.h"
27 #include "canvas.h"
28 #include "simplerect.h"
30 class AutomationLine;
31 class ControlPoint;
32 class PointSelection;
33 class TimeAxisView;
34 class AutomationTimeAxisView;
35 class Selectable;
36 class Selection;
38 namespace Gnome {
39 namespace Canvas {
40 class SimpleRect;
41 class Diamond;
45 class ControlPoint
47 public:
48 ControlPoint (AutomationLine& al);
49 ControlPoint (const ControlPoint&, bool dummy_arg_to_force_special_copy_constructor);
50 virtual ~ControlPoint ();
52 enum ShapeType {
53 Full,
54 Start,
55 End
58 void move_to (double x, double y, ShapeType);
59 void reset (double x, double y, ARDOUR::AutomationList::iterator, uint32_t, ShapeType);
60 double get_x() const { return _x; }
61 double get_y() const { return _y; }
63 void hide ();
64 void show ();
65 void set_color ();
67 double size () const {
68 return _size;
71 void set_size (double);
72 void set_visible (bool);
73 bool visible () const;
75 bool can_slide() const { return _can_slide; }
76 void set_can_slide(bool yn) { _can_slide = yn; }
77 bool selected() const { return _selected; }
78 void set_selected(bool yn) { _selected = yn; }
79 uint32_t view_index() const { return _view_index; }
80 void set_view_index(uint32_t i) { _view_index = i; }
82 void i2w (double &, double &) const;
84 ARDOUR::AutomationList::iterator model() const { return _model; }
85 AutomationLine& line() const { return _line; }
87 private:
88 ArdourCanvas::SimpleRect* _item;
90 AutomationLine& _line;
92 ARDOUR::AutomationList::iterator _model;
93 uint32_t _view_index;
94 bool _can_slide;
95 bool _selected;
97 virtual bool event_handler (GdkEvent*);
99 double _x;
100 double _y;
101 double _size;
102 ShapeType _shape;
106 #endif /* __ardour_control_point_h__ */