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/container.h"
13 namespace ArdourCanvas {
18 class AutomationControl;
26 namespace ArdourSurface {
30 class Push2Knob : public sigc::trackable, public ArdourCanvas::Container
48 Push2Knob (Push2& p, ArdourCanvas::Item*, Element e = default_elements, Flags flags = NoFlags);
49 virtual ~Push2Knob ();
51 static Element default_elements;
53 void add_flag (Flags);
54 void remove_flag (Flags);
56 void set_controllable (boost::shared_ptr<ARDOUR::AutomationControl> c);
57 boost::shared_ptr<ARDOUR::AutomationControl> controllable() const { return _controllable; }
59 void set_text_color (Gtkmm2ext::Color);
60 void set_arc_start_color (Gtkmm2ext::Color);
61 void set_arc_end_color (Gtkmm2ext::Color);
62 void set_radius (double r);
64 void render (ArdourCanvas::Rect const &, Cairo::RefPtr<Cairo::Context>) const;
65 void compute_bounding_box() const;
68 void controllable_changed ();
69 PBD::ScopedConnection watch_connection;
70 boost::shared_ptr<ARDOUR::AutomationControl> _controllable;
77 float _val; // current value [0..1]
78 float _normal; // default value, arc
80 Gtkmm2ext::Color text_color;
81 Gtkmm2ext::Color arc_start_color;
82 Gtkmm2ext::Color arc_end_color;
83 ArdourCanvas::Text* text;
85 void set_pan_azimuth_text (double);
86 void set_pan_width_text (double);
87 void set_gain_text (double);
92 #endif /* __ardour_push2_knob_h__ */