diff --git a/libs/surfaces/cc121/cc121.cc b/libs/surfaces/cc121/cc121.cc index 3d85cb8c37..0f8fe4def8 100644 --- a/libs/surfaces/cc121/cc121.cc +++ b/libs/surfaces/cc121/cc121.cc @@ -57,6 +57,7 @@ #include "ardour/session.h" #include "ardour/session_configuration.h" #include "ardour/track.h" +#include "ardour/well_known_enum.h" #include "cc121.h" @@ -397,35 +398,35 @@ CC121::encoder_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb) break; case 0x20: /* EQ 1 Q */ - if (r) { set_controllable (r->eq_q_controllable(0), adj); } + if (r) { set_controllable (r->mapped_control (EQ_Q, 0), adj); } break; case 0x21: /* EQ 2 Q */ - if (r) { set_controllable (r->eq_q_controllable(1), adj); } + if (r) { set_controllable (r->mapped_control (EQ_Q, 1), adj); } break; case 0x22: /* EQ 3 Q */ - if (r) { set_controllable (r->eq_q_controllable(2), adj); } + if (r) { set_controllable (r->mapped_control (EQ_Q, 2), adj); } break; case 0x23: /* EQ 4 Q */ - if (r) { set_controllable (r->eq_q_controllable(3), adj); } + if (r) { set_controllable (r->mapped_control (EQ_Q, 3), adj); } break; case 0x30: /* EQ 1 Frequency */ - if (r) { set_controllable (r->eq_freq_controllable(0), adj); } + if (r) { set_controllable (r->mapped_control (EQ_Freq, 0), adj); } break; case 0x31: /* EQ 2 Frequency */ - if (r) { set_controllable (r->eq_freq_controllable(1), adj); } + if (r) { set_controllable (r->mapped_control (EQ_Freq, 1), adj); } break; case 0x32: /* EQ 3 Frequency */ - if (r) { set_controllable (r->eq_freq_controllable(2), adj); } + if (r) { set_controllable (r->mapped_control (EQ_Freq, 2), adj); } break; case 0x33: /* EQ 4 Frequency */ - if (r) { set_controllable (r->eq_freq_controllable(3), adj); } + if (r) { set_controllable (r->mapped_control (EQ_Freq, 3), adj); } break; case 0x3C: /* AI */ @@ -448,19 +449,19 @@ CC121::encoder_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb) break; case 0x40: /* EQ 1 Gain */ - if (r) { set_controllable (r->eq_gain_controllable(0), adj); } + if (r) { set_controllable (r->mapped_control(EQ_Gain, 0), adj); } break; case 0x41: /* EQ 2 Gain */ - if (r) { set_controllable (r->eq_gain_controllable(1), adj); } + if (r) { set_controllable (r->mapped_control(EQ_Gain, 1), adj); } break; case 0x42: /* EQ 3 Gain */ - if (r) { set_controllable (r->eq_gain_controllable(2), adj); } + if (r) { set_controllable (r->mapped_control(EQ_Gain, 2), adj); } break; case 0x43: /* EQ 4 Gain */ - if (r) { set_controllable (r->eq_gain_controllable(3), adj); } + if (r) { set_controllable (r->mapped_control(EQ_Gain, 3), adj); } break; case 0x50: /* Value */ diff --git a/libs/surfaces/console1/c1_operations.cc b/libs/surfaces/console1/c1_operations.cc index d95f5f0643..2facac747e 100644 --- a/libs/surfaces/console1/c1_operations.cc +++ b/libs/surfaces/console1/c1_operations.cc @@ -21,6 +21,7 @@ #include "ardour/phase_control.h" #include "ardour/presentation_info.h" #include "ardour/session.h" +#include "ardour/well_known_enum.h" #include "c1_control.h" #include "console1.h" @@ -211,19 +212,19 @@ Console1::zoom (const uint32_t value) void Console1::filter (const uint32_t value) { - if (!_current_stripable || !_current_stripable->filter_enable_controllable (true)) + if (!_current_stripable || !_current_stripable->mapped_control (HPF_Enable)) return; session->set_control ( - _current_stripable->filter_enable_controllable (true), value > 0, PBD::Controllable::UseGroup); + _current_stripable->mapped_control (HPF_Enable), value > 0, PBD::Controllable::UseGroup); } void Console1::low_cut (const uint32_t value) { - if (!_current_stripable || !_current_stripable->filter_freq_controllable (true)) { + if (!_current_stripable || !_current_stripable->mapped_control (HPF_Freq)) { return; } - std::shared_ptr control = _current_stripable->filter_freq_controllable (true); + std::shared_ptr control = _current_stripable->mapped_control (HPF_Freq); double freq = midi_to_control (control, value); session->set_control (control, freq, PBD::Controllable::UseGroup); } @@ -231,10 +232,10 @@ Console1::low_cut (const uint32_t value) void Console1::high_cut (const uint32_t value) { - if (!_current_stripable || !_current_stripable->filter_freq_controllable (false)) { + if (!_current_stripable || !_current_stripable->mapped_control (LPF_Freq)) { return; } - std::shared_ptr control = _current_stripable->filter_freq_controllable (false); + std::shared_ptr control = _current_stripable->mapped_control (LPF_Freq); double freq = midi_to_control (control, value); session->set_control (control, freq, PBD::Controllable::UseGroup); } @@ -243,35 +244,35 @@ Console1::high_cut (const uint32_t value) void Console1::gate (const uint32_t value) { - if (!_current_stripable || !_current_stripable->gate_enable_controllable ()) + if (!_current_stripable || !_current_stripable->mapped_control (Gate_Enable)) return; - session->set_control (_current_stripable->gate_enable_controllable (), value > 0, PBD::Controllable::UseGroup); + session->set_control (_current_stripable->mapped_control (Gate_Enable), value > 0, PBD::Controllable::UseGroup); } void Console1::gate_scf (const uint32_t value) { - if (!_current_stripable || !_current_stripable->gate_key_filter_enable_controllable ()) + if (!_current_stripable || !_current_stripable->mapped_control (Gate_KeyFilterEnable)) return; session->set_control ( - _current_stripable->gate_key_filter_enable_controllable (), value > 0, PBD::Controllable::UseGroup); + _current_stripable->mapped_control (Gate_KeyFilterEnable), value > 0, PBD::Controllable::UseGroup); } void Console1::gate_listen (const uint32_t value) { - if (!_current_stripable || !_current_stripable->gate_key_listen_controllable ()) + if (!_current_stripable || !_current_stripable->mapped_control (Gate_KeyListen)) return; - session->set_control (_current_stripable->gate_key_listen_controllable (), value > 0, PBD::Controllable::UseGroup); + session->set_control (_current_stripable->mapped_control (Gate_KeyListen), value > 0, PBD::Controllable::UseGroup); } void Console1::gate_thresh (const uint32_t value) { - if (!_current_stripable || !_current_stripable->gate_threshold_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Gate_Threshold)) { return; } - std::shared_ptr control = _current_stripable->gate_threshold_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Threshold); double freq = midi_to_control (control, value); session->set_control (control, freq, PBD::Controllable::UseGroup); } @@ -279,10 +280,10 @@ Console1::gate_thresh (const uint32_t value) void Console1::gate_depth (const uint32_t value) { - if (!_current_stripable || !_current_stripable->gate_depth_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Gate_Depth)) { return; } - std::shared_ptr control = _current_stripable->gate_depth_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Depth); double freq = midi_to_control (control, value); session->set_control (control, freq, PBD::Controllable::UseGroup); } @@ -290,10 +291,10 @@ Console1::gate_depth (const uint32_t value) void Console1::gate_release (const uint32_t value) { - if (!_current_stripable || !_current_stripable->gate_release_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Gate_Release)) { return; } - std::shared_ptr control = _current_stripable->gate_release_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Release); double freq = midi_to_control (control, value); session->set_control (control, freq, PBD::Controllable::UseGroup); } @@ -301,10 +302,10 @@ Console1::gate_release (const uint32_t value) void Console1::gate_attack (const uint32_t value) { - if (!_current_stripable || !_current_stripable->gate_attack_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Gate_Attack)) { return; } - std::shared_ptr control = _current_stripable->gate_attack_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Attack); double freq = midi_to_control (control, value); session->set_control (control, freq, PBD::Controllable::UseGroup); } @@ -312,10 +313,10 @@ Console1::gate_attack (const uint32_t value) void Console1::gate_hyst (const uint32_t value) { - if (!_current_stripable || !_current_stripable->gate_hysteresis_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Gate_Hysteresis)) { return; } - std::shared_ptr control = _current_stripable->gate_hysteresis_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Hysteresis); double freq = midi_to_control (control, value); session->set_control (control, freq, PBD::Controllable::UseGroup); } @@ -323,10 +324,10 @@ Console1::gate_hyst (const uint32_t value) void Console1::gate_hold (const uint32_t value) { - if (!_current_stripable || !_current_stripable->gate_hold_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Gate_Hold)) { return; } - std::shared_ptr control = _current_stripable->gate_hold_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Hold); double freq = midi_to_control (control, value); session->set_control (control, freq, PBD::Controllable::UseGroup); } @@ -334,10 +335,10 @@ Console1::gate_hold (const uint32_t value) void Console1::gate_filter_freq (const uint32_t value) { - if (!_current_stripable || !_current_stripable->gate_key_filter_freq_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Gate_KeyFilterFreq)) { return; } - std::shared_ptr control = _current_stripable->gate_key_filter_freq_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_KeyFilterFreq); double freq = midi_to_control (control, value); session->set_control (control, freq, PBD::Controllable::UseGroup); } @@ -351,8 +352,8 @@ Console1::eq (const uint32_t value) if (!_current_stripable) { return; } - if (_current_stripable->eq_enable_controllable ()) - session->set_control (_current_stripable->eq_enable_controllable (), value > 0, PBD::Controllable::UseGroup); + if (_current_stripable->mapped_control (EQ_Enable)) + session->set_control (_current_stripable->mapped_control (EQ_Enable), value > 0, PBD::Controllable::UseGroup); else map_eq (); } @@ -364,8 +365,8 @@ Console1::eq_low_shape (const uint32_t value) if (!_current_stripable) { return; } - if (_current_stripable->eq_shape_controllable (0)) - session->set_control (_current_stripable->eq_shape_controllable (0), value > 0, PBD::Controllable::UseGroup); + if (_current_stripable->mapped_control (EQ_Shape, 0)) + session->set_control (_current_stripable->mapped_control (EQ_Shape, 0), value > 0, PBD::Controllable::UseGroup); else map_eq_low_shape (); } @@ -377,8 +378,8 @@ Console1::eq_high_shape (const uint32_t value) if (!_current_stripable) { return; } - if (_current_stripable->eq_shape_controllable (3)) - session->set_control (_current_stripable->eq_shape_controllable (3), value > 0, PBD::Controllable::UseGroup); + if (_current_stripable->mapped_control (EQ_Shape, 3)) + session->set_control (_current_stripable->mapped_control (EQ_Shape, 3), value > 0, PBD::Controllable::UseGroup); else map_eq_high_shape (); } @@ -386,10 +387,10 @@ Console1::eq_high_shape (const uint32_t value) void Console1::eq_freq (const uint32_t band, uint32_t value) { - if (!_current_stripable || !_current_stripable->eq_freq_controllable (band)) { + if (!_current_stripable || !_current_stripable->mapped_control (EQ_Freq, band)) { return; } - std::shared_ptr control = _current_stripable->eq_freq_controllable (band); + std::shared_ptr control = _current_stripable->mapped_control (EQ_Freq, band); double freq = midi_to_control (control, value); session->set_control (control, freq, PBD::Controllable::UseGroup); } @@ -397,10 +398,10 @@ Console1::eq_freq (const uint32_t band, uint32_t value) void Console1::eq_gain (const uint32_t band, uint32_t value) { - if (!_current_stripable || !_current_stripable->eq_gain_controllable (band)) { + if (!_current_stripable || !_current_stripable->mapped_control (EQ_Gain, band)) { return; } - std::shared_ptr control = _current_stripable->eq_gain_controllable (band); + std::shared_ptr control = _current_stripable->mapped_control (EQ_Gain, band); double gain = midi_to_control (control, value); session->set_control (control, gain, PBD::Controllable::UseGroup); } @@ -445,10 +446,10 @@ Console1::mb_send_level (const uint32_t n, const uint32_t value) void Console1::drive (const uint32_t value) { - if (!_current_stripable || !_current_stripable->tape_drive_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (TapeDrive_Drive)) { return; } - std::shared_ptr control = _current_stripable->tape_drive_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (TapeDrive_Drive); if (_current_stripable->presentation_info ().flags () & PresentationInfo::AudioTrack) { DEBUG_TRACE (DEBUG::Console1, string_compose ("drive audio track %1\n", value)); session->set_control (control, value > 62 ? 1 : 0, PBD::Controllable::UseGroup); @@ -462,27 +463,27 @@ Console1::drive (const uint32_t value) void Console1::comp (const uint32_t value) { - if (!_current_stripable || !_current_stripable->comp_enable_controllable ()) + if (!_current_stripable || !_current_stripable->mapped_control (Comp_Enable)) return; - session->set_control (_current_stripable->comp_enable_controllable (), value > 0, PBD::Controllable::UseGroup); + session->set_control (_current_stripable->mapped_control (Comp_Enable), value > 0, PBD::Controllable::UseGroup); } void Console1::comp_mode (const uint32_t value) { - if (!_current_stripable || !_current_stripable->comp_mode_controllable ()) + if (!_current_stripable || !_current_stripable->mapped_control (Comp_Mode)) return; int new_val = value == 63 ? 1 : value == 127 ? 2 : 0; - session->set_control (_current_stripable->comp_mode_controllable (), new_val, PBD::Controllable::UseGroup); + session->set_control (_current_stripable->mapped_control (Comp_Mode), new_val, PBD::Controllable::UseGroup); } void Console1::comp_thresh (const uint32_t value) { - if (!_current_stripable || !_current_stripable->comp_threshold_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Comp_Threshold)) { return; } - std::shared_ptr control = _current_stripable->comp_threshold_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_Threshold); double gain = midi_to_control (control, value); session->set_control (control, gain, PBD::Controllable::UseGroup); } @@ -490,10 +491,10 @@ Console1::comp_thresh (const uint32_t value) void Console1::comp_attack (const uint32_t value) { - if (!_current_stripable || !_current_stripable->comp_attack_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Comp_Attack)) { return; } - std::shared_ptr control = _current_stripable->comp_attack_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_Attack); double gain = midi_to_control (control, value); session->set_control (control, gain, PBD::Controllable::UseGroup); } @@ -501,10 +502,10 @@ Console1::comp_attack (const uint32_t value) void Console1::comp_release (const uint32_t value) { - if (!_current_stripable || !_current_stripable->comp_release_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Comp_Release)) { return; } - std::shared_ptr control = _current_stripable->comp_release_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_Release); double gain = midi_to_control (control, value); session->set_control (control, gain, PBD::Controllable::UseGroup); } @@ -512,10 +513,10 @@ Console1::comp_release (const uint32_t value) void Console1::comp_ratio (const uint32_t value) { - if (!_current_stripable || !_current_stripable->comp_ratio_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Comp_Ratio)) { return; } - std::shared_ptr control = _current_stripable->comp_ratio_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_Ratio); double gain = midi_to_control (control, value); session->set_control (control, gain, PBD::Controllable::UseGroup); } @@ -523,10 +524,10 @@ Console1::comp_ratio (const uint32_t value) void Console1::comp_makeup (const uint32_t value) { - if (!_current_stripable || !_current_stripable->comp_makeup_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Comp_Makeup)) { return; } - std::shared_ptr control = _current_stripable->comp_makeup_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_Makeup); double gain = midi_to_control (control, value); session->set_control (control, gain, PBD::Controllable::UseGroup); } @@ -534,10 +535,10 @@ Console1::comp_makeup (const uint32_t value) void Console1::comp_emph (const uint32_t value) { - if (!_current_stripable || !_current_stripable->comp_key_filter_freq_controllable ()) { + if (!_current_stripable || !_current_stripable->mapped_control (Comp_KeyFilterFreq)) { return; } - std::shared_ptr control = _current_stripable->comp_key_filter_freq_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_KeyFilterFreq); double gain = midi_to_control (control, value); session->set_control (control, gain, PBD::Controllable::UseGroup); } @@ -729,8 +730,8 @@ Console1::map_filter () } try { get_button (ControllerID::FILTER_TO_COMPRESSORS) - ->set_led_state (_current_stripable->filter_enable_controllable (true) - ? _current_stripable->filter_enable_controllable (true)->get_value () + ->set_led_state (_current_stripable->mapped_control (HPF_Enable) + ? _current_stripable->mapped_control (HPF_Enable)->get_value () : false); } catch (ControlNotFoundException const&) { DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); @@ -742,7 +743,7 @@ Console1::map_low_cut () { ControllerID controllerID = ControllerID::LOW_CUT; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->filter_freq_controllable (true); + std::shared_ptr control = _current_stripable->mapped_control (HPF_Freq); map_encoder (controllerID, control); } } @@ -752,7 +753,7 @@ Console1::map_high_cut () { ControllerID controllerID = ControllerID::HIGH_CUT; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->filter_freq_controllable (false); + std::shared_ptr control = _current_stripable->mapped_control (LPF_Freq); map_encoder (controllerID, control); } } @@ -765,8 +766,8 @@ Console1::map_gate () return; try { get_button (ControllerID::SHAPE) - ->set_led_state (_current_stripable->gate_enable_controllable () - ? _current_stripable->gate_enable_controllable ()->get_value () + ->set_led_state (_current_stripable->mapped_control (Gate_Enable) + ? _current_stripable->mapped_control (Gate_Enable)->get_value () : false); } catch (ControlNotFoundException const&) { DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); @@ -781,8 +782,8 @@ Console1::map_gate_scf () try { DEBUG_TRACE (DEBUG::Console1, string_compose ("map_gate_scf() - shift: %1\n", shift_state)); get_button (ControllerID::HARD_GATE) - ->set_led_state (_current_stripable->gate_key_filter_enable_controllable () - ? _current_stripable->gate_key_filter_enable_controllable ()->get_value () + ->set_led_state (_current_stripable->mapped_control (Gate_KeyFilterEnable) + ? _current_stripable->mapped_control (Gate_KeyFilterEnable)->get_value () : false); } catch (ControlNotFoundException const&) { DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); @@ -797,8 +798,8 @@ Console1::map_gate_listen () try { DEBUG_TRACE (DEBUG::Console1, string_compose ("map_gate_listen() - shift: %1\n", shift_state)); get_button (ControllerID::HARD_GATE) - ->set_led_state (_current_stripable->gate_key_listen_controllable () - ? _current_stripable->gate_key_listen_controllable ()->get_value () + ->set_led_state (_current_stripable->mapped_control (Gate_KeyListen) + ? _current_stripable->mapped_control (Gate_KeyListen)->get_value () : false); } catch (ControlNotFoundException const&) { DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); @@ -810,7 +811,7 @@ Console1::map_gate_thresh () { ControllerID controllerID = ControllerID::SHAPE_GATE; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->gate_threshold_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Threshold); map_encoder (controllerID, control); } } @@ -823,7 +824,7 @@ Console1::map_gate_release () } ControllerID controllerID = ControllerID::SHAPE_RELEASE; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->gate_release_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Release); map_encoder (controllerID, control); } } @@ -836,7 +837,7 @@ Console1::map_gate_attack () } ControllerID controllerID = ControllerID::SHAPE_SUSTAIN; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->gate_attack_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Attack); map_encoder (controllerID, control); } } @@ -849,7 +850,7 @@ Console1::map_gate_depth () } ControllerID controllerID = ControllerID::SHAPE_PUNCH; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->gate_depth_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Depth); map_encoder (controllerID, control); } } @@ -862,7 +863,7 @@ Console1::map_gate_hyst () } ControllerID controllerID = ControllerID::SHAPE_RELEASE; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->gate_hysteresis_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Hysteresis); map_encoder (controllerID, control); } } @@ -875,7 +876,7 @@ Console1::map_gate_hold () } ControllerID controllerID = ControllerID::SHAPE_SUSTAIN; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->gate_hold_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_Hold); map_encoder (controllerID, control); } } @@ -888,7 +889,7 @@ Console1::map_gate_filter_freq () } ControllerID controllerID = ControllerID::SHAPE_PUNCH; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->gate_key_filter_freq_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Gate_KeyFilterFreq); map_encoder (controllerID, control); } } @@ -900,8 +901,8 @@ Console1::map_eq () if (!_current_stripable) return; try { - get_button (EQ)->set_led_state (_current_stripable->eq_enable_controllable () - ? _current_stripable->eq_enable_controllable ()->get_value () + get_button (EQ)->set_led_state (_current_stripable->mapped_control (EQ_Enable) + ? _current_stripable->mapped_control (EQ_Enable)->get_value () : false); } catch (ControlNotFoundException const&) { DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); @@ -916,7 +917,7 @@ Console1::map_eq_freq (const uint32_t band) } ControllerID controllerID = eq_freq_controller_for_band (band); if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->eq_freq_controllable (band); + std::shared_ptr control = _current_stripable->mapped_control (EQ_Freq, band); map_encoder (controllerID, control); } } @@ -929,7 +930,7 @@ Console1::map_eq_gain (const uint32_t band) } ControllerID controllerID = eq_gain_controller_for_band (band); if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->eq_gain_controllable (band); + std::shared_ptr control = _current_stripable->mapped_control (EQ_Gain, band); map_encoder (controllerID, control); } } @@ -940,8 +941,8 @@ Console1::map_eq_low_shape () if (!_current_stripable) return; try { - uint32_t led_value = _current_stripable->eq_shape_controllable (0) - ? _current_stripable->eq_shape_controllable (0)->get_value () == 0 ? 0 : 63 + uint32_t led_value = _current_stripable->mapped_control (EQ_Shape, 0) + ? _current_stripable->mapped_control (EQ_Shape, 0)->get_value () == 0 ? 0 : 63 : 0; get_button (ControllerID::LOW_SHAPE)->set_led_state (led_value); } catch (ControlNotFoundException const&) { @@ -955,8 +956,8 @@ Console1::map_eq_high_shape () if (!_current_stripable) return; try { - uint32_t led_value = _current_stripable->eq_shape_controllable (3) - ? _current_stripable->eq_shape_controllable (3)->get_value () == 0 ? 0 : 63 + uint32_t led_value = _current_stripable->mapped_control (EQ_Shape, 3) + ? _current_stripable->mapped_control (EQ_Shape, 3)->get_value () == 0 ? 0 : 63 : 0; get_button (ControllerID::HIGH_SHAPE)->set_led_state (led_value); } catch (ControlNotFoundException const&) { @@ -971,7 +972,7 @@ Console1::map_drive () ControllerID controllerID = ControllerID::CHARACTER; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->tape_drive_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (TapeDrive_Drive); if (control && _current_stripable->presentation_info ().flags () & PresentationInfo::AudioTrack) { double val = control->get_value (); DEBUG_TRACE (DEBUG::Console1, string_compose ("map_drive audio track %1\n", val)); @@ -1018,8 +1019,8 @@ Console1::map_comp () return; try { get_button (ControllerID::COMP) - ->set_led_state (_current_stripable->comp_enable_controllable () - ? _current_stripable->comp_enable_controllable ()->get_value () + ->set_led_state (_current_stripable->mapped_control (Comp_Enable) + ? _current_stripable->mapped_control (Comp_Enable)->get_value () : false); } catch (ControlNotFoundException const&) { DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); @@ -1032,8 +1033,8 @@ Console1::map_comp_mode () if (!_current_stripable) return; try { - double value = _current_stripable->comp_mode_controllable () - ? _current_stripable->comp_mode_controllable ()->get_value () + double value = _current_stripable->mapped_control (Comp_Mode) + ? _current_stripable->mapped_control (Comp_Mode)->get_value () : false; DEBUG_TRACE (DEBUG::Console1, string_compose ("****value from comp-type %1\n", value)); get_mbutton (ControllerID::ORDER)->set_led_state (value); @@ -1047,7 +1048,7 @@ Console1::map_comp_thresh () { ControllerID controllerID = ControllerID::COMP_THRESH; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->comp_threshold_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_Threshold); map_encoder (controllerID, control); } } @@ -1057,7 +1058,7 @@ Console1::map_comp_attack () { ControllerID controllerID = ControllerID::COMP_ATTACK; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->comp_attack_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_Attack); map_encoder (controllerID, control); } } @@ -1067,7 +1068,7 @@ Console1::map_comp_release () { ControllerID controllerID = ControllerID::COMP_RELEASE; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->comp_release_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_Release); map_encoder (controllerID, control); } } @@ -1077,7 +1078,7 @@ Console1::map_comp_ratio () { ControllerID controllerID = ControllerID::COMP_RATIO; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->comp_ratio_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_Ratio); map_encoder (controllerID, control); } } @@ -1087,7 +1088,7 @@ Console1::map_comp_makeup () { ControllerID controllerID = ControllerID::COMP_PAR; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->comp_makeup_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_Makeup); map_encoder (controllerID, control); } } @@ -1097,7 +1098,7 @@ Console1::map_comp_emph () { ControllerID controllerID = ControllerID::DRIVE; if (map_encoder (controllerID)) { - std::shared_ptr control = _current_stripable->comp_key_filter_freq_controllable (); + std::shared_ptr control = _current_stripable->mapped_control (Comp_KeyFilterFreq); map_encoder (controllerID, control); } } diff --git a/libs/surfaces/console1/console1.cc b/libs/surfaces/console1/console1.cc index 6671156009..b903d22457 100644 --- a/libs/surfaces/console1/console1.cc +++ b/libs/surfaces/console1/console1.cc @@ -35,6 +35,7 @@ #include "ardour/stripable.h" #include "ardour/track.h" #include "ardour/vca_manager.h" +#include "ardour/well_known_enum.h" #include "console1.h" #include "c1_control.h" @@ -550,8 +551,8 @@ Console1::set_current_stripable (std::shared_ptr r) DEBUG_TRACE (DEBUG::Console1, string_compose ("current_stripable %1 - %2\n", pi.order (), pi.flags ())); - gate_redux_meter = _current_stripable->gate_redux_controllable (); - comp_redux_meter = _current_stripable->comp_redux_controllable (); + gate_redux_meter = _current_stripable->mapped_output (Gate_Redux); + comp_redux_meter = _current_stripable->mapped_output (Comp_Redux); /* Support all types of pan controls / find first available control @@ -623,102 +624,102 @@ Console1::set_current_stripable (std::shared_ptr r) } // Filter Section - if (_current_stripable->filter_enable_controllable (true)) { - _current_stripable->filter_enable_controllable (true)->Changed.connect ( + if (_current_stripable->mapped_control (HPF_Enable)) { + _current_stripable->mapped_control (HPF_Enable)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_filter, this), this); } - if (_current_stripable->filter_freq_controllable (true)) { - _current_stripable->filter_freq_controllable (true)->Changed.connect ( + if (_current_stripable->mapped_control (HPF_Freq)) { + _current_stripable->mapped_control (HPF_Freq)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_low_cut, this), this); } - if (_current_stripable->filter_freq_controllable (false)) { - _current_stripable->filter_freq_controllable (false)->Changed.connect ( + if (_current_stripable->mapped_control (LPF_Freq)) { + _current_stripable->mapped_control (LPF_Freq)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_high_cut, this), this); } // Gate Section - if (_current_stripable->gate_enable_controllable ()) { - _current_stripable->gate_enable_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Gate_Enable)) { + _current_stripable->mapped_control (Gate_Enable)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate, this), this); } - if (_current_stripable->gate_key_filter_enable_controllable ()) { - _current_stripable->gate_key_filter_enable_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Gate_KeyFilterEnable)) { + _current_stripable->mapped_control (Gate_KeyFilterEnable)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_scf, this), this); } - if (_current_stripable->gate_key_listen_controllable ()) { - _current_stripable->gate_key_listen_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Gate_KeyListen)) { + _current_stripable->mapped_control (Gate_KeyListen)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_listen, this), this); } - if (_current_stripable->gate_threshold_controllable ()) { - _current_stripable->gate_threshold_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Gate_Threshold)) { + _current_stripable->mapped_control (Gate_Threshold)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_thresh, this), this); } - if (_current_stripable->gate_depth_controllable ()) { - _current_stripable->gate_depth_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Gate_Depth)) { + _current_stripable->mapped_control (Gate_Depth)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_depth, this), this); } - if (_current_stripable->gate_release_controllable ()) { - _current_stripable->gate_release_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Gate_Release)) { + _current_stripable->mapped_control (Gate_Release)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_release, this), this); } - if (_current_stripable->gate_attack_controllable ()) { - _current_stripable->gate_attack_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Gate_Attack)) { + _current_stripable->mapped_control (Gate_Attack)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_attack, this), this); } - if (_current_stripable->gate_hysteresis_controllable ()) { - _current_stripable->gate_hysteresis_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Gate_Hysteresis)) { + _current_stripable->mapped_control (Gate_Hysteresis)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_hyst, this), this); } - if (_current_stripable->gate_hold_controllable ()) { - _current_stripable->gate_hold_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Gate_Hold)) { + _current_stripable->mapped_control (Gate_Hold)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_hold, this), this); } - if (_current_stripable->gate_key_filter_freq_controllable ()) { - _current_stripable->gate_key_filter_freq_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Gate_KeyFilterFreq)) { + _current_stripable->mapped_control (Gate_KeyFilterFreq)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_filter_freq, this), this); } // EQ Section - if (_current_stripable->eq_enable_controllable ()) { - _current_stripable->eq_enable_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (EQ_Enable)) { + _current_stripable->mapped_control (EQ_Enable)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq, this), this); } for (uint32_t i = 0; i < _current_stripable->eq_band_cnt (); ++i) { - if (_current_stripable->eq_freq_controllable (i)) { - _current_stripable->eq_freq_controllable (i)->Changed.connect ( + if (_current_stripable->mapped_control (EQ_Freq, i)) { + _current_stripable->mapped_control (EQ_Freq, i)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_freq, this, i), this); } - if (_current_stripable->eq_gain_controllable (i)) { - _current_stripable->eq_gain_controllable (i)->Changed.connect ( + if (_current_stripable->mapped_control (EQ_Gain, i)) { + _current_stripable->mapped_control (EQ_Gain, i)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_gain, this, i), this); } } - if (_current_stripable->eq_shape_controllable (0)) { - _current_stripable->eq_shape_controllable (0)->Changed.connect ( + if (_current_stripable->mapped_control (EQ_Shape, 0)) { + _current_stripable->mapped_control (EQ_Shape, 0)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_low_shape, this), this); } - if (_current_stripable->eq_shape_controllable (3)) { - _current_stripable->eq_shape_controllable (3)->Changed.connect ( + if (_current_stripable->mapped_control (EQ_Shape, 3)) { + _current_stripable->mapped_control (EQ_Shape, 3)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_high_shape, this), this); } // Drive - if (_current_stripable->tape_drive_controllable ()) { - _current_stripable->tape_drive_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (TapeDrive_Drive)) { + _current_stripable->mapped_control (TapeDrive_Drive)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_drive, this), this); } @@ -734,43 +735,43 @@ Console1::set_current_stripable (std::shared_ptr r) } // Comp Section - if (_current_stripable->comp_enable_controllable ()) { - _current_stripable->comp_enable_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Comp_Enable)) { + _current_stripable->mapped_control (Comp_Enable)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp, this), this); } - if (_current_stripable->comp_mode_controllable ()) { - _current_stripable->comp_mode_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Comp_Mode)) { + _current_stripable->mapped_control (Comp_Mode)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_mode, this), this); } - if (_current_stripable->comp_threshold_controllable ()) { - _current_stripable->comp_threshold_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Comp_Threshold)) { + _current_stripable->mapped_control (Comp_Threshold)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_thresh, this), this); } - if (_current_stripable->comp_attack_controllable ()) { - _current_stripable->comp_attack_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Comp_Attack)) { + _current_stripable->mapped_control (Comp_Attack)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_attack, this), this); } - if (_current_stripable->comp_release_controllable ()) { - _current_stripable->comp_release_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Comp_Release)) { + _current_stripable->mapped_control (Comp_Release)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_release, this), this); } - if (_current_stripable->comp_ratio_controllable ()) { - _current_stripable->comp_ratio_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Comp_Ratio)) { + _current_stripable->mapped_control (Comp_Ratio)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_ratio, this), this); } - if (_current_stripable->comp_makeup_controllable ()) { - _current_stripable->comp_makeup_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Comp_Makeup)) { + _current_stripable->mapped_control (Comp_Makeup)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_makeup, this), this); } - if (_current_stripable->comp_key_filter_freq_controllable ()) { - _current_stripable->comp_key_filter_freq_controllable ()->Changed.connect ( + if (_current_stripable->mapped_control (Comp_KeyFilterFreq)) { + _current_stripable->mapped_control (Comp_KeyFilterFreq)->Changed.connect ( stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_emph, this), this); } diff --git a/libs/surfaces/faderport8/faderport8.cc b/libs/surfaces/faderport8/faderport8.cc index 957aa6c436..5a6e95ffe3 100644 --- a/libs/surfaces/faderport8/faderport8.cc +++ b/libs/surfaces/faderport8/faderport8.cc @@ -49,6 +49,7 @@ #include "ardour/session_configuration.h" #include "ardour/tempo.h" #include "ardour/vca.h" +#include "ardour/well_known_enum.h" #include "faderport8.h" @@ -1336,45 +1337,44 @@ FaderPort8::build_well_known_processor_ctrls (std::shared_ptr s, int int cnt = s->eq_band_cnt(); #ifdef MIXBUS - PUSH_BACK_NON_NULL ("Flt In", s->filter_enable_controllable (true)); // both HP/LP - PUSH_BACK_NON_NULL ("HP Freq", s->filter_freq_controllable (true)); - PUSH_BACK_NON_NULL ("LP Freq", s->filter_freq_controllable (false)); - PUSH_BACK_NON_NULL ("EQ In", s->eq_enable_controllable ()); + PUSH_BACK_NON_NULL ("Flt In", s->mapped_control (HPF_Enable)); // both HP/LP + PUSH_BACK_NON_NULL ("HP Freq", s->mapped_control (HPF_Freq)); + PUSH_BACK_NON_NULL ("LP Freq", s->mapped_control (LPF_Freq)); + PUSH_BACK_NON_NULL ("EQ In", s->mapped_control (EQ_Enable)); #endif for (int band = 0; band < cnt; ++band) { std::string bn = s->eq_band_name (band); - PUSH_BACK_NON_NULL (string_compose ("Gain %1", bn), s->eq_gain_controllable (band)); - PUSH_BACK_NON_NULL (string_compose ("Freq %1", bn), s->eq_freq_controllable (band)); - PUSH_BACK_NON_NULL (string_compose ("Band %1", bn), s->eq_q_controllable (band)); - PUSH_BACK_NON_NULL (string_compose ("Shape %1", bn), s->eq_shape_controllable (band)); + PUSH_BACK_NON_NULL (string_compose ("Gain %1", bn), s->mapped_control (EQ_Gain, band)); + PUSH_BACK_NON_NULL (string_compose ("Freq %1", bn), s->mapped_control (EQ_Freq, band)); + PUSH_BACK_NON_NULL (string_compose ("Band %1", bn), s->mapped_control (EQ_Q, band)); + PUSH_BACK_NON_NULL (string_compose ("Shape %1", bn), s->mapped_control (EQ_Shape, band)); } } break; case 2: - PUSH_BACK_NON_NULL ("Comp In", s->comp_enable_controllable ()); - PUSH_BACK_NON_NULL ("Threshold", s->comp_threshold_controllable ()); - PUSH_BACK_NON_NULL ("Makeup", s->comp_makeup_controllable ()); - PUSH_BACK_NON_NULL ("Mode", s->comp_mode_controllable ()); - PUSH_BACK_NON_NULL ("Speed", s->comp_speed_controllable ()); - PUSH_BACK_NON_NULL ("Ratio", s->comp_ratio_controllable ()); - PUSH_BACK_NON_NULL ("Attack", s->comp_attack_controllable ()); - PUSH_BACK_NON_NULL ("Release", s->comp_release_controllable ()); - PUSH_BACK_NON_NULL ("Emphasis", s->comp_key_filter_freq_controllable ()); + PUSH_BACK_NON_NULL ("Comp In", s->mapped_control (Comp_Enable)); + PUSH_BACK_NON_NULL ("Threshold", s->mapped_control (Comp_Threshold)); + PUSH_BACK_NON_NULL ("Makeup", s->mapped_control (Comp_Makeup)); + PUSH_BACK_NON_NULL ("Mode", s->mapped_control (Comp_Mode)); + PUSH_BACK_NON_NULL ("Ratio", s->mapped_control (Comp_Ratio)); + PUSH_BACK_NON_NULL ("Attack", s->mapped_control (Comp_Attack)); + PUSH_BACK_NON_NULL ("Release", s->mapped_control (Comp_Release)); + PUSH_BACK_NON_NULL ("Emphasis", s->mapped_control (Comp_KeyFilterFreq)); break; case 3: - PUSH_BACK_NON_NULL ("Gate In", s->gate_enable_controllable ()); - PUSH_BACK_NON_NULL ("Exp", s->gate_mode_controllable ()); - PUSH_BACK_NON_NULL ("Threshold", s->gate_threshold_controllable ()); - PUSH_BACK_NON_NULL ("Depth", s->gate_depth_controllable ()); - PUSH_BACK_NON_NULL ("Attack", s->gate_attack_controllable ()); - PUSH_BACK_NON_NULL ("Release", s->gate_release_controllable ()); - PUSH_BACK_NON_NULL ("Exp Ratio", s->gate_ratio_controllable ()); - PUSH_BACK_NON_NULL ("Exp Knee", s->gate_knee_controllable ()); - PUSH_BACK_NON_NULL ("Gate Hyst", s->gate_hysteresis_controllable ()); - PUSH_BACK_NON_NULL ("Gate Hold", s->gate_hold_controllable ()); - PUSH_BACK_NON_NULL ("SC Enable", s->gate_key_filter_enable_controllable ()); - PUSH_BACK_NON_NULL ("SC Freq", s->gate_key_filter_freq_controllable ()); + PUSH_BACK_NON_NULL ("Gate In", s->mapped_control (Gate_Enable)); + PUSH_BACK_NON_NULL ("Exp", s->mapped_control (Gate_Mode)); + PUSH_BACK_NON_NULL ("Threshold", s->mapped_control (Gate_Threshold)); + PUSH_BACK_NON_NULL ("Depth", s->mapped_control (Gate_Depth)); + PUSH_BACK_NON_NULL ("Attack", s->mapped_control (Gate_Attack)); + PUSH_BACK_NON_NULL ("Release", s->mapped_control (Gate_Release)); + PUSH_BACK_NON_NULL ("Exp Ratio", s->mapped_control (Gate_Ratio)); + PUSH_BACK_NON_NULL ("Exp Knee", s->mapped_control (Gate_Knee)); + PUSH_BACK_NON_NULL ("Gate Hyst", s->mapped_control (Gate_Hysteresis)); + PUSH_BACK_NON_NULL ("Gate Hold", s->mapped_control (Gate_Hold)); + PUSH_BACK_NON_NULL ("SC Enable", s->mapped_control (Gate_KeyFilterEnable)); + PUSH_BACK_NON_NULL ("SC Freq", s->mapped_control (Gate_KeyFilterFreq)); break; default: assert (0); @@ -1606,11 +1606,11 @@ FaderPort8::spill_plugins () --spillwidth; have_well_known_eq = true; } - if (r->comp_enable_controllable ()) { + if (r->mapped_control (Comp_Enable)) { --spillwidth; have_well_known_comp = true; } - if (r->gate_enable_controllable ()) { + if (r->mapped_control (Gate_Enable)) { --spillwidth; have_well_known_gate = true; } diff --git a/libs/surfaces/faderport8/fp8_strip.cc b/libs/surfaces/faderport8/fp8_strip.cc index 0ed189da60..1005a9e20e 100644 --- a/libs/surfaces/faderport8/fp8_strip.cc +++ b/libs/surfaces/faderport8/fp8_strip.cc @@ -24,6 +24,7 @@ #include "ardour/stripable.h" #include "ardour/track.h" #include "ardour/value_as_string.h" +#include "ardour/well_known_enum.h" #include "control_protocol/control_protocol.h" @@ -324,7 +325,7 @@ FP8Strip::set_stripable (std::shared_ptr s, bool panmode) recarm_button ().set_active (false); } _peak_meter = s->peak_meter (); - _redux_ctrl = s->comp_redux_controllable (); + _redux_ctrl = s->mapped_output (Comp_Redux); set_select_controllable (std::shared_ptr()); select_button ().set_active (s->is_selected ()); diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index bac48b112d..99fe321535 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -59,6 +59,7 @@ #include "ardour/rc_configuration.h" #include "ardour/midiport_manager.h" #include "ardour/debug.h" +#include "ardour/well_known_enum.h" #include "generic_midi_control_protocol.h" #include "midicontrollable.h" @@ -1238,7 +1239,7 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const if (path.size() == 3) { if (path[2] == X_("enable")) { - c = s->eq_enable_controllable (); + c = s->mapped_control (EQ_Enable); } } else if (path.size() == 4) { @@ -1246,13 +1247,13 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const int band = atoi (path[3]); /* band number */ if (path[2] == X_("gain")) { - c = s->eq_gain_controllable (band); + c = s->mapped_control (EQ_Gain, band); } else if (path[2] == X_("freq")) { - c = s->eq_freq_controllable (band); + c = s->mapped_control (EQ_Freq, band); } else if (path[2] == X_("q")) { - c = s->eq_q_controllable (band); + c = s->mapped_control (EQ_Q, band); } else if (path[2] == X_("shape")) { - c = s->eq_shape_controllable (band); + c = s->mapped_control (EQ_Shape, band); } } @@ -1271,11 +1272,11 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const } if (path[3] == X_("enable")) { - c = s->filter_enable_controllable (filter); + c = s->mapped_control (filter ? HPF_Enable : LPF_Enable); } else if (path[3] == X_("freq")) { - c = s->filter_freq_controllable (filter); + c = s->mapped_control (filter ? HPF_Freq : LPF_Freq); } else if (path[3] == X_("slope")) { - c = s->filter_slope_controllable (filter); + c = s->mapped_control (filter ? HPF_Slope : LPF_Slope); } } @@ -1286,39 +1287,35 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const { if (path[2] == X_("enable")) { - c = s->comp_enable_controllable(); + c = s->mapped_control (Comp_Enable); } else if (path[2] == X_("threshold")) { - c = s->comp_threshold_controllable(); + c = s->mapped_control (Comp_Threshold); } else if (path[2] == X_("mode")) { - c = s->comp_mode_controllable(); - } - else if (path[2] == X_("speed")) - { - c = s->comp_speed_controllable(); + c = s->mapped_control (Comp_Mode); } else if (path[2] == X_("attack")) { - c = s->comp_attack_controllable(); + c = s->mapped_control (Comp_Attack); } else if (path[2] == X_("release")) { - c = s->comp_release_controllable(); + c = s->mapped_control (Comp_Release); } else if (path[2] == X_("makeup")) { - c = s->comp_makeup_controllable(); + c = s->mapped_control (Comp_Makeup); } else if (path[2] == X_("ratio")) { - c = s->comp_ratio_controllable(); + c = s->mapped_control (Comp_Ratio); } else if (path[2] == X_("key_filter_freq")) { - c = s->comp_key_filter_freq_controllable(); + c = s->mapped_control (Comp_KeyFilterFreq); } } } @@ -1328,55 +1325,55 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const { if (path[2] == X_("enable")) { - c = s->gate_enable_controllable(); + c = s->mapped_control (Gate_Enable); } else if (path[2] == X_("threshold")) { - c = s->gate_threshold_controllable(); + c = s->mapped_control (Gate_Threshold); } else if (path[2] == X_("mode")) { - c = s->gate_mode_controllable(); + c = s->mapped_control (Gate_Mode); } else if (path[2] == X_("ratio")) { - c = s->gate_ratio_controllable(); + c = s->mapped_control (Gate_Ratio); } else if (path[2] == X_("knee")) { - c = s->gate_knee_controllable(); + c = s->mapped_control (Gate_Knee); } else if (path[2] == X_("depth")) { - c = s->gate_depth_controllable(); + c = s->mapped_control (Gate_Depth); } else if (path[2] == X_("hysteresis")) { - c = s->gate_hysteresis_controllable(); + c = s->mapped_control (Gate_Hysteresis); } else if (path[2] == X_("hold")) { - c = s->gate_hold_controllable(); + c = s->mapped_control (Gate_Hold); } else if (path[2] == X_("attack")) { - c = s->gate_attack_controllable(); + c = s->mapped_control (Gate_Attack); } else if (path[2] == X_("release")) { - c = s->gate_release_controllable(); + c = s->mapped_control (Gate_Release); } else if (path[2] == X_("key_listen")) { - c = s->gate_key_listen_controllable(); + c = s->mapped_control (Gate_KeyListen); } else if (path[2] == X_("key_filter_enable")) { - c = s->gate_key_filter_enable_controllable(); + c = s->mapped_control (Gate_KeyFilterEnable); } else if (path[2] == X_("key_filter_freq")) { - c = s->gate_key_filter_freq_controllable(); + c = s->mapped_control (Gate_KeyFilterFreq); } } } @@ -1386,11 +1383,11 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const { if (path[2] == X_("drive")) { - c = s->tape_drive_controllable(); + c = s->mapped_control (TapeDrive_Drive); } else if (path[2] == X_("mode")) { - c = s->tape_drive_mode_controllable(); + c = s->mapped_control (TapeDrive_Mode); } } } diff --git a/libs/surfaces/launch_control_xl/controllers.cc b/libs/surfaces/launch_control_xl/controllers.cc index a2f09c157b..f49d74857a 100644 --- a/libs/surfaces/launch_control_xl/controllers.cc +++ b/libs/surfaces/launch_control_xl/controllers.cc @@ -26,6 +26,7 @@ #include "ardour/session.h" #include "ardour/solo_control.h" #include "ardour/solo_isolate_control.h" +#include "ardour/well_known_enum.h" #include "launch_control_xl.h" @@ -95,9 +96,6 @@ LaunchControlXL::build_maps () MAKE_DM_KNOB (SendB6, 34, 13, GreenFull, GreenLow, boost::function (boost::bind (&LaunchControlXL::dm_mb_comp, this, SendB6, CompMakeup)), boost::bind(&LaunchControlXL::dm_mb_comp_enabled,this)); - MAKE_DM_KNOB (SendB7, 35, 14, GreenFull, GreenLow, boost::function - (boost::bind (&LaunchControlXL::dm_mb_comp, this, SendB7, CompSpeed)), - boost::bind(&LaunchControlXL::dm_mb_comp_enabled, this)); MAKE_DM_KNOB (SendB8, 36, 15, GreenFull, GreenLow, boost::function (boost::bind (&LaunchControlXL::dm_mb_comp, this, SendB8, CompMode)), boost::bind(&LaunchControlXL::dm_mb_comp_enabled, this)); @@ -788,7 +786,7 @@ LaunchControlXL::knob_sendB(uint8_t n) if (buttons_down.find(Device) != buttons_down.end()) { // Device button hold #ifdef MIXBUS - ac = stripable[n]->filter_freq_controllable (true); + ac = stripable[n]->mapped_control (HPF_Freq); #else /* something */ #endif @@ -823,7 +821,7 @@ LaunchControlXL::knob_pan(uint8_t n) if (buttons_down.find(Device) != buttons_down.end()) { // Device button hold #ifdef MIXBUS - ac = stripable[n]->comp_threshold_controllable(); + ac = stripable[n]->mapped_control (Comp_Threshold); #else ac = stripable[n]->pan_width_control(); #endif @@ -1278,8 +1276,8 @@ LaunchControlXL::dm_mb_eq_freq_enabled() uint8_t dev_status = dev_nonexistant; - if (first_selected_stripable()->eq_enable_controllable()) { - if (first_selected_stripable()->eq_enable_controllable()->get_value()) { + if (first_selected_stripable()->mapped_control(EQ_Enable)) { + if (first_selected_stripable()->mapped_control(EQ_Enable)->get_value()) { dev_status = dev_active; } else { dev_status = dev_inactive; @@ -1303,8 +1301,8 @@ LaunchControlXL::dm_mb_eq_gain_enabled(uint8_t band) uint8_t dev_status = dev_nonexistant; - if (first_selected_stripable()->eq_enable_controllable()) { - if (first_selected_stripable()->eq_enable_controllable()->get_value()) { + if (first_selected_stripable()->mapped_control(EQ_Enable)) { + if (first_selected_stripable()->mapped_control(EQ_Enable)->get_value()) { dev_status = dev_active; } else { dev_status = dev_inactive; @@ -1328,9 +1326,9 @@ LaunchControlXL::dm_mb_eq (KnobID k, bool gain, uint8_t band) std::shared_ptr ac; std::shared_ptr knob = knob_by_id (k); if (gain) { - ac = first_selected_stripable()->eq_gain_controllable(band); + ac = first_selected_stripable()->mapped_control(EQ_Gain, band); } else { - ac = first_selected_stripable()->eq_freq_controllable(band); + ac = first_selected_stripable()->mapped_control (EQ_Freq, band); } if (ac && check_pick_up(knob, ac)) { @@ -1345,9 +1343,9 @@ LaunchControlXL::dm_mb_eq_shape_switch (uint8_t band) return; } - if (first_selected_stripable()->eq_shape_controllable(band)) { - first_selected_stripable()->eq_shape_controllable(band)->set_value - (!first_selected_stripable()->eq_shape_controllable(band)->get_value(), PBD::Controllable::NoGroup ); + if (first_selected_stripable()->mapped_control (EQ_Shape, band)) { + first_selected_stripable()->mapped_control (EQ_Shape, band)->set_value + (!first_selected_stripable()->mapped_control (EQ_Shape, band)->get_value(), PBD::Controllable::NoGroup ); } } @@ -1361,8 +1359,8 @@ LaunchControlXL::dm_mb_eq_shape_enabled(uint8_t band) uint8_t dev_status = dev_nonexistant; - if (first_selected_stripable()->eq_shape_controllable(band)) { - if (first_selected_stripable()->eq_shape_controllable(band)->get_value()) { + if (first_selected_stripable()->mapped_control (EQ_Shape, band)) { + if (first_selected_stripable()->mapped_control (EQ_Shape, band)->get_value()) { dev_status = dev_active; } else { dev_status = dev_inactive; @@ -1380,9 +1378,9 @@ LaunchControlXL::dm_mb_eq_switch() return; } - if (first_selected_stripable()->eq_enable_controllable()) { - first_selected_stripable()->eq_enable_controllable()->set_value - (!first_selected_stripable()->eq_enable_controllable()->get_value(), PBD::Controllable::NoGroup ); + if (first_selected_stripable()->mapped_control(EQ_Enable)) { + first_selected_stripable()->mapped_control(EQ_Enable)->set_value + (!first_selected_stripable()->mapped_control(EQ_Enable)->get_value(), PBD::Controllable::NoGroup ); } } @@ -1396,9 +1394,9 @@ LaunchControlXL::dm_mb_flt_enabled() DEBUG_TRACE (DEBUG::LaunchControlXL, "dm_mb_flt_enabled()\n"); uint8_t dev_status = dev_nonexistant; - if (first_selected_stripable()->filter_enable_controllable(true)) { + if (first_selected_stripable()->mapped_control (HPF_Enable)) { DEBUG_TRACE (DEBUG::LaunchControlXL, "dm_mb_flt_enabled() - filter exists\n"); - if (first_selected_stripable()->filter_enable_controllable(true)->get_value()) { + if (first_selected_stripable()->mapped_control (HPF_Enable)->get_value()) { DEBUG_TRACE (DEBUG::LaunchControlXL, "dm_mb_flt_enabled: get_value true\n"); dev_status = dev_active; } else { @@ -1417,9 +1415,9 @@ LaunchControlXL::dm_mb_flt_switch() return; } - if (first_selected_stripable()->filter_enable_controllable(true)) { - first_selected_stripable()->filter_enable_controllable(true)->set_value - (!first_selected_stripable()->filter_enable_controllable(true)->get_value(), PBD::Controllable::NoGroup ); + if (first_selected_stripable()->mapped_control (HPF_Enable)) { + first_selected_stripable()->mapped_control (HPF_Enable)->set_value + (!first_selected_stripable()->mapped_control (HPF_Enable)->get_value(), PBD::Controllable::NoGroup ); } } @@ -1435,9 +1433,9 @@ LaunchControlXL::dm_mb_flt_frq (KnobID k, bool hpf) std::shared_ptr ac; std::shared_ptr knob = knob_by_id (k); if (hpf) { - ac = first_selected_stripable()->filter_freq_controllable(true); + ac = first_selected_stripable()->mapped_control (HPF_Freq); } else { - ac = first_selected_stripable()->filter_freq_controllable(false); + ac = first_selected_stripable()->mapped_control (LPF_Freq); } if (ac && check_pick_up(knob, ac)) { @@ -1524,8 +1522,8 @@ LaunchControlXL::dm_mb_comp_enabled() } uint8_t dev_status = dev_nonexistant; - if (first_selected_stripable()->comp_enable_controllable()) { - if (first_selected_stripable()->comp_enable_controllable()->get_value()) { + if (first_selected_stripable()->mapped_control (Comp_Enable)) { + if (first_selected_stripable()->mapped_control (Comp_Enable)->get_value()) { dev_status = dev_active; } else { dev_status = dev_inactive; @@ -1543,11 +1541,11 @@ LaunchControlXL::dm_mb_comp_switch() return; } - if (first_selected_stripable()->comp_enable_controllable()) { + if (first_selected_stripable()->mapped_control (Comp_Enable)) { DEBUG_TRACE (DEBUG::LaunchControlXL, "comp_enable_controllable exists\n"); - DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose("comp_enable_controllable(): '%1'\n", first_selected_stripable()->comp_enable_controllable()->get_value() )); - first_selected_stripable()->comp_enable_controllable()->set_value - (!first_selected_stripable()->comp_enable_controllable()->get_value(), PBD::Controllable::NoGroup); + DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose("mapped_control (Comp_Enable): '%1'\n", first_selected_stripable()->mapped_control (Comp_Enable)->get_value() )); + first_selected_stripable()->mapped_control (Comp_Enable)->set_value + (!first_selected_stripable()->mapped_control (Comp_Enable)->get_value(), PBD::Controllable::NoGroup); } } @@ -1564,13 +1562,10 @@ LaunchControlXL::dm_mb_comp (KnobID k, CompParam c) switch (c) { case (CompMakeup): - ac = first_selected_stripable()->comp_makeup_controllable(); + ac = first_selected_stripable()->mapped_control (Comp_Makeup); break; case (CompMode): - ac = first_selected_stripable()->comp_mode_controllable(); - break; - case (CompSpeed): - ac = first_selected_stripable()->comp_speed_controllable(); + ac = first_selected_stripable()->mapped_control (Comp_Mode); break; } @@ -1595,7 +1590,7 @@ LaunchControlXL::dm_mb_comp_thresh (FaderID id) { fader = f->second; } - ac = first_selected_stripable()->comp_threshold_controllable(); + ac = first_selected_stripable()->mapped_control (Comp_Threshold); if (ac && check_pick_up(fader, ac)) { ac->set_value ( ac->interface_to_internal( fader->value() / 127.0), PBD::Controllable::UseGroup ); } @@ -1627,7 +1622,7 @@ LaunchControlXL::dm_mb_tapedrive (KnobID k) std::shared_ptr ac; std::shared_ptr knob = knob_by_id (k); - ac = first_selected_stripable()->tape_drive_controllable(); + ac = first_selected_stripable()->mapped_control (TapeDrive_Drive); if (ac && check_pick_up(knob, ac)) { ac->set_value ( ac->interface_to_internal( knob->value() / 127.0), PBD::Controllable::UseGroup ); diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.cc b/libs/surfaces/launch_control_xl/launch_control_xl.cc index f316a4dd37..fcf6142f60 100644 --- a/libs/surfaces/launch_control_xl/launch_control_xl.cc +++ b/libs/surfaces/launch_control_xl/launch_control_xl.cc @@ -47,8 +47,7 @@ #include "ardour/types_convert.h" #include "ardour/vca.h" #include "ardour/vca_manager.h" - - +#include "ardour/well_known_enum.h" #include "gtkmm2ext/gui_thread.h" @@ -1177,25 +1176,25 @@ LaunchControlXL::init_dm_callbacks() MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl); } #ifdef MIXBUS - if (first_selected_stripable()->eq_enable_controllable()) { - first_selected_stripable()->eq_enable_controllable()->Changed.connect (stripable_connections, + if (first_selected_stripable()->mapped_control(EQ_Enable)) { + first_selected_stripable()->mapped_control(EQ_Enable)->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons,this), lcxl); } - if (first_selected_stripable()->eq_shape_controllable(0)) { - first_selected_stripable()->eq_shape_controllable(0)->Changed.connect (stripable_connections, + if (first_selected_stripable()->mapped_control (EQ_Shape, 0)) { + first_selected_stripable()->mapped_control (EQ_Shape, 0)->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl); } - if (first_selected_stripable()->eq_shape_controllable(3)) { - first_selected_stripable()->eq_shape_controllable(3)->Changed.connect (stripable_connections, + if (first_selected_stripable()->mapped_control (EQ_Shape, 3)) { + first_selected_stripable()->mapped_control (EQ_Shape, 3)->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl); } - if (first_selected_stripable()->comp_enable_controllable()) { - first_selected_stripable()->comp_enable_controllable()->Changed.connect (stripable_connections, + if (first_selected_stripable()->mapped_control (Comp_Enable)) { + first_selected_stripable()->mapped_control (Comp_Enable)->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons,this), lcxl); } - if (first_selected_stripable()->filter_enable_controllable(true)) { // only handle one case, as Mixbus only has one - first_selected_stripable()->filter_enable_controllable(true)->Changed.connect (stripable_connections, + if (first_selected_stripable()->mapped_control (HPF_Enable)) { // only handle one case, as Mixbus only has one + first_selected_stripable()->mapped_control (HPF_Enable)->Changed.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons, this), lcxl); } if (first_selected_stripable()->master_send_enable_controllable()) { diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.h b/libs/surfaces/launch_control_xl/launch_control_xl.h index e96e9c42ad..9205b9eb57 100644 --- a/libs/surfaces/launch_control_xl/launch_control_xl.h +++ b/libs/surfaces/launch_control_xl/launch_control_xl.h @@ -153,7 +153,6 @@ public: enum CompParam { CompMakeup, CompMode, - CompSpeed }; #endif diff --git a/libs/surfaces/mackie/subview.cc b/libs/surfaces/mackie/subview.cc index 5248e7a10f..118a059276 100644 --- a/libs/surfaces/mackie/subview.cc +++ b/libs/surfaces/mackie/subview.cc @@ -35,6 +35,7 @@ #include "ardour/solo_isolate_control.h" #include "ardour/stripable.h" #include "ardour/track.h" +#include "ardour/well_known_enum.h" #include "mackie_control_protocol.h" #include "pot.h" @@ -329,7 +330,7 @@ void EQSubview::setup_vpot( case 4: case 6: eq_band = global_strip_position / 2; - pc = _subview_stripable->eq_freq_controllable (eq_band); + pc = _subview_stripable->mapped_control (EQ_Freq, eq_band); band_name = _subview_stripable->eq_band_name (eq_band); pot_id = band_name + "Freq"; break; @@ -338,22 +339,22 @@ void EQSubview::setup_vpot( case 5: case 7: eq_band = global_strip_position / 2; - pc = _subview_stripable->eq_gain_controllable (eq_band); + pc = _subview_stripable->mapped_control (EQ_Gain, eq_band); band_name = _subview_stripable->eq_band_name (eq_band); pot_id = band_name + "Gain"; break; case 8: - pc = _subview_stripable->eq_shape_controllable(0); //low band "bell" button + pc = _subview_stripable->mapped_control (EQ_Shape, 0); //low band "bell" button band_name = "lo"; pot_id = band_name + " Shp"; break; case 9: - pc = _subview_stripable->eq_shape_controllable(3); //high band "bell" button + pc = _subview_stripable->mapped_control (EQ_Shape, 3); //high band "bell" button band_name = "hi"; pot_id = band_name + " Shp"; break; case 10: - pc = _subview_stripable->eq_enable_controllable(); + pc = _subview_stripable->mapped_control(EQ_Enable); pot_id = "EQ"; break; } @@ -364,7 +365,7 @@ void EQSubview::setup_vpot( case 1: case 2: eq_band = global_strip_position; - pc = _subview_stripable->eq_gain_controllable (eq_band); + pc = _subview_stripable->mapped_control (EQ_Gain, eq_band); band_name = _subview_stripable->eq_band_name (eq_band); pot_id = band_name + "Gain"; break; @@ -426,7 +427,7 @@ DynamicsSubview::~DynamicsSubview() bool DynamicsSubview::subview_mode_would_be_ok (std::shared_ptr r, std::string& reason_why_not) { - if (r && r->comp_enable_controllable()) { + if (r && r->mapped_control (Comp_Enable)) { return true; } @@ -456,15 +457,22 @@ void DynamicsSubview::setup_vpot( return; } - std::shared_ptr tc = _subview_stripable->comp_threshold_controllable (); - std::shared_ptr sc = _subview_stripable->comp_speed_controllable (); - std::shared_ptr mc = _subview_stripable->comp_mode_controllable (); - std::shared_ptr kc = _subview_stripable->comp_makeup_controllable (); - std::shared_ptr ec = _subview_stripable->comp_enable_controllable (); + std::shared_ptr hpfc = _subview_stripable->mapped_control (HPF_Freq); + std::shared_ptr lpfc = _subview_stripable->mapped_control (LPF_Freq); + std::shared_ptr fec = _subview_stripable->mapped_control (HPF_Enable); // shared HP/LP - std::shared_ptr hpfc = _subview_stripable->filter_freq_controllable (true); - std::shared_ptr lpfc = _subview_stripable->filter_freq_controllable (false); - std::shared_ptr fec = _subview_stripable->filter_enable_controllable (true); // shared HP/LP + std::shared_ptr ctc = _subview_stripable->mapped_control (Comp_Threshold); + std::shared_ptr crc = _subview_stripable->mapped_control (Comp_Ratio); + std::shared_ptr cac = _subview_stripable->mapped_control (Comp_Attack); + std::shared_ptr csc = _subview_stripable->mapped_control (Comp_Release); + std::shared_ptr ckc = _subview_stripable->mapped_control (Comp_Makeup); + std::shared_ptr cec = _subview_stripable->mapped_control (Comp_Enable); + + std::shared_ptr gtc = _subview_stripable->mapped_control (Gate_Threshold); + std::shared_ptr gdc = _subview_stripable->mapped_control (Gate_Depth); + std::shared_ptr gac = _subview_stripable->mapped_control (Gate_Attack); + std::shared_ptr gsc = _subview_stripable->mapped_control (Gate_Release); + std::shared_ptr gec = _subview_stripable->mapped_control (Gate_Enable); /* we will control the global_strip_position-th available parameter, from the list in the * order shown above. @@ -473,16 +481,24 @@ void DynamicsSubview::setup_vpot( std::vector, std::string > > available; std::vector params; - if (tc) { available.push_back (std::make_pair (tc, "Thresh")); } - if (sc) { available.push_back (std::make_pair (sc, mc ? mc->get_user_string () : "Speed")); } - if (mc) { available.push_back (std::make_pair (mc, "Mode")); } - if (kc) { available.push_back (std::make_pair (kc, "Makeup")); } - if (ec) { available.push_back (std::make_pair (ec, "on/off")); } - + //Mixbus32C needs to spill the filter controls into the comp section if (hpfc) { available.push_back (std::make_pair (hpfc, "HPF")); } if (lpfc) { available.push_back (std::make_pair (lpfc, "LPF")); } if (fec) { available.push_back (std::make_pair (fec, "FiltIn")); } + if (ctc) { available.push_back (std::make_pair (ctc, "Thresh")); } + if (crc) { available.push_back (std::make_pair (crc, "Ratio")); } + if (cac) { available.push_back (std::make_pair (cac, "Attk")); } + if (csc) { available.push_back (std::make_pair (csc, "Rels")); } + if (ckc) { available.push_back (std::make_pair (ckc, "Makeup")); } + if (cec) { available.push_back (std::make_pair (cec, "on/off")); } + + if (gtc) { available.push_back (std::make_pair (gtc, "Thresh")); } + if (gdc) { available.push_back (std::make_pair (gdc, "Depth")); } + if (gac) { available.push_back (std::make_pair (gac, "Attk")); } + if (gsc) { available.push_back (std::make_pair (gsc, "Rels")); } + if (gec) { available.push_back (std::make_pair (gec, "on/off")); } + if (global_strip_position >= available.size()) { /* this knob is not needed to control the available parameters */ vpot->set_control (std::shared_ptr()); @@ -534,7 +550,7 @@ DynamicsSubview::notify_change (std::weak_ptr pc, uin if (control) { float val = control->get_value(); - if (control == _subview_stripable->comp_mode_controllable ()) { + if (control == _subview_stripable->mapped_control (Comp_Mode)) { pending_display[1] = control->get_user_string (); } else { do_parameter_display(pending_display[1], control->desc(), val, strip, true); diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 506b68f2bb..5815766aaf 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -68,6 +68,7 @@ #include "ardour/solo_isolate_control.h" #include "ardour/solo_safe_control.h" #include "ardour/vca_manager.h" +#include "ardour/well_known_enum.h" #include "ardour/zeroconf.h" #include "osc_select_observer.h" @@ -592,7 +593,6 @@ OSC::register_callbacks() REGISTER_CALLBACK (serv, X_("/select/pan_lfe_control"), "f", sel_pan_lfe); REGISTER_CALLBACK (serv, X_("/select/comp_enable"), "f", sel_comp_enable); REGISTER_CALLBACK (serv, X_("/select/comp_threshold"), "f", sel_comp_threshold); - REGISTER_CALLBACK (serv, X_("/select/comp_speed"), "f", sel_comp_speed); REGISTER_CALLBACK (serv, X_("/select/comp_mode"), "f", sel_comp_mode); REGISTER_CALLBACK (serv, X_("/select/comp_makeup"), "f", sel_comp_makeup); REGISTER_CALLBACK (serv, X_("/select/eq_enable"), "f", sel_eq_enable); @@ -5752,8 +5752,8 @@ OSC::sel_comp_enable (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->comp_enable_controllable()) { - s->comp_enable_controllable()->set_value (s->comp_enable_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (Comp_Enable)) { + s->mapped_control (Comp_Enable)->set_value (s->mapped_control (Comp_Enable)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5767,29 +5767,14 @@ OSC::sel_comp_threshold (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->comp_threshold_controllable()) { - s->comp_threshold_controllable()->set_value (s->comp_threshold_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (Comp_Threshold)) { + s->mapped_control (Comp_Threshold)->set_value (s->mapped_control (Comp_Threshold)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } return float_message(X_("/select/comp_threshold"), 0, get_address (msg)); } -int -OSC::sel_comp_speed (float val, lo_message msg) -{ - OSCSurface *sur = get_surface(get_address (msg)); - std::shared_ptr s; - s = sur->select; - if (s) { - if (s->comp_speed_controllable()) { - s->comp_speed_controllable()->set_value (s->comp_speed_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); - return 0; - } - } - return float_message(X_("/select/comp_speed"), 0, get_address (msg)); -} - int OSC::sel_comp_mode (float val, lo_message msg) { @@ -5797,8 +5782,8 @@ OSC::sel_comp_mode (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->comp_mode_controllable()) { - s->comp_mode_controllable()->set_value (s->comp_mode_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (Comp_Mode)) { + s->mapped_control (Comp_Mode)->set_value (s->mapped_control (Comp_Mode)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5812,8 +5797,8 @@ OSC::sel_comp_makeup (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->comp_makeup_controllable()) { - s->comp_makeup_controllable()->set_value (s->comp_makeup_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (Comp_Makeup)) { + s->mapped_control (Comp_Makeup)->set_value (s->mapped_control (Comp_Makeup)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5829,8 +5814,8 @@ OSC::sel_eq_enable (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->eq_enable_controllable()) { - s->eq_enable_controllable()->set_value (s->eq_enable_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control(EQ_Enable)) { + s->mapped_control(EQ_Enable)->set_value (s->mapped_control(EQ_Enable)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5844,8 +5829,8 @@ OSC::sel_eq_hpf_freq (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->filter_freq_controllable(true)) { - s->filter_freq_controllable(true)->set_value (s->filter_freq_controllable(true)->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (HPF_Freq)) { + s->mapped_control (HPF_Freq)->set_value (s->mapped_control (HPF_Freq)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5859,8 +5844,8 @@ OSC::sel_eq_lpf_freq (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->filter_freq_controllable(false)) { - s->filter_freq_controllable(false)->set_value (s->filter_freq_controllable(false)->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (LPF_Freq)) { + s->mapped_control (LPF_Freq)->set_value (s->mapped_control (LPF_Freq)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5874,8 +5859,8 @@ OSC::sel_eq_hpf_enable (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->filter_enable_controllable(true)) { - s->filter_enable_controllable(true)->set_value (s->filter_enable_controllable(true)->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (HPF_Enable)) { + s->mapped_control (HPF_Enable)->set_value (s->mapped_control (HPF_Enable)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5889,8 +5874,8 @@ OSC::sel_eq_lpf_enable (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->filter_enable_controllable(false)) { - s->filter_enable_controllable(false)->set_value (s->filter_enable_controllable(false)->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (LPF_Enable)) { + s->mapped_control (LPF_Enable)->set_value (s->mapped_control (LPF_Enable)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5904,8 +5889,8 @@ OSC::sel_eq_hpf_slope (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->filter_slope_controllable(true)) { - s->filter_slope_controllable(true)->set_value (s->filter_slope_controllable(true)->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (HPF_Slope)) { + s->mapped_control (HPF_Slope)->set_value (s->mapped_control (HPF_Slope)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5919,8 +5904,8 @@ OSC::sel_eq_lpf_slope (float val, lo_message msg) std::shared_ptr s; s = sur->select; if (s) { - if (s->filter_slope_controllable(false)) { - s->filter_slope_controllable(false)->set_value (s->filter_slope_controllable(false)->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (LPF_Slope)) { + s->mapped_control (LPF_Slope)->set_value (s->mapped_control (LPF_Slope)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5937,8 +5922,8 @@ OSC::sel_eq_gain (int id, float val, lo_message msg) if (id > 0) { --id; } - if (s->eq_gain_controllable (id)) { - s->eq_gain_controllable (id)->set_value (s->eq_gain_controllable(id)->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (EQ_Gain, id)) { + s->mapped_control (EQ_Gain, id)->set_value (s->mapped_control(EQ_Gain, id)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5955,8 +5940,8 @@ OSC::sel_eq_freq (int id, float val, lo_message msg) if (id > 0) { --id; } - if (s->eq_freq_controllable (id)) { - s->eq_freq_controllable (id)->set_value (s->eq_freq_controllable(id)->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (EQ_Freq, id)) { + s->mapped_control (EQ_Freq, id)->set_value (s->mapped_control (EQ_Freq, id)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5973,8 +5958,8 @@ OSC::sel_eq_q (int id, float val, lo_message msg) if (id > 0) { --id; } - if (s->eq_q_controllable (id)) { - s->eq_q_controllable (id)->set_value (s->eq_q_controllable(id)->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (EQ_Q, id)) { + s->mapped_control (EQ_Q, id)->set_value (s->mapped_control (EQ_Q, id)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } @@ -5991,8 +5976,8 @@ OSC::sel_eq_shape (int id, float val, lo_message msg) if (id > 0) { --id; } - if (s->eq_shape_controllable (id)) { - s->eq_shape_controllable (id)->set_value (s->eq_shape_controllable(id)->interface_to_internal (val), PBD::Controllable::NoGroup); + if (s->mapped_control (EQ_Shape, id)) { + s->mapped_control (EQ_Shape, id)->set_value (s->mapped_control (EQ_Shape, id)->interface_to_internal (val), PBD::Controllable::NoGroup); return 0; } } diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h index 3c760c97b2..9944d5d6da 100644 --- a/libs/surfaces/osc/osc.h +++ b/libs/surfaces/osc/osc.h @@ -553,7 +553,6 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI PATH_CALLBACK1_MSG(sel_plugin_activate,f); PATH_CALLBACK1_MSG(sel_comp_enable,f); PATH_CALLBACK1_MSG(sel_comp_threshold,f); - PATH_CALLBACK1_MSG(sel_comp_speed,f); PATH_CALLBACK1_MSG(sel_comp_mode,f); PATH_CALLBACK1_MSG(sel_comp_makeup,f); PATH_CALLBACK1_MSG(sel_eq_enable,f); @@ -731,7 +730,6 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI int sel_pan_lfe (float val, lo_message msg); int sel_comp_enable (float val, lo_message msg); int sel_comp_threshold (float val, lo_message msg); - int sel_comp_speed (float val, lo_message msg); int sel_comp_mode (float val, lo_message msg); int sel_comp_makeup (float val, lo_message msg); int sel_eq_enable (float val, lo_message msg); diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc index 6fe40a65ca..ef29b34aba 100644 --- a/libs/surfaces/osc/osc_select_observer.cc +++ b/libs/surfaces/osc/osc_select_observer.cc @@ -41,6 +41,7 @@ #include "ardour/processor.h" #include "ardour/readonly_control.h" #include "ardour/vca.h" +#include "ardour/well_known_enum.h" #include "osc.h" #include "osc_select_observer.h" @@ -235,25 +236,21 @@ OSCSelectObserver::refresh_strip (std::shared_ptr new_strip, } // Compressor - if (_strip->comp_enable_controllable ()) { - _strip->comp_enable_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message, this, X_("/select/comp_enable"), _strip->comp_enable_controllable()), OSC::instance()); - enable_message (X_("/select/comp_enable"), _strip->comp_enable_controllable()); + if (_strip->mapped_control (Comp_Enable)) { + _strip->mapped_control (Comp_Enable)->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message, this, X_("/select/comp_enable"), _strip->mapped_control (Comp_Enable)), OSC::instance()); + enable_message (X_("/select/comp_enable"), _strip->mapped_control (Comp_Enable)); } - if (_strip->comp_threshold_controllable ()) { - _strip->comp_threshold_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_threshold"), _strip->comp_threshold_controllable()), OSC::instance()); - change_message (X_("/select/comp_threshold"), _strip->comp_threshold_controllable()); + if (_strip->mapped_control (Comp_Threshold)) { + _strip->mapped_control (Comp_Threshold)->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_threshold"), _strip->mapped_control (Comp_Threshold)), OSC::instance()); + change_message (X_("/select/comp_threshold"), _strip->mapped_control (Comp_Threshold)); } - if (_strip->comp_speed_controllable ()) { - _strip->comp_speed_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_speed"), _strip->comp_speed_controllable()), OSC::instance()); - change_message (X_("/select/comp_speed"), _strip->comp_speed_controllable()); - } - if (_strip->comp_mode_controllable ()) { - _strip->comp_mode_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::comp_mode, this), OSC::instance()); + if (_strip->mapped_control (Comp_Mode)) { + _strip->mapped_control (Comp_Mode)->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::comp_mode, this), OSC::instance()); comp_mode (); } - if (_strip->comp_makeup_controllable ()) { - _strip->comp_makeup_controllable ()->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_makeup"), _strip->comp_makeup_controllable()), OSC::instance()); - change_message (X_("/select/comp_makeup"), _strip->comp_makeup_controllable()); + if (_strip->mapped_control (Comp_Makeup)) { + _strip->mapped_control (Comp_Makeup)->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_makeup"), _strip->mapped_control (Comp_Makeup)), OSC::instance()); + change_message (X_("/select/comp_makeup"), _strip->mapped_control (Comp_Makeup)); } renew_sends (); renew_plugin (); @@ -624,8 +621,8 @@ OSCSelectObserver::tick () gain_message (); } } - if (_strip->comp_redux_controllable() && _strip->comp_enable_controllable() && _strip->comp_enable_controllable()->get_value()) { - float new_value = _strip->comp_redux_controllable()->get_parameter(); + if (_strip->mapped_output (Comp_Redux) && _strip->mapped_control (Comp_Enable) && _strip->mapped_control (Comp_Enable)->get_value()) { + float new_value = _strip->mapped_output (Comp_Redux)->get_parameter(); if (_comp_redux != new_value) { _osc.float_message (X_("/select/comp_redux"), new_value, addr); _comp_redux = new_value; @@ -1060,48 +1057,47 @@ OSCSelectObserver::send_enable (string path, uint32_t id, std::shared_ptrcomp_mode_controllable()); - _osc.text_message (X_("/select/comp_mode_name"), _strip->comp_mode_controllable()->get_user_string(), addr); - _osc.text_message (X_("/select/comp_speed_name"), _strip->comp_speed_controllable()->get_user_string(), addr); + change_message (X_("/select/comp_mode"), _strip->mapped_control (Comp_Mode)); + _osc.text_message (X_("/select/comp_mode_name"), _strip->mapped_control (Comp_Mode)->get_user_string(), addr); } void OSCSelectObserver::eq_init() { // HPF and enable are special case, rest are in bands - if (_strip->filter_enable_controllable (true)) { - _strip->filter_enable_controllable (true)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_hpf/enable"), _strip->filter_enable_controllable (true)), OSC::instance()); - change_message (X_("/select/eq_hpf/enable"), _strip->filter_enable_controllable(true)); + if (_strip->mapped_control (HPF_Enable)) { + _strip->mapped_control (HPF_Enable)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_hpf/enable"), _strip->mapped_control (HPF_Enable)), OSC::instance()); + change_message (X_("/select/eq_hpf/enable"), _strip->mapped_control (HPF_Enable)); } - if (_strip->filter_enable_controllable (false)) { - _strip->filter_enable_controllable (false)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_lpf/enable"), _strip->filter_enable_controllable (false)), OSC::instance()); - change_message (X_("/select/eq_lpf/enable"), _strip->filter_enable_controllable(false)); + if (_strip->mapped_control (LPF_Enable)) { + _strip->mapped_control (LPF_Enable)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_lpf/enable"), _strip->mapped_control (LPF_Enable)), OSC::instance()); + change_message (X_("/select/eq_lpf/enable"), _strip->mapped_control (LPF_Enable)); } - if (_strip->filter_freq_controllable (true)) { - _strip->filter_freq_controllable (true)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_hpf/freq"), _strip->filter_freq_controllable (true)), OSC::instance()); - change_message (X_("/select/eq_hpf/freq"), _strip->filter_freq_controllable(true)); + if (_strip->mapped_control (HPF_Freq)) { + _strip->mapped_control (HPF_Freq)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_hpf/freq"), _strip->mapped_control (HPF_Freq)), OSC::instance()); + change_message (X_("/select/eq_hpf/freq"), _strip->mapped_control (HPF_Freq)); } - if (_strip->filter_freq_controllable (false)) { - _strip->filter_freq_controllable (false)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_lpf/freq"), _strip->filter_freq_controllable (false)), OSC::instance()); - change_message (X_("/select/eq_lpf/freq"), _strip->filter_freq_controllable(false)); + if (_strip->mapped_control (LPF_Freq)) { + _strip->mapped_control (LPF_Freq)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_lpf/freq"), _strip->mapped_control (LPF_Freq)), OSC::instance()); + change_message (X_("/select/eq_lpf/freq"), _strip->mapped_control (LPF_Freq)); } - if (_strip->filter_slope_controllable (true)) { - _strip->filter_slope_controllable (true)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_hpf/slope"), _strip->filter_slope_controllable (true)), OSC::instance()); - change_message (X_("/select/eq_hpf/slope"), _strip->filter_slope_controllable(true)); + if (_strip->mapped_control (HPF_Slope)) { + _strip->mapped_control (HPF_Slope)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_hpf/slope"), _strip->mapped_control (HPF_Slope)), OSC::instance()); + change_message (X_("/select/eq_hpf/slope"), _strip->mapped_control (HPF_Slope)); } - if (_strip->filter_slope_controllable (false)) { - _strip->filter_slope_controllable (false)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_lpf/slope"), _strip->filter_slope_controllable (false)), OSC::instance()); - change_message (X_("/select/eq_lpf/slope"), _strip->filter_slope_controllable(false)); + if (_strip->mapped_control (LPF_Slope)) { + _strip->mapped_control (LPF_Slope)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/eq_lpf/slope"), _strip->mapped_control (LPF_Slope)), OSC::instance()); + change_message (X_("/select/eq_lpf/slope"), _strip->mapped_control (LPF_Slope)); } - if (_strip->eq_enable_controllable ()) { - _strip->eq_enable_controllable ()->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message, this, X_("/select/eq_enable"), _strip->eq_enable_controllable()), OSC::instance()); - enable_message (X_("/select/eq_enable"), _strip->eq_enable_controllable()); + if (_strip->mapped_control (EQ_Enable)) { + _strip->mapped_control (EQ_Enable)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::enable_message, this, X_("/select/eq_enable"), _strip->mapped_control(EQ_Enable)), OSC::instance()); + enable_message (X_("/select/eq_enable"), _strip->mapped_control(EQ_Enable)); } eq_bands = _strip->eq_band_cnt (); @@ -1116,21 +1112,21 @@ OSCSelectObserver::eq_init() if (_strip->eq_band_name(i).size()) { _osc.text_message_with_id (X_("/select/eq_band_name"), i + 1, _strip->eq_band_name (i), in_line, addr); } - if (_strip->eq_gain_controllable (i)) { - _strip->eq_gain_controllable(i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_gain"), i + 1, _strip->eq_gain_controllable(i)), OSC::instance()); - change_message_with_id (X_("/select/eq_gain"), i + 1, _strip->eq_gain_controllable(i)); + if (_strip->mapped_control (EQ_Gain, i)) { + _strip->mapped_control(EQ_Gain, i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_gain"), i + 1, _strip->mapped_control(EQ_Gain, i)), OSC::instance()); + change_message_with_id (X_("/select/eq_gain"), i + 1, _strip->mapped_control(EQ_Gain, i)); } - if (_strip->eq_freq_controllable (i)) { - _strip->eq_freq_controllable(i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_freq"), i + 1, _strip->eq_freq_controllable(i)), OSC::instance()); - change_message_with_id (X_("/select/eq_freq"), i + 1, _strip->eq_freq_controllable(i)); + if (_strip->mapped_control (EQ_Freq, i)) { + _strip->mapped_control (EQ_Freq, i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_freq"), i + 1, _strip->mapped_control (EQ_Freq, i)), OSC::instance()); + change_message_with_id (X_("/select/eq_freq"), i + 1, _strip->mapped_control (EQ_Freq, i)); } - if (_strip->eq_q_controllable (i)) { - _strip->eq_q_controllable(i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_q"), i + 1, _strip->eq_q_controllable(i)), OSC::instance()); - change_message_with_id (X_("/select/eq_q"), i + 1, _strip->eq_q_controllable(i)); + if (_strip->mapped_control (EQ_Q, i)) { + _strip->mapped_control (EQ_Q, i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_q"), i + 1, _strip->mapped_control (EQ_Q, i)), OSC::instance()); + change_message_with_id (X_("/select/eq_q"), i + 1, _strip->mapped_control (EQ_Q, i)); } - if (_strip->eq_shape_controllable (i)) { - _strip->eq_shape_controllable(i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_shape"), i + 1, _strip->eq_shape_controllable(i)), OSC::instance()); - change_message_with_id (X_("/select/eq_shape"), i + 1, _strip->eq_shape_controllable(i)); + if (_strip->mapped_control (EQ_Shape, i)) { + _strip->mapped_control (EQ_Shape, i)->Changed.connect (eq_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message_with_id, this, X_("/select/eq_shape"), i + 1, _strip->mapped_control (EQ_Shape, i)), OSC::instance()); + change_message_with_id (X_("/select/eq_shape"), i + 1, _strip->mapped_control (EQ_Shape, i)); } } } diff --git a/libs/surfaces/us2400/strip.cc b/libs/surfaces/us2400/strip.cc index f74e87eef0..ab2d9383f6 100644 --- a/libs/surfaces/us2400/strip.cc +++ b/libs/surfaces/us2400/strip.cc @@ -55,6 +55,7 @@ #include "ardour/user_bundle.h" #include "ardour/profile.h" #include "ardour/value_as_string.h" +#include "ardour/well_known_enum.h" #include "us2400_control_protocol.h" #include "surface_port.h" @@ -816,20 +817,20 @@ Strip::setup_trackview_vpot (std::shared_ptr r) break; case 2: - pc = r->comp_threshold_controllable(); + pc = r->mapped_control (Comp_Threshold); break; case 3: - pc = r->comp_speed_controllable(); + pc = r->mapped_control (Comp_Attack); break; case 4: - pc = r->comp_mode_controllable(); + pc = r->mapped_control (Comp_Mode); _vpot->set_mode(Pot::wrap); break; case 5: - pc = r->comp_makeup_controllable(); + pc = r->mapped_control (Comp_Makeup); break; @@ -847,14 +848,14 @@ Strip::setup_trackview_vpot (std::shared_ptr r) break; case 7: - pc = r->tape_drive_controllable(); + pc = r->mapped_control (TapeDrive_Drive); break; case 8: case 9: case 10: eq_band = (global_pos-8); - pc = r->eq_gain_controllable (eq_band); + pc = r->mapped_control (EQ_Gain, eq_band); _vpot->set_mode(Pot::boost_cut); break; } @@ -863,24 +864,24 @@ Strip::setup_trackview_vpot (std::shared_ptr r) switch (global_pos) { case 6: - pc = r->filter_freq_controllable(true); + pc = r->mapped_control (HPF_Freq); break; case 7: - pc = r->filter_freq_controllable(false); + pc = r->mapped_control (LPF_Freq); break; case 8: case 10: case 12: case 14: { eq_band = (global_pos-8) / 2; - pc = r->eq_freq_controllable (eq_band); + pc = r->mapped_control (EQ_Freq, eq_band); } break; case 9: case 11: case 13: case 15: { eq_band = (global_pos-8) / 2; - pc = r->eq_gain_controllable (eq_band); + pc = r->mapped_control (EQ_Gain, eq_band); _vpot->set_mode(Pot::boost_cut); } break; }