24 #ifndef ardour_mackie_control_protocol_h
25 #define ardour_mackie_control_protocol_h
34 #define ABSTRACT_UI_EXPORTS
50 class AutomationControl;
113 const MACKIE_NAMESPACE::DeviceInfo&
device_info()
const {
return _device_info; }
127 std::shared_ptr<MACKIE_NAMESPACE::Subview>
subview() {
return _subview; }
128 bool zoom_mode ()
const {
return modifier_state() & MODIFIER_ZOOM; }
131 bool is_track (std::shared_ptr<ARDOUR::Stripable>)
const;
136 bool is_vca (std::shared_ptr<ARDOUR::Stripable>)
const;
138 bool is_mapped (std::shared_ptr<ARDOUR::Stripable>)
const;
160 typedef std::list<std::shared_ptr<MACKIE_NAMESPACE::Surface> >
Surfaces;
164 std::shared_ptr<MACKIE_NAMESPACE::Surface>
nth_surface (uint32_t)
const;
169 std::list<std::shared_ptr<ARDOUR::Bundle> >
bundles ();
174 uint32_t
n_strips (
bool with_locked_strips =
true)
const;
211 void update_led(MACKIE_NAMESPACE::Surface&, MACKIE_NAMESPACE::Button & button, MACKIE_NAMESPACE::LedState);
222 typedef std::list<std::shared_ptr<ARDOUR::AutomationControl> >
ControlList;
254 typedef std::vector<std::shared_ptr<ARDOUR::Stripable> >
Sorted;
289 typedef std::map<MACKIE_NAMESPACE::Button::ID,ButtonHandlers>
ButtonMap;
321 std::shared_ptr<MACKIE_NAMESPACE::Subview>
_subview;
364 void connection_handler (std::weak_ptr<ARDOUR::Port>, std::string name1, std::weak_ptr<ARDOUR::Port>, std::string name2,
bool);
376 MACKIE_NAMESPACE::LedState
stop_press(MACKIE_NAMESPACE::Button &);
378 MACKIE_NAMESPACE::LedState
play_press(MACKIE_NAMESPACE::Button &);
382 MACKIE_NAMESPACE::LedState
loop_press(MACKIE_NAMESPACE::Button &);
384 MACKIE_NAMESPACE::LedState
rewind_press(MACKIE_NAMESPACE::Button & button);
386 MACKIE_NAMESPACE::LedState
ffwd_press(MACKIE_NAMESPACE::Button & button);
387 MACKIE_NAMESPACE::LedState
ffwd_release(MACKIE_NAMESPACE::Button & button);
396 MACKIE_NAMESPACE::LedState
left_press(MACKIE_NAMESPACE::Button &);
398 MACKIE_NAMESPACE::LedState
right_press(MACKIE_NAMESPACE::Button &);
406 MACKIE_NAMESPACE::LedState
save_press(MACKIE_NAMESPACE::Button &);
410 MACKIE_NAMESPACE::LedState
zoom_press(MACKIE_NAMESPACE::Button &);
412 MACKIE_NAMESPACE::LedState
scrub_press(MACKIE_NAMESPACE::Button &);
414 MACKIE_NAMESPACE::LedState
undo_press (MACKIE_NAMESPACE::Button &);
416 MACKIE_NAMESPACE::LedState
shift_press (MACKIE_NAMESPACE::Button &);
425 MACKIE_NAMESPACE::LedState
pan_press (MACKIE_NAMESPACE::Button &);
426 MACKIE_NAMESPACE::LedState
pan_release (MACKIE_NAMESPACE::Button &);
429 MACKIE_NAMESPACE::LedState
eq_press (MACKIE_NAMESPACE::Button &);
430 MACKIE_NAMESPACE::LedState
eq_release (MACKIE_NAMESPACE::Button &);
431 MACKIE_NAMESPACE::LedState
dyn_press (MACKIE_NAMESPACE::Button &);
432 MACKIE_NAMESPACE::LedState
dyn_release (MACKIE_NAMESPACE::Button &);
433 MACKIE_NAMESPACE::LedState
flip_press (MACKIE_NAMESPACE::Button &);
453 MACKIE_NAMESPACE::LedState
touch_press (MACKIE_NAMESPACE::Button &);
455 MACKIE_NAMESPACE::LedState
enter_press (MACKIE_NAMESPACE::Button &);
468 MACKIE_NAMESPACE::LedState
read_press (MACKIE_NAMESPACE::Button&);
470 MACKIE_NAMESPACE::LedState
write_press (MACKIE_NAMESPACE::Button&);
474 MACKIE_NAMESPACE::LedState
track_press (MACKIE_NAMESPACE::Button&);
476 MACKIE_NAMESPACE::LedState
send_press (MACKIE_NAMESPACE::Button&);
486 MACKIE_NAMESPACE::LedState
aux_press (MACKIE_NAMESPACE::Button&);
487 MACKIE_NAMESPACE::LedState
aux_release (MACKIE_NAMESPACE::Button&);
492 MACKIE_NAMESPACE::LedState
user_press (MACKIE_NAMESPACE::Button&);
494 MACKIE_NAMESPACE::LedState
trim_press (MACKIE_NAMESPACE::Button&);
496 MACKIE_NAMESPACE::LedState
latch_press (MACKIE_NAMESPACE::Button&);
498 MACKIE_NAMESPACE::LedState
grp_press (MACKIE_NAMESPACE::Button&);
499 MACKIE_NAMESPACE::LedState
grp_release (MACKIE_NAMESPACE::Button&);
500 MACKIE_NAMESPACE::LedState
nudge_press (MACKIE_NAMESPACE::Button&);
502 MACKIE_NAMESPACE::LedState
drop_press (MACKIE_NAMESPACE::Button&);
506 MACKIE_NAMESPACE::LedState
click_press (MACKIE_NAMESPACE::Button&);
508 MACKIE_NAMESPACE::LedState
view_press (MACKIE_NAMESPACE::Button&);
511 MACKIE_NAMESPACE::LedState
bank_release (MACKIE_NAMESPACE::Button&, uint32_t bank_num);
514 MACKIE_NAMESPACE::LedState
redo_press(MACKIE_NAMESPACE::Button &);
522 MACKIE_NAMESPACE::LedState
open_press(MACKIE_NAMESPACE::Button &);
NS_MCU ::LedState read_press(NS_MCU ::Button &)
PBD::ScopedConnectionList fader_automation_connections
NS_MCU ::LedState prog2_clear_solo_press(NS_MCU ::Button &)
void update_global_led(int id, NS_MCU ::LedState)
bool is_audio_track(std::shared_ptr< ARDOUR::Stripable >) const
NS_MCU ::LedState dyn_press(NS_MCU ::Button &)
void update_timecode_display()
NS_MCU ::LedState prog2_save_press(NS_MCU ::Button &)
static const int MODIFIER_SCRUB
NS_MCU ::LedState send_press(NS_MCU ::Button &)
NS_MCU ::LedState prog2_vst_press(NS_MCU ::Button &)
void stripable_selection_changed()
bool is_track(std::shared_ptr< ARDOUR::Stripable >) const
void force_special_stripable_to_strip(std::shared_ptr< ARDOUR::Stripable > r, uint32_t surface, uint32_t strip_number)
void update_configuration_state() const
NS_MCU ::LedState miditracks_release(NS_MCU ::Button &)
void refresh_current_bank()
NS_MCU ::LedState clearsolo_release(NS_MCU ::Button &)
NS_MCU ::LedState inputs_press(NS_MCU ::Button &)
NS_MCU ::LedState control_press(NS_MCU ::Button &)
void set_touch_sensitivity(int)
NS_MCU ::LedState master_fader_touch_press(NS_MCU ::Button &)
NS_MCU ::LedState prog2_undo_press(NS_MCU ::Button &)
NS_MCU ::LedState prog2_clear_solo_release(NS_MCU ::Button &)
void notify_solo_active_changed(bool)
NS_MCU ::LedState replace_release(NS_MCU ::Button &)
NS_MCU ::LedState grp_press(NS_MCU ::Button &)
static const int MODIFIER_CMDALT
NS_MCU ::LedState drop_release(NS_MCU ::Button &)
NS_MCU ::LedState miditracks_press(NS_MCU ::Button &)
std::string format_bbt_timecode(ARDOUR::samplepos_t now_sample)
uint32_t _current_initial_bank
static const int MODIFIER_OPTION
int set_state(const XMLNode &, int version)
NS_MCU ::LedState record_release(NS_MCU ::Button &)
NS_MCU ::LedState undo_release(NS_MCU ::Button &)
int16_t ipmidi_base() const
NS_MCU ::LedState option_release(NS_MCU ::Button &)
std::string format_timecode_timecode(ARDOUR::samplepos_t now_sample)
NS_MCU ::LedState channel_right_release(NS_MCU ::Button &)
PBD::ScopedConnectionList audio_engine_connections
NS_MCU ::LedState scrub_release(NS_MCU ::Button &)
NS_MCU ::LedState inputs_release(NS_MCU ::Button &)
NS_MCU ::LedState eq_release(NS_MCU ::Button &)
bool redisplay_subview_mode()
NS_MCU ::DeviceInfo _device_info
NS_MCU ::LedState busses_release(NS_MCU ::Button &)
Sorted get_sorted_stripables()
sigc::connection hui_connection
NS_MCU ::LedState stop_press(NS_MCU ::Button &)
NS_MCU ::LedState view_press(NS_MCU ::Button &)
NS_MCU ::LedState next_marker_press(NS_MCU ::Button &)
NS_MCU ::LedState cursor_up_release(NS_MCU ::Button &)
NS_MCU ::LedState user_release(NS_MCU ::Button &)
void set_ipmidi_base(int16_t)
NS_MCU ::LedState nudge_press(NS_MCU ::Button &)
NS_MCU ::LedState save_release(NS_MCU ::Button &)
void recalibrate_faders()
void notify_record_state_changed()
void notify_loop_state_changed()
NS_MCU ::LedState cmd_alt_release(NS_MCU ::Button &)
std::list< std::shared_ptr< NS_MCU ::Surface > > Surfaces
static const int MODIFIER_SHIFT
ViewMode view_mode() const
PBD::ScopedConnection port_connection
std::map< NS_MCU ::Button::ID, ButtonHandlers > ButtonMap
static const int MODIFIER_NUDGE
NS_MCU ::LedState master_fader_touch_release(NS_MCU ::Button &)
void set_monitor_on_surface_strip(uint32_t surface, uint32_t strip)
NS_MCU ::LedState cursor_right_press(NS_MCU ::Button &)
bool midi_input_handler(Glib::IOCondition ioc, MIDI::Port *port)
NS_MCU ::LedState fader_touch_release(NS_MCU ::Button &)
NS_MCU ::LedState cursor_left_press(NS_MCU ::Button &)
bool set_subview_mode(NS_MCU ::Subview::Mode, std::shared_ptr< ARDOUR::Stripable >)
NS_MCU ::LedState track_release(NS_MCU ::Button &)
void notify_presentation_info_changed(PBD::PropertyChange const &)
bool metering_active() const
NS_MCU ::LedState dyn_release(NS_MCU ::Button &)
void update_led(NS_MCU ::Surface &, NS_MCU ::Button &button, NS_MCU ::LedState)
this is called to generate the midi to send in response to a button press.
bool is_midi_track(std::shared_ptr< ARDOUR::Stripable >) const
FlipMode flip_mode() const
NS_MCU ::LedState click_release(NS_MCU ::Button &)
NS_MCU ::DeviceProfile _device_profile
std::shared_ptr< ARDOUR::Stripable > first_selected_stripable() const
NS_MCU ::LedState ffwd_release(NS_MCU ::Button &button)
bool profile_exists(std::string const &) const
NS_MCU ::LedState latch_press(NS_MCU ::Button &)
NS_MCU ::LedState cursor_up_press(NS_MCU ::Button &)
NS_MCU ::LedState nudge_release(NS_MCU ::Button &)
std::shared_ptr< NS_MCU ::Subview > subview()
NS_MCU ::LedState cancel_release(NS_MCU ::Button &)
NS_MCU ::LedState plugin_release(NS_MCU ::Button &)
ARDOUR::Session & get_session()
const NS_MCU ::DeviceInfo & device_info() const
NS_MCU ::LedState save_press(NS_MCU ::Button &)
NS_MCU ::LedState user_a_press(NS_MCU ::Button &)
NS_MCU ::LedState write_press(NS_MCU ::Button &)
NS_MCU ::LedState fader_touch_press(NS_MCU ::Button &)
NS_MCU ::LedState loop_release(NS_MCU ::Button &)
NS_MCU ::LedState prog2_right_release(NS_MCU ::Button &)
PBD::Signal< void()> DeviceChanged
void connect_session_signals()
void select_range(uint32_t pressed)
NS_MCU ::LedState read_release(NS_MCU ::Button &)
void check_fader_automation_state()
NS_MCU ::LedState channel_right_press(NS_MCU ::Button &)
NS_MCU ::LedState user_b_press(NS_MCU ::Button &)
void notify_parameter_changed(std::string const &)
uint32_t global_index_locked(NS_MCU ::Strip &)
sigc::connection redisplay_connection
std::shared_ptr< ARDOUR::Bundle > _input_bundle
NS_MCU ::LedState user_press(NS_MCU ::Button &)
void notify_subview_stripable_deleted()
NS_MCU ::LedState timecode_beats_press(NS_MCU ::Button &)
NS_MCU ::LedState scrub_press(NS_MCU ::Button &)
NS_MCU ::LedState right_press(NS_MCU ::Button &)
NS_MCU ::LedState trim_press(NS_MCU ::Button &)
NS_MCU ::LedState plugin_press(NS_MCU ::Button &)
ControlList down_controls(ARDOUR::AutomationType, uint32_t pressed)
int switch_banks(uint32_t first_remote_id, bool force=false)
int set_device_info(const std::string &device_name)
void handle_button_event(NS_MCU ::Surface &, NS_MCU ::Button &button, NS_MCU ::ButtonState)
NS_MCU ::LedState clearsolo_press(NS_MCU ::Button &)
NS_MCU ::LedState audioinstruments_press(NS_MCU ::Button &)
void notify_monitor_added_or_removed()
NS_MCU ::LedState master_press(NS_MCU ::Button &)
NS_MCU ::LedState timecode_beats_release(NS_MCU ::Button &)
NS_MCU ::LedState marker_release(NS_MCU ::Button &)
NS_MCU ::LedState flip_press(NS_MCU ::Button &)
void set_view_mode(ViewMode)
NS_MCU ::LedState prog2_left_press(NS_MCU ::Button &)
NS_MCU ::LedState cursor_down_press(NS_MCU ::Button &)
DownButtonMap _down_buttons
NS_MCU ::LedState drop_press(NS_MCU ::Button &)
NS_MCU ::LedState cmd_alt_press(NS_MCU ::Button &)
static MackieControlProtocol * instance()
void notify_transport_state_changed()
NS_MCU ::LedState redo_press(NS_MCU ::Button &)
NS_MCU ::LedState shift_release(NS_MCU ::Button &)
NS_MCU ::LedState marker_press(NS_MCU ::Button &)
PBD::Signal< void(std::shared_ptr< NS_MCU ::Surface >)> ConnectionChange
std::set< uint32_t > DownButtonList
void notify_metering_state_changed()
NS_MCU ::LedState play_press(NS_MCU ::Button &)
NS_MCU ::LedState touch_release(NS_MCU ::Button &)
std::shared_ptr< NS_MCU ::Surface > get_surface_by_raw_pointer(void *) const
NS_MCU ::LedState record_press(NS_MCU ::Button &)
int modifier_state() const
void add_down_select_button(int surface, int strip)
std::shared_ptr< ARDOUR::Bundle > _output_bundle
NS_MCU ::LedState redo_release(NS_MCU ::Button &)
XMLNode & get_state() const
PBD::ScopedConnectionList stripable_connections
PBD::ScopedConnectionList session_connections
NS_MCU ::LedState cancel_press(NS_MCU ::Button &)
NS_MCU ::LedState next_marker_release(NS_MCU ::Button &)
bool stripable_is_locked_to_strip(std::shared_ptr< ARDOUR::Stripable >) const
NS_MCU ::LedState send_release(NS_MCU ::Button &)
NS_MCU ::LedState pan_release(NS_MCU ::Button &)
bool is_mapped(std::shared_ptr< ARDOUR::Stripable >) const
bool is_trigger_track(std::shared_ptr< ARDOUR::Stripable >) const
NS_MCU ::LedState outputs_press(NS_MCU ::Button &)
void update_fader_automation_state()
NS_MCU ::LedState undo_press(NS_MCU ::Button &)
NS_MCU ::LedState latch_release(NS_MCU ::Button &)
NS_MCU ::LedState view_release(NS_MCU ::Button &)
void notify_vca_added(ARDOUR::VCAList &)
void update_global_button(int id, NS_MCU ::LedState)
int set_device(const std::string &, bool force)
NS_MCU ::LedState user_a_release(NS_MCU ::Button &)
samplepos_t transport_sample() const
NS_MCU ::LedState prog2_marker_press(NS_MCU ::Button &)
MackieControlProtocol(ARDOUR::Session &, const char *name)
NS_MCU ::LedState channel_left_release(NS_MCU ::Button &)
std::shared_ptr< NS_MCU ::Surface > nth_surface(uint32_t) const
NS_MCU ::LedState trim_release(NS_MCU ::Button &)
bool is_foldback_bus(std::shared_ptr< ARDOUR::Stripable >) const
void add_down_button(ARDOUR::AutomationType, int surface, int strip)
NS_MCU ::LedState name_value_press(NS_MCU ::Button &)
void set_flip_mode(FlipMode)
static const int MODIFIER_CONTROL
NS_MCU ::LedState right_release(NS_MCU ::Button &)
NS_MCU ::LedState flip_window_press(NS_MCU ::Button &)
DownButtonList _down_select_buttons
NS_MCU ::LedState grp_release(NS_MCU ::Button &)
NS_MCU ::LedState prog2_left_release(NS_MCU ::Button &)
NS_MCU ::LedState user_b_release(NS_MCU ::Button &)
NS_MCU ::LedState touch_press(NS_MCU ::Button &)
NS_MCU ::LedState stop_release(NS_MCU ::Button &)
NS_MCU ::LedState zoom_press(NS_MCU ::Button &)
virtual ~MackieControlProtocol()
PBD::ScopedConnectionList gui_connections
NS_MCU ::LedState aux_release(NS_MCU ::Button &)
NS_MCU ::LedState left_release(NS_MCU ::Button &)
void do_request(MackieControlUIRequest *)
NS_MCU ::LedState replace_press(NS_MCU ::Button &)
NS_MCU ::LedState enter_press(NS_MCU ::Button &)
void set_automation_state(ARDOUR::AutoState)
NS_MCU ::LedState open_release(NS_MCU ::Button &)
void build_device_specific_button_map()
Glib::Threads::Mutex surfaces_lock
NS_MCU ::LedState enter_release(NS_MCU ::Button &)
NS_MCU ::Timer _frm_left_last
bool marker_modifier_consumed_by_button
std::string _timecode_last
std::list< std::shared_ptr< ARDOUR::AutomationControl > > ControlList
NS_MCU ::LedState rewind_press(NS_MCU ::Button &button)
NS_MCU ::LedState control_release(NS_MCU ::Button &)
void remove_down_select_button(int surface, int strip)
int main_modifier_state() const
void pull_stripable_range(DownButtonList &, ARDOUR::StripableList &, uint32_t pressed)
XMLNode * configuration_state
void connection_handler(std::weak_ptr< ARDOUR::Port >, std::string name1, std::weak_ptr< ARDOUR::Port >, std::string name2, bool)
uint32_t global_index(NS_MCU ::Strip &)
NS_MCU ::LedState prog2_vst_release(NS_MCU ::Button &)
NS_MCU ::LedState click_press(NS_MCU ::Button &)
NS_MCU ::LedState play_release(NS_MCU ::Button &)
bool has_instrument(std::shared_ptr< ARDOUR::Stripable >) const
NS_MCU ::LedState outputs_release(NS_MCU ::Button &)
void set_profile(const std::string &)
NS_MCU ::LedState cursor_down_release(NS_MCU ::Button &)
NS_MCU ::LedState track_press(NS_MCU ::Button &)
NS_MCU ::LedState flip_window_release(NS_MCU ::Button &)
NS_MCU ::LedState prog2_undo_release(NS_MCU ::Button &)
NS_MCU ::LedState open_press(NS_MCU ::Button &)
NS_MCU ::LedState master_release(NS_MCU ::Button &)
NS_MCU ::LedState prev_marker_press(NS_MCU ::Button &)
NS_MCU ::LedState left_press(NS_MCU ::Button &)
void set_master_on_surface_strip(uint32_t surface, uint32_t strip)
NS_MCU ::LedState shift_press(NS_MCU ::Button &)
static const int MODIFIER_MARKER
static const int MAIN_MODIFIER_MASK
NS_MCU ::LedState prev_marker_release(NS_MCU ::Button &)
bool nudge_modifier_consumed_by_button
NS_MCU ::LedState option_press(NS_MCU ::Button &)
NS_MCU ::LedState channel_left_press(NS_MCU ::Button &)
NS_MCU ::LedState bank_release(NS_MCU ::Button &, uint32_t bank_num)
NS_MCU ::LedState aux_press(NS_MCU ::Button &)
void update_timecode_beats_led()
NS_MCU ::LedState audiotracks_release(NS_MCU ::Button &)
std::map< ARDOUR::AutomationType, DownButtonList > DownButtonMap
void remove_down_button(ARDOUR::AutomationType, int surface, int strip)
std::shared_ptr< ArdourSurface::NS_MCU ::Surface > _master_surface
static const int MODIFIER_ZOOM
sigc::connection periodic_connection
void notify_routes_added(ARDOUR::RouteList &)
uint32_t n_strips(bool with_locked_strips=true) const
NS_MCU ::LedState rewind_release(NS_MCU ::Button &button)
NS_MCU ::LedState eq_press(NS_MCU ::Button &)
CONTROL_PROTOCOL_THREADS_NEED_TEMPO_MAP_DECL()
NS_MCU ::LedState loop_press(NS_MCU ::Button &)
NS_MCU ::LedState prog2_save_release(NS_MCU ::Button &)
NS_MCU ::LedState ffwd_press(NS_MCU ::Button &button)
static MackieControlProtocol * _instance
NS_MCU ::LedState prog2_marker_release(NS_MCU ::Button &)
NS_MCU ::LedState busses_press(NS_MCU ::Button &)
NS_MCU ::LedState audiotracks_press(NS_MCU ::Button &)
NS_MCU ::LedState flip_release(NS_MCU ::Button &)
std::shared_ptr< NS_MCU ::Subview > _subview
int _current_selected_track
std::vector< std::shared_ptr< ARDOUR::Stripable > > Sorted
bool is_vca(std::shared_ptr< ARDOUR::Stripable >) const
NS_MCU ::LedState prog2_right_press(NS_MCU ::Button &)
bool needs_ipmidi_restart
NS_MCU ::DeviceProfile & device_profile()
NS_MCU ::LedState zoom_release(NS_MCU ::Button &)
NS_MCU ::LedState pan_press(NS_MCU ::Button &)
NS_MCU ::LedState write_release(NS_MCU ::Button &)
NS_MCU ::LedState cursor_right_release(NS_MCU ::Button &)
NS_MCU ::LedState audioinstruments_release(NS_MCU ::Button &)
std::list< std::shared_ptr< ARDOUR::Bundle > > bundles()
NS_MCU ::LedState name_value_release(NS_MCU ::Button &)
ARDOUR::AnyTime::Type _timecode_type
NS_MCU ::LedState cursor_left_release(NS_MCU ::Button &)
GtkImageIconNameData name
void session(lua_State *L)
std::list< std::shared_ptr< Stripable > > StripableList
std::list< std::shared_ptr< VCA > > VCAList
std::list< std::shared_ptr< Route > > RouteList
Temporal::samplepos_t samplepos_t
gboolean ipmidi_input_handler(GIOChannel *, GIOCondition condition, void *data)
MackieControlProtocol * mcp
~MackieControlUIRequest()