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 "midi_byte_array.h"
19 #include "device_info.h"
27 namespace ArdourSurface {
39 struct GlobalControlDefinition {
42 Control* (*factory)(Surface&, int index, const char* name, Group&);
43 const char* group_name;
47 This is the set of controls that make up a strip.
49 class Strip : public Group
52 Strip (Surface&, const std::string & name, int index, const std::map<Button::ID,StripButtonInfo>&);
55 boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
57 void add (Control & control);
58 int index() const { return _index; } // zero based
60 void set_route (boost::shared_ptr<ARDOUR::Route>, bool with_messages = true);
62 // call all signal handlers manually
65 void handle_button (Button&, ButtonState bs);
66 void handle_fader (Fader&, float position);
67 void handle_fader_touch (Fader&, bool touch_on);
68 void handle_pot (Pot&, float delta);
70 void periodic (uint64_t now_usecs);
73 MidiByteArray display (uint32_t line_number, const std::string&);
74 MidiByteArray blank_display (uint32_t line_number);
78 void flip_mode_changed (bool notify=false);
80 void lock_controls ();
81 void unlock_controls ();
82 bool locked() const { return _controls_locked; }
84 void gui_selection_changed (const ARDOUR::StrongRouteNotificationList&);
86 void notify_metering_state_changed();
100 bool _controls_locked;
101 bool _transport_is_rolling;
102 bool _metering_active;
103 uint64_t _reset_display_at;
104 boost::shared_ptr<ARDOUR::Route> _route;
105 PBD::ScopedConnectionList route_connections;
107 float _last_gain_position_written;
108 float _last_pan_azi_position_written;
109 float _last_pan_width_position_written;
111 void notify_solo_changed ();
112 void notify_mute_changed ();
113 void notify_record_enable_changed ();
114 void notify_gain_changed (bool force_update = true);
115 void notify_property_changed (const PBD::PropertyChange&);
116 void notify_panner_azi_changed (bool force_update = true);
117 void notify_panner_width_changed (bool force_update = true);
118 void notify_active_changed ();
119 void notify_route_deleted ();
121 void update_automation ();
122 void update_meter ();
124 std::string vpot_mode_string () const;
126 void queue_display_reset (uint32_t msecs);
127 void clear_display_reset ();
128 void reset_display ();
130 struct RedisplayRequest {
131 ARDOUR::AutomationType type;
135 RingBuffer<RedisplayRequest> redisplay_requests;
137 void do_parameter_display (ARDOUR::AutomationType, float val);
138 void queue_parameter_display (ARDOUR::AutomationType, float val);
140 typedef std::map<std::string,boost::shared_ptr<ARDOUR::Bundle> > BundleMap;
141 BundleMap input_bundles;
142 BundleMap output_bundles;
144 void build_input_list (const ARDOUR::ChanCount&);
145 void build_output_list (const ARDOUR::ChanCount&);
146 void maybe_add_to_bundle_map (BundleMap& bm, boost::shared_ptr<ARDOUR::Bundle>, bool for_input, const ARDOUR::ChanCount&);
148 void select_event (Button&, ButtonState);
149 void vselect_event (Button&, ButtonState);
150 void fader_touch_event (Button&, ButtonState);
152 std::vector<Evoral::Parameter> possible_pot_parameters;
153 void next_pot_mode ();
154 void set_vpot_parameter (Evoral::Parameter);
156 void reset_saved_values ();
158 std::map<Evoral::Parameter,Control*> control_by_parameter;
164 #endif /* __ardour_mackie_control_protocol_strip_h__ */