1 #ifndef __ardour_mackie_control_protocol_strip_h__
2 #define __ardour_mackie_control_protocol_strip_h__
7 #include "evoral/Parameter.hpp"
9 #include "pbd/property_basics.h"
10 #include "pbd/signals.h"
12 #include "ardour/types.h"
13 #include "control_protocol/types.h"
15 #include "control_group.h"
17 #include "midi_byte_array.h"
18 #include "device_info.h"
36 struct GlobalControlDefinition {
39 Control* (*factory)(Surface&, int index, const char* name, Group&);
40 const char* group_name;
44 This is the set of controls that make up a strip.
46 class Strip : public Group
49 Strip (Surface&, const std::string & name, int index, const std::map<Button::ID,StripButtonInfo>&);
52 boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
54 void add (Control & control);
55 int index() const { return _index; } // zero based
57 void set_route (boost::shared_ptr<ARDOUR::Route>, bool with_messages = true);
59 // call all signal handlers manually
62 void handle_button (Button&, ButtonState bs);
63 void handle_fader (Fader&, float position);
64 void handle_fader_touch (Fader&, bool touch_on);
65 void handle_pot (Pot&, float delta);
67 void periodic (uint64_t now_usecs);
69 MidiByteArray display (uint32_t line_number, const std::string&);
70 MidiByteArray blank_display (uint32_t line_number);
74 void flip_mode_changed (bool notify=false);
76 void lock_controls ();
77 void unlock_controls ();
78 bool locked() const { return _controls_locked; }
80 void gui_selection_changed (const ARDOUR::StrongRouteNotificationList&);
82 void notify_metering_state_changed();
96 bool _controls_locked;
97 bool _transport_is_rolling;
98 bool _metering_active;
99 uint64_t _reset_display_at;
100 boost::shared_ptr<ARDOUR::Route> _route;
101 PBD::ScopedConnectionList route_connections;
103 float _last_gain_position_written;
104 float _last_pan_azi_position_written;
105 float _last_pan_width_position_written;
107 void notify_solo_changed ();
108 void notify_mute_changed ();
109 void notify_record_enable_changed ();
110 void notify_gain_changed (bool force_update = true);
111 void notify_property_changed (const PBD::PropertyChange&);
112 void notify_panner_azi_changed (bool force_update = true);
113 void notify_panner_width_changed (bool force_update = true);
114 void notify_active_changed ();
115 void notify_route_deleted ();
117 void update_automation ();
118 void update_meter ();
120 std::string vpot_mode_string () const;
122 void queue_display_reset (uint32_t msecs);
123 void clear_display_reset ();
124 void reset_display ();
125 void do_parameter_display (ARDOUR::AutomationType, float val);
127 typedef std::map<std::string,boost::shared_ptr<ARDOUR::Bundle> > BundleMap;
128 BundleMap input_bundles;
129 BundleMap output_bundles;
131 void build_input_list (const ARDOUR::ChanCount&);
132 void build_output_list (const ARDOUR::ChanCount&);
133 void maybe_add_to_bundle_map (BundleMap& bm, boost::shared_ptr<ARDOUR::Bundle>, bool for_input, const ARDOUR::ChanCount&);
135 void select_event (Button&, ButtonState);
136 void vselect_event (Button&, ButtonState);
137 void fader_touch_event (Button&, ButtonState);
139 std::vector<Evoral::Parameter> possible_pot_parameters;
140 void next_pot_mode ();
141 void set_vpot_parameter (Evoral::Parameter);
143 void reset_saved_values ();
145 std::map<Evoral::Parameter,Control*> control_by_parameter;
150 #endif /* __ardour_mackie_control_protocol_strip_h__ */