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/ringbuffer.h"
11 #include "pbd/signals.h"
13 #include "ardour/types.h"
14 #include "control_protocol/types.h"
16 #include "control_group.h"
18 #include "mackie_control_protocol.h"
19 #include "midi_byte_array.h"
20 #include "device_info.h"
28 namespace ArdourSurface {
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::Stripable> stripable() const { return _stripable; }
58 void add (Control & control);
59 int index() const { return _index; } // zero based
60 Surface* surface() const { return _surface; }
62 void set_stripable (boost::shared_ptr<ARDOUR::Stripable>, bool with_messages = true);
64 // call all signal handlers manually
67 void handle_button (Button&, ButtonState bs);
68 void handle_fader (Fader&, float position);
69 void handle_fader_touch (Fader&, bool touch_on);
70 void handle_pot (Pot&, float delta);
72 void periodic (ARDOUR::microseconds_t now_usecs);
73 void redisplay (ARDOUR::microseconds_t now_usecs, bool force = true);
75 MidiByteArray display (uint32_t line_number, const std::string&);
76 MidiByteArray blank_display (uint32_t line_number);
80 void flip_mode_changed ();
81 void subview_mode_changed ();
83 void lock_controls ();
84 void unlock_controls ();
85 bool locked() const { return _controls_locked; }
87 void notify_metering_state_changed();
89 void block_screen_display_for (uint32_t msecs);
90 void block_vpot_mode_display_for (uint32_t msecs);
93 enum VPotDisplayMode {
103 Button* _fader_touch;
109 bool _controls_locked;
110 bool _transport_is_rolling;
111 bool _metering_active;
112 std::string pending_display[2];
113 std::string current_display[2];
114 uint64_t _block_screen_redisplay_until;
115 uint64_t return_to_vpot_mode_display_at;
116 boost::shared_ptr<ARDOUR::Stripable> _stripable;
117 PBD::ScopedConnectionList stripable_connections;
118 PBD::ScopedConnectionList subview_connections;
119 PBD::ScopedConnectionList send_connections;
122 ARDOUR::AutomationType _pan_mode;
124 float _last_gain_position_written;
125 float _last_pan_azi_position_written;
126 float _last_pan_width_position_written;
127 float _last_trim_position_written;
129 void notify_solo_changed ();
130 void notify_mute_changed ();
131 void notify_record_enable_changed ();
132 void notify_gain_changed (bool force_update = true);
133 void notify_property_changed (const PBD::PropertyChange&);
134 void notify_panner_azi_changed (bool force_update = true);
135 void notify_panner_width_changed (bool force_update = true);
136 void notify_stripable_deleted ();
137 void notify_processor_changed (bool force_update = true);
138 void update_automation ();
139 void update_meter ();
140 std::string vpot_mode_string ();
142 boost::shared_ptr<ARDOUR::AutomationControl> mb_pan_controllable;
144 void return_to_vpot_mode_display ();
145 void next_pot_mode ();
147 void do_parameter_display (ARDOUR::AutomationType, float val);
148 void select_event (Button&, ButtonState);
149 void vselect_event (Button&, ButtonState);
150 void fader_touch_event (Button&, ButtonState);
152 std::vector<ARDOUR::AutomationType> possible_pot_parameters;
153 std::vector<ARDOUR::AutomationType> possible_trim_parameters;
154 void set_vpot_parameter (ARDOUR::AutomationType);
155 void show_stripable_name ();
157 void reset_saved_values ();
159 bool is_midi_track () const;
161 void notify_eq_change (ARDOUR::AutomationType, uint32_t band, bool force);
162 void setup_eq_vpot (boost::shared_ptr<ARDOUR::Stripable>);
164 void notify_dyn_change (ARDOUR::AutomationType, bool force, bool propagate_mode_change);
165 void setup_dyn_vpot (boost::shared_ptr<ARDOUR::Stripable>);
167 void notify_send_level_change (ARDOUR::AutomationType, uint32_t band, bool force);
168 void setup_sends_vpot (boost::shared_ptr<ARDOUR::Stripable>);
170 void notify_trackview_change (ARDOUR::AutomationType, uint32_t band, bool force);
171 void setup_trackview_vpot (boost::shared_ptr<ARDOUR::Stripable>);
177 #endif /* __ardour_mackie_control_protocol_strip_h__ */