#include <string>
#include <stdint.h>
+#include <boost/smart_ptr.hpp>
+
+#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;
*/
Control* in_use_touch_control;
-private:
- int _id;
+ boost::shared_ptr<ARDOUR::AutomationControl> control () const { return normal_ac; }
+ virtual void set_control (boost::shared_ptr<ARDOUR::AutomationControl>);
+
+ 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 (double when);
+
+ protected:
+ boost::shared_ptr<ARDOUR::AutomationControl> 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__ */