X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fsurfaces%2Fmackie%2Fcontrols.h;h=38dad7ef7fa31297fd5d9c54661b30d95601df7c;hb=e466ce40ad1ba591543020cb7c0aa15dbebef81e;hp=a87dc46cbfff763d8466cc0936b3349726bef8b1;hpb=aa22f85c1be958f6d6e6ec4d1010ba4b41e0cbe9;p=ardour.git diff --git a/libs/surfaces/mackie/controls.h b/libs/surfaces/mackie/controls.h index a87dc46cbf..38dad7ef7f 100644 --- a/libs/surfaces/mackie/controls.h +++ b/libs/surfaces/mackie/controls.h @@ -25,65 +25,33 @@ #include #include +#include + #include "pbd/signals.h" #include "mackie_control_exception.h" +#include "midi_byte_array.h" + +namespace ARDOUR { + class AutomationControl; +} namespace Mackie { class Strip; class Group; -class Led; class Surface; class Control { public: - enum type_t { - type_led, - type_led_ring, - type_fader = 0xe0, - type_button = 0x90, - type_pot = 0xb0, - type_meter = 0xd0 - }; - - enum base_id_t { - fader_base_id = 0x0, - pot_base_id = 0x10, - jog_base_id = 0x3c, - fader_touch_button_base_id = 0xe0, - vselect_button_base_id = 0x20, - select_button_base_id = 0x18, - mute_button_base_id = 0x10, - solo_button_base_id = 0x08, - recenable_button_base_id = 0x0, - meter_base_id = 0xd0, - }; - Control (int id, std::string name, Group& group); virtual ~Control() {} - virtual const Led & led() const { throw MackieControlException ("no led available"); } - - /// type() << 8 + midi id of the control. This - /// provides a unique id for any control on the surface. - int id() const { return (type() << 8) + _id; } - - /// 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; } - - virtual type_t type() const = 0; - - /// Return true if this control is the one and only Jog Wheel - virtual bool is_jog() const { return false; } bool in_use () const; void set_in_use (bool); @@ -91,13 +59,27 @@ public: /// Keep track of the timeout so it can be updated with more incoming events sigc::connection in_use_connection; + virtual MidiByteArray zero() = 0; + /** If we are doing an in_use timeout for a fader without touch, this * is its touch button control; otherwise 0. */ 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); + + virtual void start_touch (double when); + virtual void stop_touch (double when, bool mark); + + protected: + boost::shared_ptr normal_ac; + + private: + int _id; /* possibly device-dependent ID */ std::string _name; Group& _group; bool _in_use;