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>, bool with_messages = true);
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);
77 void flip_mode_changed (bool notify=false);
79 void lock_controls ();
80 void unlock_controls ();
82 MidiByteArray gui_selection_changed (ARDOUR::RouteNotificationListPtr);
109 Button* _fader_touch;
112 PotMode _preflip_vpot_mode;
117 bool _controls_locked;
118 uint64_t _reset_display_at;
119 boost::shared_ptr<ARDOUR::Route> _route;
120 PBD::ScopedConnectionList route_connections;
122 float _last_gain_position_written;
123 float _last_pan_position_written;
125 void notify_solo_changed ();
126 void notify_mute_changed ();
127 void notify_record_enable_changed ();
128 void notify_gain_changed (bool force_update = true);
129 void notify_property_changed (const PBD::PropertyChange&);
130 void notify_panner_azi_changed (bool force_update = true);
131 void notify_panner_width_changed (bool force_update = true);
132 void notify_active_changed ();
133 void notify_route_deleted ();
135 void update_automation ();
136 void update_meter ();
138 std::string vpot_mode_string () const;
140 void queue_display_reset (uint32_t msecs);
141 void clear_display_reset ();
142 void reset_display ();
143 void do_parameter_display (ARDOUR::AutomationType, float val);
145 typedef std::map<std::string,boost::shared_ptr<ARDOUR::Bundle> > BundleMap;
146 BundleMap input_bundles;
147 BundleMap output_bundles;
149 void build_input_list (const ARDOUR::ChanCount&);
150 void build_output_list (const ARDOUR::ChanCount&);
151 void maybe_add_to_bundle_map (BundleMap& bm, boost::shared_ptr<ARDOUR::Bundle>, bool for_input, const ARDOUR::ChanCount&);
153 void select_event (Button&, ButtonState);
154 void vselect_event (Button&, ButtonState);
155 void fader_touch_event (Button&, ButtonState);
157 std::vector<PotMode> current_pot_modes;
158 void next_pot_mode ();
159 void set_vpot_mode (PotMode);
164 #endif /* __ardour_mackie_control_protocol_strip_h__ */