1 #ifndef __ardour_mackie_control_protocol_strip_h__
2 #define __ardour_mackie_control_protocol_strip_h__
7 #include "pbd/property_basics.h"
8 #include "pbd/signals.h"
10 #include "control_group.h"
12 #include "midi_byte_array.h"
28 struct StripControlDefinition {
31 Control* (*factory)(Surface&, int index, const char* name, Group&);
34 struct GlobalControlDefinition {
37 Control* (*factory)(Surface&, int index, const char* name, Group&);
38 const char* group_name;
42 This is the set of controls that make up a strip.
44 class Strip : public Group
47 Strip (Surface&, const std::string & name, int index, StripControlDefinition* ctls);
50 boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
52 void add (Control & control);
53 int index() const { return _index; } // zero based
60 Button & fader_touch();
65 bool has_solo() const { return _solo != 0; }
66 bool has_recenable() const { return _recenable != 0; }
67 bool has_mute() const { return _mute != 0; }
68 bool has_select() const { return _select != 0; }
69 bool has_vselect() const { return _vselect != 0; }
70 bool has_fader_touch() const { return _fader_touch != 0; }
71 bool has_vpot() const { return _vpot != 0; }
72 bool has_gain() const { return _gain != 0; }
73 bool has_meter() const { return _meter != 0; }
75 void set_route (boost::shared_ptr<ARDOUR::Route>);
77 // call all signal handlers manually
80 void handle_button (Button&, ButtonState bs);
81 void handle_fader (Fader&, float position);
82 void handle_pot (Pot&, ControlState&);
86 MidiByteArray display (uint32_t line_number, const std::string&);
87 MidiByteArray blank_display (uint32_t line_number);
88 MidiByteArray zero ();
103 boost::shared_ptr<ARDOUR::Route> _route;
104 PBD::ScopedConnectionList route_connections;
106 // Last written values for the gain and pan, to avoid overloading
107 // the midi connection to the surface
108 float _last_gain_written;
109 MidiByteArray _last_pan_written;
112 void notify_solo_changed ();
113 void notify_mute_changed ();
114 void notify_record_enable_changed ();
115 void notify_gain_changed (bool force_update = true);
116 void notify_property_changed (const PBD::PropertyChange&);
117 void notify_panner_changed (bool force_update = true);
118 void notify_active_changed ();
119 void notify_route_deleted ();
121 void update_automation ();
122 void update_meter ();
126 std::ostream & operator << (std::ostream &, const Strip &);
130 #endif /* __ardour_mackie_control_protocol_strip_h__ */