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"
31 struct StripControlDefinition {
34 Control* (*factory)(Surface&, int index, const char* name, Group&);
37 struct GlobalControlDefinition {
40 Control* (*factory)(Surface&, int index, const char* name, Group&);
41 const char* group_name;
45 This is the set of controls that make up a strip.
47 class Strip : public Group
50 Strip (Surface&, const std::string & name, int index, StripControlDefinition* ctls);
53 boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
55 void add (Control & control);
56 int index() const { return _index; } // zero based
58 void set_route (boost::shared_ptr<ARDOUR::Route>);
60 // call all signal handlers manually
63 void handle_button (Button&, ButtonState bs);
64 void handle_fader (Fader&, float position);
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);
71 MidiByteArray zero ();
73 void flip_mode_changed (bool notify=false);
75 void lock_controls ();
76 void unlock_controls ();
78 MidiByteArray gui_selection_changed (ARDOUR::RouteNotificationListPtr);
92 bool _controls_locked;
93 uint64_t _reset_display_at;
95 boost::shared_ptr<ARDOUR::Route> _route;
96 PBD::ScopedConnectionList route_connections;
98 float _last_gain_position_written;
99 float _last_pan_position_written;
101 void notify_solo_changed ();
102 void notify_mute_changed ();
103 void notify_record_enable_changed ();
104 void notify_gain_changed (bool force_update = true);
105 void notify_property_changed (const PBD::PropertyChange&);
106 void notify_panner_changed (bool force_update = true);
107 void notify_active_changed ();
108 void notify_route_deleted ();
110 void update_automation ();
111 void update_meter ();
113 std::string static_display_string () const;
115 void queue_display_reset (uint32_t msecs);
116 void clear_display_reset ();
117 void reset_display ();
118 void do_parameter_display (ARDOUR::AutomationType, float val);
123 #endif /* __ardour_mackie_control_protocol_strip_h__ */