1 #ifndef __ardour_push2_knob_h__
2 #define __ardour_push2_knob_h__
4 #include <boost/shared_ptr.hpp>
5 #include <sigc++/trackable.h>
7 #include <cairomm/refptr.h>
9 #include "pbd/signals.h"
11 #include "canvas/item.h"
12 #include "canvas/text.h"
15 class AutomationControl;
23 namespace ArdourSurface {
27 class Push2Knob : public sigc::trackable, public ArdourCanvas::Item
45 Push2Knob (Push2& p, ArdourCanvas::Item*, Element e = default_elements, Flags flags = NoFlags);
46 virtual ~Push2Knob ();
48 static Element default_elements;
50 void add_flag (Flags);
51 void remove_flag (Flags);
53 void set_controllable (boost::shared_ptr<ARDOUR::AutomationControl> c);
54 boost::shared_ptr<ARDOUR::AutomationControl> controllable() const { return _controllable; }
56 void set_text_color (ArdourCanvas::Color);
57 void set_arc_start_color (ArdourCanvas::Color);
58 void set_arc_end_color (ArdourCanvas::Color);
59 void set_position (double x, double y);
60 void set_radius (double r);
62 void render (ArdourCanvas::Rect const &, Cairo::RefPtr<Cairo::Context>) const;
63 void compute_bounding_box() const;
66 void controllable_changed ();
67 PBD::ScopedConnection watch_connection;
68 boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
75 float _val; // current value [0..1]
76 float _normal; // default value, arc
78 ArdourCanvas::Color text_color;
79 ArdourCanvas::Color arc_start_color;
80 ArdourCanvas::Color arc_end_color;
81 ArdourCanvas::Text text;
83 void set_pan_azimuth_text (double);
84 void set_pan_width_text (double);
85 void set_gain_text (double);
90 #endif /* __ardour_push2_knob_h__ */