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 "ardour/types.h"
11 #include "control_protocol/types.h"
13 #include "control_group.h"
15 #include "midi_byte_array.h"
16 #include "device_info.h"
34 struct StripControlDefinition {
37 Control* (*factory)(Surface&, int index, const char* name, Group&);
40 struct GlobalControlDefinition {
43 Control* (*factory)(Surface&, int index, const char* name, Group&);
44 const char* group_name;
48 This is the set of controls that make up a strip.
50 class Strip : public Group
53 Strip (Surface&, const std::string & name, int index, const std::map<Button::ID,StripButtonInfo>&);
56 boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
58 void add (Control & control);
59 int index() const { return _index; } // zero based
61 void set_route (boost::shared_ptr<ARDOUR::Route>);
63 // call all signal handlers manually
66 void handle_button (Button&, ButtonState bs);
67 void handle_fader (Fader&, float position);
68 void handle_pot (Pot&, float delta);
70 void periodic (uint64_t now_usecs);
72 MidiByteArray display (uint32_t line_number, const std::string&);
73 MidiByteArray blank_display (uint32_t line_number);
74 MidiByteArray zero ();
76 void flip_mode_changed (bool notify=false);
78 void lock_controls ();
79 void unlock_controls ();
81 MidiByteArray gui_selection_changed (ARDOUR::RouteNotificationListPtr);
108 Button* _fader_touch;
111 PotMode _preflip_vpot_mode;
116 bool _controls_locked;
117 uint64_t _reset_display_at;
118 boost::shared_ptr<ARDOUR::Route> _route;
119 PBD::ScopedConnectionList route_connections;
121 float _last_gain_position_written;
122 float _last_pan_position_written;
124 void notify_solo_changed ();
125 void notify_mute_changed ();
126 void notify_record_enable_changed ();
127 void notify_gain_changed (bool force_update = true);
128 void notify_property_changed (const PBD::PropertyChange&);
129 void notify_panner_azi_changed (bool force_update = true);
130 void notify_panner_width_changed (bool force_update = true);
131 void notify_active_changed ();
132 void notify_route_deleted ();
134 void update_automation ();
135 void update_meter ();
137 std::string vpot_mode_string () const;
139 void queue_display_reset (uint32_t msecs);
140 void clear_display_reset ();
141 void reset_display ();
142 void do_parameter_display (ARDOUR::AutomationType, float val);
144 typedef std::map<std::string,boost::shared_ptr<ARDOUR::Bundle> > BundleMap;
145 BundleMap input_bundles;
146 BundleMap output_bundles;
148 void build_input_list (const ARDOUR::ChanCount&);
149 void build_output_list (const ARDOUR::ChanCount&);
150 void maybe_add_to_bundle_map (BundleMap& bm, boost::shared_ptr<ARDOUR::Bundle>, bool for_input, const ARDOUR::ChanCount&);
152 void select_event (Button&, ButtonState);
153 void vselect_event (Button&, ButtonState);
154 void fader_touch_event (Button&, ButtonState);
156 std::vector<PotMode> current_pot_modes;
157 void next_pot_mode ();
158 void set_vpot_mode (PotMode);
163 #endif /* __ardour_mackie_control_protocol_strip_h__ */