1 #ifndef __ardour_mackie_control_protocol_strip_h__
2 #define __ardour_mackie_control_protocol_strip_h__
7 #include "pbd/property_basics.h"
9 #include "control_group.h"
10 #include "mackie_midi_builder.h"
25 struct StripControlDefinition {
28 Control* (*factory)(Surface&, int index, const char* name, Group&);
31 struct GlobalControlDefinition {
34 Control* (*factory)(Surface&, int index, const char* name, Group&);
35 const char* group_name;
39 This is the set of controls that make up a strip.
41 class Strip : public Group
44 Strip (Surface&, const std::string & name, int index, StripControlDefinition* ctls);
47 boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
49 void add (Control & control);
50 int index() const { return _index; } // zero based
57 Button & fader_touch();
62 bool has_solo() const { return _solo != 0; }
63 bool has_recenable() const { return _recenable != 0; }
64 bool has_mute() const { return _mute != 0; }
65 bool has_select() const { return _select != 0; }
66 bool has_vselect() const { return _vselect != 0; }
67 bool has_fader_touch() const { return _fader_touch != 0; }
68 bool has_vpot() const { return _vpot != 0; }
69 bool has_gain() const { return _gain != 0; }
70 bool has_meter() const { return _meter != 0; }
72 void set_route (boost::shared_ptr<ARDOUR::Route>);
74 // call all signal handlers manually
77 bool handle_button (SurfacePort & port, Control & control, ButtonState bs);
94 MackieMidiBuilder builder;
96 boost::shared_ptr<ARDOUR::Route> _route;
97 PBD::ScopedConnectionList route_connections;
99 // Last written values for the gain and pan, to avoid overloading
100 // the midi connection to the surface
101 float _last_gain_written;
102 MidiByteArray _last_pan_written;
105 void notify_solo_changed ();
106 void notify_mute_changed ();
107 void notify_record_enable_changed ();
108 void notify_gain_changed (bool force_update = true);
109 void notify_property_changed (const PBD::PropertyChange&);
110 void notify_panner_changed (bool force_update = true);
111 void notify_active_changed ();
112 void notify_route_deleted ();
114 void update_automation ();
115 void update_meter ();
119 std::ostream & operator << (std::ostream &, const Strip &);
123 #endif /* __ardour_mackie_control_protocol_strip_h__ */