Mackie Control: Don't show hidden routes.
[ardour.git] / libs / surfaces / mackie / controls.h
index f946f1507dd8db863cd6e274eb332b1ba4acab5d..38eb30fb65d7a1f7598876a146ea3e7e10665e32 100644 (file)
 #include <string>
 #include <stdint.h>
 
+#include <boost/smart_ptr.hpp>
+
 #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 {
-               fader_base_id = 0xe0,
-               pot_base_id = 0x30,
-               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() {}
-       
-       /// 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 +66,28 @@ public:
         */
        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);
+
+       virtual void start_touch (double when);
+       virtual void stop_touch (bool mark, 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__ */