X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fsurfaces%2Fmackie%2Fcontrols.h;h=c53be76891df4d3d7fb18cf7e5949ed927cae89a;hb=4c13018656b2c655025c733a4056b53c3a93e941;hp=71f2b57c8f4a64f6fda4da662746c35e9a3eeb34;hpb=753096ec18163e38035062d7ecf9f3a2ef410000;p=ardour.git diff --git a/libs/surfaces/mackie/controls.h b/libs/surfaces/mackie/controls.h index 71f2b57c8f..c53be76891 100644 --- a/libs/surfaces/mackie/controls.h +++ b/libs/surfaces/mackie/controls.h @@ -25,51 +25,39 @@ #include #include +#include + +#include "pbd/controllable.h" #include "pbd/signals.h" #include "mackie_control_exception.h" #include "midi_byte_array.h" -namespace Mackie -{ +namespace ARDOUR { + class AutomationControl; +} + +namespace ArdourSurface { + +namespace Mackie { class Strip; class Group; class Surface; -class Control -{ +class Control { public: - enum base_id_t { - /* ID's associated with pot (Controller) messages */ - pot_base_id = 0x30, - jog_base_id = 0x3c, - /* ID's associated with button (NoteOn) messages */ - recenable_button_base_id = 0x0, - solo_button_base_id = 0x08, - mute_button_base_id = 0x10, - select_button_base_id = 0x18, - vselect_button_base_id = 0x20, - fader_touch_button_base_id = 0xe0, - }; - Control (int id, std::string name, Group& group); virtual ~Control() {} - - /// the value of the second bytes of the message. It's - /// the id of the control, but only guaranteed to be - /// unique within the control type. - int raw_id() const { return _id; } + int id() const { return _id; } const std::string & name() const { return _name; } Group & group() const { return _group; } - virtual bool accepts_feedback() const { return true; } - bool in_use () const; void set_in_use (bool); - - /// Keep track of the timeout so it can be updated with more incoming events + + // Keep track of the timeout so it can be updated with more incoming events sigc::connection in_use_connection; virtual MidiByteArray zero() = 0; @@ -79,15 +67,28 @@ public: */ Control* in_use_touch_control; -private: - int _id; + boost::shared_ptr control () const { return normal_ac; } + virtual void set_control (boost::shared_ptr); + + float get_value (); + void set_value (float val, PBD::Controllable::GroupControlDisposition gcd = PBD::Controllable::UseGroup); + + virtual void start_touch (double when); + virtual void stop_touch (bool mark, double when); + + protected: + boost::shared_ptr normal_ac; + + private: + int _id; /* possibly device-dependent ID */ std::string _name; Group& _group; bool _in_use; }; -std::ostream & operator << (std::ostream & os, const Control & control); - } +} + +std::ostream & operator << (std::ostream & os, const ArdourSurface::Mackie::Control & control); #endif /* __mackie_controls_h__ */