Update Ctrl Surfaces: use new well-known-ctrl API

This commit is contained in:
Robin Gareus 2024-01-13 03:08:51 +01:00
parent a7e36f77ac
commit 70a0b47cef
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
14 changed files with 400 additions and 410 deletions

View file

@ -57,6 +57,7 @@
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/session_configuration.h" #include "ardour/session_configuration.h"
#include "ardour/track.h" #include "ardour/track.h"
#include "ardour/well_known_enum.h"
#include "cc121.h" #include "cc121.h"
@ -397,35 +398,35 @@ CC121::encoder_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
break; break;
case 0x20: case 0x20:
/* EQ 1 Q */ /* 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; break;
case 0x21: case 0x21:
/* EQ 2 Q */ /* 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; break;
case 0x22: case 0x22:
/* EQ 3 Q */ /* 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; break;
case 0x23: case 0x23:
/* EQ 4 Q */ /* 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; break;
case 0x30: case 0x30:
/* EQ 1 Frequency */ /* 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; break;
case 0x31: case 0x31:
/* EQ 2 Frequency */ /* 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; break;
case 0x32: case 0x32:
/* EQ 3 Frequency */ /* 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; break;
case 0x33: case 0x33:
/* EQ 4 Frequency */ /* 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; break;
case 0x3C: case 0x3C:
/* AI */ /* AI */
@ -448,19 +449,19 @@ CC121::encoder_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
break; break;
case 0x40: case 0x40:
/* EQ 1 Gain */ /* 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; break;
case 0x41: case 0x41:
/* EQ 2 Gain */ /* 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; break;
case 0x42: case 0x42:
/* EQ 3 Gain */ /* 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; break;
case 0x43: case 0x43:
/* EQ 4 Gain */ /* 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; break;
case 0x50: case 0x50:
/* Value */ /* Value */

View file

@ -21,6 +21,7 @@
#include "ardour/phase_control.h" #include "ardour/phase_control.h"
#include "ardour/presentation_info.h" #include "ardour/presentation_info.h"
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/well_known_enum.h"
#include "c1_control.h" #include "c1_control.h"
#include "console1.h" #include "console1.h"
@ -211,19 +212,19 @@ Console1::zoom (const uint32_t value)
void void
Console1::filter (const uint32_t value) 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; return;
session->set_control ( 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 void
Console1::low_cut (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->filter_freq_controllable (true); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (HPF_Freq);
double freq = midi_to_control (control, value); double freq = midi_to_control (control, value);
session->set_control (control, freq, PBD::Controllable::UseGroup); session->set_control (control, freq, PBD::Controllable::UseGroup);
} }
@ -231,10 +232,10 @@ Console1::low_cut (const uint32_t value)
void void
Console1::high_cut (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->filter_freq_controllable (false); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (LPF_Freq);
double freq = midi_to_control (control, value); double freq = midi_to_control (control, value);
session->set_control (control, freq, PBD::Controllable::UseGroup); session->set_control (control, freq, PBD::Controllable::UseGroup);
} }
@ -243,35 +244,35 @@ Console1::high_cut (const uint32_t value)
void void
Console1::gate (const uint32_t value) Console1::gate (const uint32_t value)
{ {
if (!_current_stripable || !_current_stripable->gate_enable_controllable ()) if (!_current_stripable || !_current_stripable->mapped_control (Gate_Enable))
return; 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 void
Console1::gate_scf (const uint32_t value) 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; return;
session->set_control ( 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 void
Console1::gate_listen (const uint32_t value) 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; 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 void
Console1::gate_thresh (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->gate_threshold_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Threshold);
double freq = midi_to_control (control, value); double freq = midi_to_control (control, value);
session->set_control (control, freq, PBD::Controllable::UseGroup); session->set_control (control, freq, PBD::Controllable::UseGroup);
} }
@ -279,10 +280,10 @@ Console1::gate_thresh (const uint32_t value)
void void
Console1::gate_depth (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->gate_depth_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Depth);
double freq = midi_to_control (control, value); double freq = midi_to_control (control, value);
session->set_control (control, freq, PBD::Controllable::UseGroup); session->set_control (control, freq, PBD::Controllable::UseGroup);
} }
@ -290,10 +291,10 @@ Console1::gate_depth (const uint32_t value)
void void
Console1::gate_release (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->gate_release_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Release);
double freq = midi_to_control (control, value); double freq = midi_to_control (control, value);
session->set_control (control, freq, PBD::Controllable::UseGroup); session->set_control (control, freq, PBD::Controllable::UseGroup);
} }
@ -301,10 +302,10 @@ Console1::gate_release (const uint32_t value)
void void
Console1::gate_attack (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->gate_attack_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Attack);
double freq = midi_to_control (control, value); double freq = midi_to_control (control, value);
session->set_control (control, freq, PBD::Controllable::UseGroup); session->set_control (control, freq, PBD::Controllable::UseGroup);
} }
@ -312,10 +313,10 @@ Console1::gate_attack (const uint32_t value)
void void
Console1::gate_hyst (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->gate_hysteresis_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Hysteresis);
double freq = midi_to_control (control, value); double freq = midi_to_control (control, value);
session->set_control (control, freq, PBD::Controllable::UseGroup); session->set_control (control, freq, PBD::Controllable::UseGroup);
} }
@ -323,10 +324,10 @@ Console1::gate_hyst (const uint32_t value)
void void
Console1::gate_hold (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->gate_hold_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Hold);
double freq = midi_to_control (control, value); double freq = midi_to_control (control, value);
session->set_control (control, freq, PBD::Controllable::UseGroup); session->set_control (control, freq, PBD::Controllable::UseGroup);
} }
@ -334,10 +335,10 @@ Console1::gate_hold (const uint32_t value)
void void
Console1::gate_filter_freq (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->gate_key_filter_freq_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_KeyFilterFreq);
double freq = midi_to_control (control, value); double freq = midi_to_control (control, value);
session->set_control (control, freq, PBD::Controllable::UseGroup); session->set_control (control, freq, PBD::Controllable::UseGroup);
} }
@ -351,8 +352,8 @@ Console1::eq (const uint32_t value)
if (!_current_stripable) { if (!_current_stripable) {
return; return;
} }
if (_current_stripable->eq_enable_controllable ()) if (_current_stripable->mapped_control (EQ_Enable))
session->set_control (_current_stripable->eq_enable_controllable (), value > 0, PBD::Controllable::UseGroup); session->set_control (_current_stripable->mapped_control (EQ_Enable), value > 0, PBD::Controllable::UseGroup);
else else
map_eq (); map_eq ();
} }
@ -364,8 +365,8 @@ Console1::eq_low_shape (const uint32_t value)
if (!_current_stripable) { if (!_current_stripable) {
return; return;
} }
if (_current_stripable->eq_shape_controllable (0)) if (_current_stripable->mapped_control (EQ_Shape, 0))
session->set_control (_current_stripable->eq_shape_controllable (0), value > 0, PBD::Controllable::UseGroup); session->set_control (_current_stripable->mapped_control (EQ_Shape, 0), value > 0, PBD::Controllable::UseGroup);
else else
map_eq_low_shape (); map_eq_low_shape ();
} }
@ -377,8 +378,8 @@ Console1::eq_high_shape (const uint32_t value)
if (!_current_stripable) { if (!_current_stripable) {
return; return;
} }
if (_current_stripable->eq_shape_controllable (3)) if (_current_stripable->mapped_control (EQ_Shape, 3))
session->set_control (_current_stripable->eq_shape_controllable (3), value > 0, PBD::Controllable::UseGroup); session->set_control (_current_stripable->mapped_control (EQ_Shape, 3), value > 0, PBD::Controllable::UseGroup);
else else
map_eq_high_shape (); map_eq_high_shape ();
} }
@ -386,10 +387,10 @@ Console1::eq_high_shape (const uint32_t value)
void void
Console1::eq_freq (const uint32_t band, uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->eq_freq_controllable (band); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (EQ_Freq, band);
double freq = midi_to_control (control, value); double freq = midi_to_control (control, value);
session->set_control (control, freq, PBD::Controllable::UseGroup); session->set_control (control, freq, PBD::Controllable::UseGroup);
} }
@ -397,10 +398,10 @@ Console1::eq_freq (const uint32_t band, uint32_t value)
void void
Console1::eq_gain (const uint32_t band, uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->eq_gain_controllable (band); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (EQ_Gain, band);
double gain = midi_to_control (control, value); double gain = midi_to_control (control, value);
session->set_control (control, gain, PBD::Controllable::UseGroup); 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 void
Console1::drive (const uint32_t value) Console1::drive (const uint32_t value)
{ {
if (!_current_stripable || !_current_stripable->tape_drive_controllable ()) { if (!_current_stripable || !_current_stripable->mapped_control (TapeDrive_Drive)) {
return; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->tape_drive_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (TapeDrive_Drive);
if (_current_stripable->presentation_info ().flags () & PresentationInfo::AudioTrack) { if (_current_stripable->presentation_info ().flags () & PresentationInfo::AudioTrack) {
DEBUG_TRACE (DEBUG::Console1, string_compose ("drive audio track %1\n", value)); DEBUG_TRACE (DEBUG::Console1, string_compose ("drive audio track %1\n", value));
session->set_control (control, value > 62 ? 1 : 0, PBD::Controllable::UseGroup); session->set_control (control, value > 62 ? 1 : 0, PBD::Controllable::UseGroup);
@ -462,27 +463,27 @@ Console1::drive (const uint32_t value)
void void
Console1::comp (const uint32_t value) Console1::comp (const uint32_t value)
{ {
if (!_current_stripable || !_current_stripable->comp_enable_controllable ()) if (!_current_stripable || !_current_stripable->mapped_control (Comp_Enable))
return; 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 void
Console1::comp_mode (const uint32_t value) 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; return;
int new_val = value == 63 ? 1 : value == 127 ? 2 : 0; 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 void
Console1::comp_thresh (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->comp_threshold_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_Threshold);
double gain = midi_to_control (control, value); double gain = midi_to_control (control, value);
session->set_control (control, gain, PBD::Controllable::UseGroup); session->set_control (control, gain, PBD::Controllable::UseGroup);
} }
@ -490,10 +491,10 @@ Console1::comp_thresh (const uint32_t value)
void void
Console1::comp_attack (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->comp_attack_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_Attack);
double gain = midi_to_control (control, value); double gain = midi_to_control (control, value);
session->set_control (control, gain, PBD::Controllable::UseGroup); session->set_control (control, gain, PBD::Controllable::UseGroup);
} }
@ -501,10 +502,10 @@ Console1::comp_attack (const uint32_t value)
void void
Console1::comp_release (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->comp_release_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_Release);
double gain = midi_to_control (control, value); double gain = midi_to_control (control, value);
session->set_control (control, gain, PBD::Controllable::UseGroup); session->set_control (control, gain, PBD::Controllable::UseGroup);
} }
@ -512,10 +513,10 @@ Console1::comp_release (const uint32_t value)
void void
Console1::comp_ratio (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->comp_ratio_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_Ratio);
double gain = midi_to_control (control, value); double gain = midi_to_control (control, value);
session->set_control (control, gain, PBD::Controllable::UseGroup); session->set_control (control, gain, PBD::Controllable::UseGroup);
} }
@ -523,10 +524,10 @@ Console1::comp_ratio (const uint32_t value)
void void
Console1::comp_makeup (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->comp_makeup_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_Makeup);
double gain = midi_to_control (control, value); double gain = midi_to_control (control, value);
session->set_control (control, gain, PBD::Controllable::UseGroup); session->set_control (control, gain, PBD::Controllable::UseGroup);
} }
@ -534,10 +535,10 @@ Console1::comp_makeup (const uint32_t value)
void void
Console1::comp_emph (const uint32_t value) 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; return;
} }
std::shared_ptr<AutomationControl> control = _current_stripable->comp_key_filter_freq_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_KeyFilterFreq);
double gain = midi_to_control (control, value); double gain = midi_to_control (control, value);
session->set_control (control, gain, PBD::Controllable::UseGroup); session->set_control (control, gain, PBD::Controllable::UseGroup);
} }
@ -729,8 +730,8 @@ Console1::map_filter ()
} }
try { try {
get_button (ControllerID::FILTER_TO_COMPRESSORS) get_button (ControllerID::FILTER_TO_COMPRESSORS)
->set_led_state (_current_stripable->filter_enable_controllable (true) ->set_led_state (_current_stripable->mapped_control (HPF_Enable)
? _current_stripable->filter_enable_controllable (true)->get_value () ? _current_stripable->mapped_control (HPF_Enable)->get_value ()
: false); : false);
} catch (ControlNotFoundException const&) { } catch (ControlNotFoundException const&) {
DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
@ -742,7 +743,7 @@ Console1::map_low_cut ()
{ {
ControllerID controllerID = ControllerID::LOW_CUT; ControllerID controllerID = ControllerID::LOW_CUT;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->filter_freq_controllable (true); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (HPF_Freq);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -752,7 +753,7 @@ Console1::map_high_cut ()
{ {
ControllerID controllerID = ControllerID::HIGH_CUT; ControllerID controllerID = ControllerID::HIGH_CUT;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->filter_freq_controllable (false); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (LPF_Freq);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -765,8 +766,8 @@ Console1::map_gate ()
return; return;
try { try {
get_button (ControllerID::SHAPE) get_button (ControllerID::SHAPE)
->set_led_state (_current_stripable->gate_enable_controllable () ->set_led_state (_current_stripable->mapped_control (Gate_Enable)
? _current_stripable->gate_enable_controllable ()->get_value () ? _current_stripable->mapped_control (Gate_Enable)->get_value ()
: false); : false);
} catch (ControlNotFoundException const&) { } catch (ControlNotFoundException const&) {
DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
@ -781,8 +782,8 @@ Console1::map_gate_scf ()
try { try {
DEBUG_TRACE (DEBUG::Console1, string_compose ("map_gate_scf() - shift: %1\n", shift_state)); DEBUG_TRACE (DEBUG::Console1, string_compose ("map_gate_scf() - shift: %1\n", shift_state));
get_button (ControllerID::HARD_GATE) get_button (ControllerID::HARD_GATE)
->set_led_state (_current_stripable->gate_key_filter_enable_controllable () ->set_led_state (_current_stripable->mapped_control (Gate_KeyFilterEnable)
? _current_stripable->gate_key_filter_enable_controllable ()->get_value () ? _current_stripable->mapped_control (Gate_KeyFilterEnable)->get_value ()
: false); : false);
} catch (ControlNotFoundException const&) { } catch (ControlNotFoundException const&) {
DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
@ -797,8 +798,8 @@ Console1::map_gate_listen ()
try { try {
DEBUG_TRACE (DEBUG::Console1, string_compose ("map_gate_listen() - shift: %1\n", shift_state)); DEBUG_TRACE (DEBUG::Console1, string_compose ("map_gate_listen() - shift: %1\n", shift_state));
get_button (ControllerID::HARD_GATE) get_button (ControllerID::HARD_GATE)
->set_led_state (_current_stripable->gate_key_listen_controllable () ->set_led_state (_current_stripable->mapped_control (Gate_KeyListen)
? _current_stripable->gate_key_listen_controllable ()->get_value () ? _current_stripable->mapped_control (Gate_KeyListen)->get_value ()
: false); : false);
} catch (ControlNotFoundException const&) { } catch (ControlNotFoundException const&) {
DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
@ -810,7 +811,7 @@ Console1::map_gate_thresh ()
{ {
ControllerID controllerID = ControllerID::SHAPE_GATE; ControllerID controllerID = ControllerID::SHAPE_GATE;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->gate_threshold_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Threshold);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -823,7 +824,7 @@ Console1::map_gate_release ()
} }
ControllerID controllerID = ControllerID::SHAPE_RELEASE; ControllerID controllerID = ControllerID::SHAPE_RELEASE;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->gate_release_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Release);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -836,7 +837,7 @@ Console1::map_gate_attack ()
} }
ControllerID controllerID = ControllerID::SHAPE_SUSTAIN; ControllerID controllerID = ControllerID::SHAPE_SUSTAIN;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->gate_attack_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Attack);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -849,7 +850,7 @@ Console1::map_gate_depth ()
} }
ControllerID controllerID = ControllerID::SHAPE_PUNCH; ControllerID controllerID = ControllerID::SHAPE_PUNCH;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->gate_depth_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Depth);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -862,7 +863,7 @@ Console1::map_gate_hyst ()
} }
ControllerID controllerID = ControllerID::SHAPE_RELEASE; ControllerID controllerID = ControllerID::SHAPE_RELEASE;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->gate_hysteresis_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Hysteresis);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -875,7 +876,7 @@ Console1::map_gate_hold ()
} }
ControllerID controllerID = ControllerID::SHAPE_SUSTAIN; ControllerID controllerID = ControllerID::SHAPE_SUSTAIN;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->gate_hold_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_Hold);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -888,7 +889,7 @@ Console1::map_gate_filter_freq ()
} }
ControllerID controllerID = ControllerID::SHAPE_PUNCH; ControllerID controllerID = ControllerID::SHAPE_PUNCH;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->gate_key_filter_freq_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Gate_KeyFilterFreq);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -900,8 +901,8 @@ Console1::map_eq ()
if (!_current_stripable) if (!_current_stripable)
return; return;
try { try {
get_button (EQ)->set_led_state (_current_stripable->eq_enable_controllable () get_button (EQ)->set_led_state (_current_stripable->mapped_control (EQ_Enable)
? _current_stripable->eq_enable_controllable ()->get_value () ? _current_stripable->mapped_control (EQ_Enable)->get_value ()
: false); : false);
} catch (ControlNotFoundException const&) { } catch (ControlNotFoundException const&) {
DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); 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); ControllerID controllerID = eq_freq_controller_for_band (band);
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->eq_freq_controllable (band); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (EQ_Freq, band);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -929,7 +930,7 @@ Console1::map_eq_gain (const uint32_t band)
} }
ControllerID controllerID = eq_gain_controller_for_band (band); ControllerID controllerID = eq_gain_controller_for_band (band);
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->eq_gain_controllable (band); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (EQ_Gain, band);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -940,8 +941,8 @@ Console1::map_eq_low_shape ()
if (!_current_stripable) if (!_current_stripable)
return; return;
try { try {
uint32_t led_value = _current_stripable->eq_shape_controllable (0) uint32_t led_value = _current_stripable->mapped_control (EQ_Shape, 0)
? _current_stripable->eq_shape_controllable (0)->get_value () == 0 ? 0 : 63 ? _current_stripable->mapped_control (EQ_Shape, 0)->get_value () == 0 ? 0 : 63
: 0; : 0;
get_button (ControllerID::LOW_SHAPE)->set_led_state (led_value); get_button (ControllerID::LOW_SHAPE)->set_led_state (led_value);
} catch (ControlNotFoundException const&) { } catch (ControlNotFoundException const&) {
@ -955,8 +956,8 @@ Console1::map_eq_high_shape ()
if (!_current_stripable) if (!_current_stripable)
return; return;
try { try {
uint32_t led_value = _current_stripable->eq_shape_controllable (3) uint32_t led_value = _current_stripable->mapped_control (EQ_Shape, 3)
? _current_stripable->eq_shape_controllable (3)->get_value () == 0 ? 0 : 63 ? _current_stripable->mapped_control (EQ_Shape, 3)->get_value () == 0 ? 0 : 63
: 0; : 0;
get_button (ControllerID::HIGH_SHAPE)->set_led_state (led_value); get_button (ControllerID::HIGH_SHAPE)->set_led_state (led_value);
} catch (ControlNotFoundException const&) { } catch (ControlNotFoundException const&) {
@ -971,7 +972,7 @@ Console1::map_drive ()
ControllerID controllerID = ControllerID::CHARACTER; ControllerID controllerID = ControllerID::CHARACTER;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->tape_drive_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (TapeDrive_Drive);
if (control && _current_stripable->presentation_info ().flags () & PresentationInfo::AudioTrack) { if (control && _current_stripable->presentation_info ().flags () & PresentationInfo::AudioTrack) {
double val = control->get_value (); double val = control->get_value ();
DEBUG_TRACE (DEBUG::Console1, string_compose ("map_drive audio track %1\n", val)); DEBUG_TRACE (DEBUG::Console1, string_compose ("map_drive audio track %1\n", val));
@ -1018,8 +1019,8 @@ Console1::map_comp ()
return; return;
try { try {
get_button (ControllerID::COMP) get_button (ControllerID::COMP)
->set_led_state (_current_stripable->comp_enable_controllable () ->set_led_state (_current_stripable->mapped_control (Comp_Enable)
? _current_stripable->comp_enable_controllable ()->get_value () ? _current_stripable->mapped_control (Comp_Enable)->get_value ()
: false); : false);
} catch (ControlNotFoundException const&) { } catch (ControlNotFoundException const&) {
DEBUG_TRACE (DEBUG::Console1, "Button not found\n"); DEBUG_TRACE (DEBUG::Console1, "Button not found\n");
@ -1032,8 +1033,8 @@ Console1::map_comp_mode ()
if (!_current_stripable) if (!_current_stripable)
return; return;
try { try {
double value = _current_stripable->comp_mode_controllable () double value = _current_stripable->mapped_control (Comp_Mode)
? _current_stripable->comp_mode_controllable ()->get_value () ? _current_stripable->mapped_control (Comp_Mode)->get_value ()
: false; : false;
DEBUG_TRACE (DEBUG::Console1, string_compose ("****value from comp-type %1\n", value)); DEBUG_TRACE (DEBUG::Console1, string_compose ("****value from comp-type %1\n", value));
get_mbutton (ControllerID::ORDER)->set_led_state (value); get_mbutton (ControllerID::ORDER)->set_led_state (value);
@ -1047,7 +1048,7 @@ Console1::map_comp_thresh ()
{ {
ControllerID controllerID = ControllerID::COMP_THRESH; ControllerID controllerID = ControllerID::COMP_THRESH;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->comp_threshold_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_Threshold);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -1057,7 +1058,7 @@ Console1::map_comp_attack ()
{ {
ControllerID controllerID = ControllerID::COMP_ATTACK; ControllerID controllerID = ControllerID::COMP_ATTACK;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->comp_attack_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_Attack);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -1067,7 +1068,7 @@ Console1::map_comp_release ()
{ {
ControllerID controllerID = ControllerID::COMP_RELEASE; ControllerID controllerID = ControllerID::COMP_RELEASE;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->comp_release_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_Release);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -1077,7 +1078,7 @@ Console1::map_comp_ratio ()
{ {
ControllerID controllerID = ControllerID::COMP_RATIO; ControllerID controllerID = ControllerID::COMP_RATIO;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->comp_ratio_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_Ratio);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -1087,7 +1088,7 @@ Console1::map_comp_makeup ()
{ {
ControllerID controllerID = ControllerID::COMP_PAR; ControllerID controllerID = ControllerID::COMP_PAR;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->comp_makeup_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_Makeup);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }
@ -1097,7 +1098,7 @@ Console1::map_comp_emph ()
{ {
ControllerID controllerID = ControllerID::DRIVE; ControllerID controllerID = ControllerID::DRIVE;
if (map_encoder (controllerID)) { if (map_encoder (controllerID)) {
std::shared_ptr<AutomationControl> control = _current_stripable->comp_key_filter_freq_controllable (); std::shared_ptr<AutomationControl> control = _current_stripable->mapped_control (Comp_KeyFilterFreq);
map_encoder (controllerID, control); map_encoder (controllerID, control);
} }
} }

View file

@ -35,6 +35,7 @@
#include "ardour/stripable.h" #include "ardour/stripable.h"
#include "ardour/track.h" #include "ardour/track.h"
#include "ardour/vca_manager.h" #include "ardour/vca_manager.h"
#include "ardour/well_known_enum.h"
#include "console1.h" #include "console1.h"
#include "c1_control.h" #include "c1_control.h"
@ -550,8 +551,8 @@ Console1::set_current_stripable (std::shared_ptr<Stripable> r)
DEBUG_TRACE (DEBUG::Console1, string_compose ("current_stripable %1 - %2\n", pi.order (), pi.flags ())); DEBUG_TRACE (DEBUG::Console1, string_compose ("current_stripable %1 - %2\n", pi.order (), pi.flags ()));
gate_redux_meter = _current_stripable->gate_redux_controllable (); gate_redux_meter = _current_stripable->mapped_output (Gate_Redux);
comp_redux_meter = _current_stripable->comp_redux_controllable (); comp_redux_meter = _current_stripable->mapped_output (Comp_Redux);
/* /*
Support all types of pan controls / find first available control Support all types of pan controls / find first available control
@ -623,102 +624,102 @@ Console1::set_current_stripable (std::shared_ptr<Stripable> r)
} }
// Filter Section // Filter Section
if (_current_stripable->filter_enable_controllable (true)) { if (_current_stripable->mapped_control (HPF_Enable)) {
_current_stripable->filter_enable_controllable (true)->Changed.connect ( _current_stripable->mapped_control (HPF_Enable)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_filter, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_filter, this), this);
} }
if (_current_stripable->filter_freq_controllable (true)) { if (_current_stripable->mapped_control (HPF_Freq)) {
_current_stripable->filter_freq_controllable (true)->Changed.connect ( _current_stripable->mapped_control (HPF_Freq)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_low_cut, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_low_cut, this), this);
} }
if (_current_stripable->filter_freq_controllable (false)) { if (_current_stripable->mapped_control (LPF_Freq)) {
_current_stripable->filter_freq_controllable (false)->Changed.connect ( _current_stripable->mapped_control (LPF_Freq)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_high_cut, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_high_cut, this), this);
} }
// Gate Section // Gate Section
if (_current_stripable->gate_enable_controllable ()) { if (_current_stripable->mapped_control (Gate_Enable)) {
_current_stripable->gate_enable_controllable ()->Changed.connect ( _current_stripable->mapped_control (Gate_Enable)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate, this), this);
} }
if (_current_stripable->gate_key_filter_enable_controllable ()) { if (_current_stripable->mapped_control (Gate_KeyFilterEnable)) {
_current_stripable->gate_key_filter_enable_controllable ()->Changed.connect ( _current_stripable->mapped_control (Gate_KeyFilterEnable)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_scf, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_scf, this), this);
} }
if (_current_stripable->gate_key_listen_controllable ()) { if (_current_stripable->mapped_control (Gate_KeyListen)) {
_current_stripable->gate_key_listen_controllable ()->Changed.connect ( _current_stripable->mapped_control (Gate_KeyListen)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_listen, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_listen, this), this);
} }
if (_current_stripable->gate_threshold_controllable ()) { if (_current_stripable->mapped_control (Gate_Threshold)) {
_current_stripable->gate_threshold_controllable ()->Changed.connect ( _current_stripable->mapped_control (Gate_Threshold)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_thresh, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_thresh, this), this);
} }
if (_current_stripable->gate_depth_controllable ()) { if (_current_stripable->mapped_control (Gate_Depth)) {
_current_stripable->gate_depth_controllable ()->Changed.connect ( _current_stripable->mapped_control (Gate_Depth)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_depth, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_depth, this), this);
} }
if (_current_stripable->gate_release_controllable ()) { if (_current_stripable->mapped_control (Gate_Release)) {
_current_stripable->gate_release_controllable ()->Changed.connect ( _current_stripable->mapped_control (Gate_Release)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_release, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_release, this), this);
} }
if (_current_stripable->gate_attack_controllable ()) { if (_current_stripable->mapped_control (Gate_Attack)) {
_current_stripable->gate_attack_controllable ()->Changed.connect ( _current_stripable->mapped_control (Gate_Attack)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_attack, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_attack, this), this);
} }
if (_current_stripable->gate_hysteresis_controllable ()) { if (_current_stripable->mapped_control (Gate_Hysteresis)) {
_current_stripable->gate_hysteresis_controllable ()->Changed.connect ( _current_stripable->mapped_control (Gate_Hysteresis)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_hyst, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_hyst, this), this);
} }
if (_current_stripable->gate_hold_controllable ()) { if (_current_stripable->mapped_control (Gate_Hold)) {
_current_stripable->gate_hold_controllable ()->Changed.connect ( _current_stripable->mapped_control (Gate_Hold)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_hold, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_hold, this), this);
} }
if (_current_stripable->gate_key_filter_freq_controllable ()) { if (_current_stripable->mapped_control (Gate_KeyFilterFreq)) {
_current_stripable->gate_key_filter_freq_controllable ()->Changed.connect ( _current_stripable->mapped_control (Gate_KeyFilterFreq)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_filter_freq, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_gate_filter_freq, this), this);
} }
// EQ Section // EQ Section
if (_current_stripable->eq_enable_controllable ()) { if (_current_stripable->mapped_control (EQ_Enable)) {
_current_stripable->eq_enable_controllable ()->Changed.connect ( _current_stripable->mapped_control (EQ_Enable)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq, this), this);
} }
for (uint32_t i = 0; i < _current_stripable->eq_band_cnt (); ++i) { for (uint32_t i = 0; i < _current_stripable->eq_band_cnt (); ++i) {
if (_current_stripable->eq_freq_controllable (i)) { if (_current_stripable->mapped_control (EQ_Freq, i)) {
_current_stripable->eq_freq_controllable (i)->Changed.connect ( _current_stripable->mapped_control (EQ_Freq, i)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_freq, this, i), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_freq, this, i), this);
} }
if (_current_stripable->eq_gain_controllable (i)) { if (_current_stripable->mapped_control (EQ_Gain, i)) {
_current_stripable->eq_gain_controllable (i)->Changed.connect ( _current_stripable->mapped_control (EQ_Gain, i)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_gain, this, i), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_gain, this, i), this);
} }
} }
if (_current_stripable->eq_shape_controllable (0)) { if (_current_stripable->mapped_control (EQ_Shape, 0)) {
_current_stripable->eq_shape_controllable (0)->Changed.connect ( _current_stripable->mapped_control (EQ_Shape, 0)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_low_shape, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_low_shape, this), this);
} }
if (_current_stripable->eq_shape_controllable (3)) { if (_current_stripable->mapped_control (EQ_Shape, 3)) {
_current_stripable->eq_shape_controllable (3)->Changed.connect ( _current_stripable->mapped_control (EQ_Shape, 3)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_high_shape, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_eq_high_shape, this), this);
} }
// Drive // Drive
if (_current_stripable->tape_drive_controllable ()) { if (_current_stripable->mapped_control (TapeDrive_Drive)) {
_current_stripable->tape_drive_controllable ()->Changed.connect ( _current_stripable->mapped_control (TapeDrive_Drive)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_drive, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_drive, this), this);
} }
@ -734,43 +735,43 @@ Console1::set_current_stripable (std::shared_ptr<Stripable> r)
} }
// Comp Section // Comp Section
if (_current_stripable->comp_enable_controllable ()) { if (_current_stripable->mapped_control (Comp_Enable)) {
_current_stripable->comp_enable_controllable ()->Changed.connect ( _current_stripable->mapped_control (Comp_Enable)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp, this), this);
} }
if (_current_stripable->comp_mode_controllable ()) { if (_current_stripable->mapped_control (Comp_Mode)) {
_current_stripable->comp_mode_controllable ()->Changed.connect ( _current_stripable->mapped_control (Comp_Mode)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_mode, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_mode, this), this);
} }
if (_current_stripable->comp_threshold_controllable ()) { if (_current_stripable->mapped_control (Comp_Threshold)) {
_current_stripable->comp_threshold_controllable ()->Changed.connect ( _current_stripable->mapped_control (Comp_Threshold)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_thresh, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_thresh, this), this);
} }
if (_current_stripable->comp_attack_controllable ()) { if (_current_stripable->mapped_control (Comp_Attack)) {
_current_stripable->comp_attack_controllable ()->Changed.connect ( _current_stripable->mapped_control (Comp_Attack)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_attack, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_attack, this), this);
} }
if (_current_stripable->comp_release_controllable ()) { if (_current_stripable->mapped_control (Comp_Release)) {
_current_stripable->comp_release_controllable ()->Changed.connect ( _current_stripable->mapped_control (Comp_Release)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_release, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_release, this), this);
} }
if (_current_stripable->comp_ratio_controllable ()) { if (_current_stripable->mapped_control (Comp_Ratio)) {
_current_stripable->comp_ratio_controllable ()->Changed.connect ( _current_stripable->mapped_control (Comp_Ratio)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_ratio, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_ratio, this), this);
} }
if (_current_stripable->comp_makeup_controllable ()) { if (_current_stripable->mapped_control (Comp_Makeup)) {
_current_stripable->comp_makeup_controllable ()->Changed.connect ( _current_stripable->mapped_control (Comp_Makeup)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_makeup, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_makeup, this), this);
} }
if (_current_stripable->comp_key_filter_freq_controllable ()) { if (_current_stripable->mapped_control (Comp_KeyFilterFreq)) {
_current_stripable->comp_key_filter_freq_controllable ()->Changed.connect ( _current_stripable->mapped_control (Comp_KeyFilterFreq)->Changed.connect (
stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_emph, this), this); stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::map_comp_emph, this), this);
} }

View file

@ -49,6 +49,7 @@
#include "ardour/session_configuration.h" #include "ardour/session_configuration.h"
#include "ardour/tempo.h" #include "ardour/tempo.h"
#include "ardour/vca.h" #include "ardour/vca.h"
#include "ardour/well_known_enum.h"
#include "faderport8.h" #include "faderport8.h"
@ -1336,45 +1337,44 @@ FaderPort8::build_well_known_processor_ctrls (std::shared_ptr<Stripable> s, int
int cnt = s->eq_band_cnt(); int cnt = s->eq_band_cnt();
#ifdef MIXBUS #ifdef MIXBUS
PUSH_BACK_NON_NULL ("Flt In", s->filter_enable_controllable (true)); // both HP/LP PUSH_BACK_NON_NULL ("Flt In", s->mapped_control (HPF_Enable)); // both HP/LP
PUSH_BACK_NON_NULL ("HP Freq", s->filter_freq_controllable (true)); PUSH_BACK_NON_NULL ("HP Freq", s->mapped_control (HPF_Freq));
PUSH_BACK_NON_NULL ("LP Freq", s->filter_freq_controllable (false)); PUSH_BACK_NON_NULL ("LP Freq", s->mapped_control (LPF_Freq));
PUSH_BACK_NON_NULL ("EQ In", s->eq_enable_controllable ()); PUSH_BACK_NON_NULL ("EQ In", s->mapped_control (EQ_Enable));
#endif #endif
for (int band = 0; band < cnt; ++band) { for (int band = 0; band < cnt; ++band) {
std::string bn = s->eq_band_name (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 ("Gain %1", bn), s->mapped_control (EQ_Gain, band));
PUSH_BACK_NON_NULL (string_compose ("Freq %1", bn), s->eq_freq_controllable (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->eq_q_controllable (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->eq_shape_controllable (band)); PUSH_BACK_NON_NULL (string_compose ("Shape %1", bn), s->mapped_control (EQ_Shape, band));
} }
} }
break; break;
case 2: case 2:
PUSH_BACK_NON_NULL ("Comp In", s->comp_enable_controllable ()); PUSH_BACK_NON_NULL ("Comp In", s->mapped_control (Comp_Enable));
PUSH_BACK_NON_NULL ("Threshold", s->comp_threshold_controllable ()); PUSH_BACK_NON_NULL ("Threshold", s->mapped_control (Comp_Threshold));
PUSH_BACK_NON_NULL ("Makeup", s->comp_makeup_controllable ()); PUSH_BACK_NON_NULL ("Makeup", s->mapped_control (Comp_Makeup));
PUSH_BACK_NON_NULL ("Mode", s->comp_mode_controllable ()); PUSH_BACK_NON_NULL ("Mode", s->mapped_control (Comp_Mode));
PUSH_BACK_NON_NULL ("Speed", s->comp_speed_controllable ()); PUSH_BACK_NON_NULL ("Ratio", s->mapped_control (Comp_Ratio));
PUSH_BACK_NON_NULL ("Ratio", s->comp_ratio_controllable ()); PUSH_BACK_NON_NULL ("Attack", s->mapped_control (Comp_Attack));
PUSH_BACK_NON_NULL ("Attack", s->comp_attack_controllable ()); PUSH_BACK_NON_NULL ("Release", s->mapped_control (Comp_Release));
PUSH_BACK_NON_NULL ("Release", s->comp_release_controllable ()); PUSH_BACK_NON_NULL ("Emphasis", s->mapped_control (Comp_KeyFilterFreq));
PUSH_BACK_NON_NULL ("Emphasis", s->comp_key_filter_freq_controllable ());
break; break;
case 3: case 3:
PUSH_BACK_NON_NULL ("Gate In", s->gate_enable_controllable ()); PUSH_BACK_NON_NULL ("Gate In", s->mapped_control (Gate_Enable));
PUSH_BACK_NON_NULL ("Exp", s->gate_mode_controllable ()); PUSH_BACK_NON_NULL ("Exp", s->mapped_control (Gate_Mode));
PUSH_BACK_NON_NULL ("Threshold", s->gate_threshold_controllable ()); PUSH_BACK_NON_NULL ("Threshold", s->mapped_control (Gate_Threshold));
PUSH_BACK_NON_NULL ("Depth", s->gate_depth_controllable ()); PUSH_BACK_NON_NULL ("Depth", s->mapped_control (Gate_Depth));
PUSH_BACK_NON_NULL ("Attack", s->gate_attack_controllable ()); PUSH_BACK_NON_NULL ("Attack", s->mapped_control (Gate_Attack));
PUSH_BACK_NON_NULL ("Release", s->gate_release_controllable ()); PUSH_BACK_NON_NULL ("Release", s->mapped_control (Gate_Release));
PUSH_BACK_NON_NULL ("Exp Ratio", s->gate_ratio_controllable ()); PUSH_BACK_NON_NULL ("Exp Ratio", s->mapped_control (Gate_Ratio));
PUSH_BACK_NON_NULL ("Exp Knee", s->gate_knee_controllable ()); PUSH_BACK_NON_NULL ("Exp Knee", s->mapped_control (Gate_Knee));
PUSH_BACK_NON_NULL ("Gate Hyst", s->gate_hysteresis_controllable ()); PUSH_BACK_NON_NULL ("Gate Hyst", s->mapped_control (Gate_Hysteresis));
PUSH_BACK_NON_NULL ("Gate Hold", s->gate_hold_controllable ()); PUSH_BACK_NON_NULL ("Gate Hold", s->mapped_control (Gate_Hold));
PUSH_BACK_NON_NULL ("SC Enable", s->gate_key_filter_enable_controllable ()); PUSH_BACK_NON_NULL ("SC Enable", s->mapped_control (Gate_KeyFilterEnable));
PUSH_BACK_NON_NULL ("SC Freq", s->gate_key_filter_freq_controllable ()); PUSH_BACK_NON_NULL ("SC Freq", s->mapped_control (Gate_KeyFilterFreq));
break; break;
default: default:
assert (0); assert (0);
@ -1606,11 +1606,11 @@ FaderPort8::spill_plugins ()
--spillwidth; --spillwidth;
have_well_known_eq = true; have_well_known_eq = true;
} }
if (r->comp_enable_controllable ()) { if (r->mapped_control (Comp_Enable)) {
--spillwidth; --spillwidth;
have_well_known_comp = true; have_well_known_comp = true;
} }
if (r->gate_enable_controllable ()) { if (r->mapped_control (Gate_Enable)) {
--spillwidth; --spillwidth;
have_well_known_gate = true; have_well_known_gate = true;
} }

View file

@ -24,6 +24,7 @@
#include "ardour/stripable.h" #include "ardour/stripable.h"
#include "ardour/track.h" #include "ardour/track.h"
#include "ardour/value_as_string.h" #include "ardour/value_as_string.h"
#include "ardour/well_known_enum.h"
#include "control_protocol/control_protocol.h" #include "control_protocol/control_protocol.h"
@ -324,7 +325,7 @@ FP8Strip::set_stripable (std::shared_ptr<Stripable> s, bool panmode)
recarm_button ().set_active (false); recarm_button ().set_active (false);
} }
_peak_meter = s->peak_meter (); _peak_meter = s->peak_meter ();
_redux_ctrl = s->comp_redux_controllable (); _redux_ctrl = s->mapped_output (Comp_Redux);
set_select_controllable (std::shared_ptr<AutomationControl>()); set_select_controllable (std::shared_ptr<AutomationControl>());
select_button ().set_active (s->is_selected ()); select_button ().set_active (s->is_selected ());

View file

@ -59,6 +59,7 @@
#include "ardour/rc_configuration.h" #include "ardour/rc_configuration.h"
#include "ardour/midiport_manager.h" #include "ardour/midiport_manager.h"
#include "ardour/debug.h" #include "ardour/debug.h"
#include "ardour/well_known_enum.h"
#include "generic_midi_control_protocol.h" #include "generic_midi_control_protocol.h"
#include "midicontrollable.h" #include "midicontrollable.h"
@ -1238,7 +1239,7 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const
if (path.size() == 3) { if (path.size() == 3) {
if (path[2] == X_("enable")) { if (path[2] == X_("enable")) {
c = s->eq_enable_controllable (); c = s->mapped_control (EQ_Enable);
} }
} else if (path.size() == 4) { } else if (path.size() == 4) {
@ -1246,13 +1247,13 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const
int band = atoi (path[3]); /* band number */ int band = atoi (path[3]); /* band number */
if (path[2] == X_("gain")) { if (path[2] == X_("gain")) {
c = s->eq_gain_controllable (band); c = s->mapped_control (EQ_Gain, band);
} else if (path[2] == X_("freq")) { } 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")) { } 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")) { } 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")) { 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")) { } 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")) { } 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")) if (path[2] == X_("enable"))
{ {
c = s->comp_enable_controllable(); c = s->mapped_control (Comp_Enable);
} }
else if (path[2] == X_("threshold")) else if (path[2] == X_("threshold"))
{ {
c = s->comp_threshold_controllable(); c = s->mapped_control (Comp_Threshold);
} }
else if (path[2] == X_("mode")) else if (path[2] == X_("mode"))
{ {
c = s->comp_mode_controllable(); c = s->mapped_control (Comp_Mode);
}
else if (path[2] == X_("speed"))
{
c = s->comp_speed_controllable();
} }
else if (path[2] == X_("attack")) else if (path[2] == X_("attack"))
{ {
c = s->comp_attack_controllable(); c = s->mapped_control (Comp_Attack);
} }
else if (path[2] == X_("release")) else if (path[2] == X_("release"))
{ {
c = s->comp_release_controllable(); c = s->mapped_control (Comp_Release);
} }
else if (path[2] == X_("makeup")) else if (path[2] == X_("makeup"))
{ {
c = s->comp_makeup_controllable(); c = s->mapped_control (Comp_Makeup);
} }
else if (path[2] == X_("ratio")) 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")) 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")) if (path[2] == X_("enable"))
{ {
c = s->gate_enable_controllable(); c = s->mapped_control (Gate_Enable);
} }
else if (path[2] == X_("threshold")) else if (path[2] == X_("threshold"))
{ {
c = s->gate_threshold_controllable(); c = s->mapped_control (Gate_Threshold);
} }
else if (path[2] == X_("mode")) else if (path[2] == X_("mode"))
{ {
c = s->gate_mode_controllable(); c = s->mapped_control (Gate_Mode);
} }
else if (path[2] == X_("ratio")) else if (path[2] == X_("ratio"))
{ {
c = s->gate_ratio_controllable(); c = s->mapped_control (Gate_Ratio);
} }
else if (path[2] == X_("knee")) else if (path[2] == X_("knee"))
{ {
c = s->gate_knee_controllable(); c = s->mapped_control (Gate_Knee);
} }
else if (path[2] == X_("depth")) else if (path[2] == X_("depth"))
{ {
c = s->gate_depth_controllable(); c = s->mapped_control (Gate_Depth);
} }
else if (path[2] == X_("hysteresis")) else if (path[2] == X_("hysteresis"))
{ {
c = s->gate_hysteresis_controllable(); c = s->mapped_control (Gate_Hysteresis);
} }
else if (path[2] == X_("hold")) else if (path[2] == X_("hold"))
{ {
c = s->gate_hold_controllable(); c = s->mapped_control (Gate_Hold);
} }
else if (path[2] == X_("attack")) else if (path[2] == X_("attack"))
{ {
c = s->gate_attack_controllable(); c = s->mapped_control (Gate_Attack);
} }
else if (path[2] == X_("release")) else if (path[2] == X_("release"))
{ {
c = s->gate_release_controllable(); c = s->mapped_control (Gate_Release);
} }
else if (path[2] == X_("key_listen")) 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")) 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")) 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")) if (path[2] == X_("drive"))
{ {
c = s->tape_drive_controllable(); c = s->mapped_control (TapeDrive_Drive);
} }
else if (path[2] == X_("mode")) else if (path[2] == X_("mode"))
{ {
c = s->tape_drive_mode_controllable(); c = s->mapped_control (TapeDrive_Mode);
} }
} }
} }

View file

@ -26,6 +26,7 @@
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/solo_control.h" #include "ardour/solo_control.h"
#include "ardour/solo_isolate_control.h" #include "ardour/solo_isolate_control.h"
#include "ardour/well_known_enum.h"
#include "launch_control_xl.h" #include "launch_control_xl.h"
@ -95,9 +96,6 @@ LaunchControlXL::build_maps ()
MAKE_DM_KNOB (SendB6, 34, 13, GreenFull, GreenLow, boost::function<void ()> MAKE_DM_KNOB (SendB6, 34, 13, GreenFull, GreenLow, boost::function<void ()>
(boost::bind (&LaunchControlXL::dm_mb_comp, this, SendB6, CompMakeup)), (boost::bind (&LaunchControlXL::dm_mb_comp, this, SendB6, CompMakeup)),
boost::bind(&LaunchControlXL::dm_mb_comp_enabled,this)); boost::bind(&LaunchControlXL::dm_mb_comp_enabled,this));
MAKE_DM_KNOB (SendB7, 35, 14, GreenFull, GreenLow, boost::function<void ()>
(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<void ()> MAKE_DM_KNOB (SendB8, 36, 15, GreenFull, GreenLow, boost::function<void ()>
(boost::bind (&LaunchControlXL::dm_mb_comp, this, SendB8, CompMode)), (boost::bind (&LaunchControlXL::dm_mb_comp, this, SendB8, CompMode)),
boost::bind(&LaunchControlXL::dm_mb_comp_enabled, this)); 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 if (buttons_down.find(Device) != buttons_down.end()) { // Device button hold
#ifdef MIXBUS #ifdef MIXBUS
ac = stripable[n]->filter_freq_controllable (true); ac = stripable[n]->mapped_control (HPF_Freq);
#else #else
/* something */ /* something */
#endif #endif
@ -823,7 +821,7 @@ LaunchControlXL::knob_pan(uint8_t n)
if (buttons_down.find(Device) != buttons_down.end()) { // Device button hold if (buttons_down.find(Device) != buttons_down.end()) { // Device button hold
#ifdef MIXBUS #ifdef MIXBUS
ac = stripable[n]->comp_threshold_controllable(); ac = stripable[n]->mapped_control (Comp_Threshold);
#else #else
ac = stripable[n]->pan_width_control(); ac = stripable[n]->pan_width_control();
#endif #endif
@ -1278,8 +1276,8 @@ LaunchControlXL::dm_mb_eq_freq_enabled()
uint8_t dev_status = dev_nonexistant; uint8_t dev_status = dev_nonexistant;
if (first_selected_stripable()->eq_enable_controllable()) { if (first_selected_stripable()->mapped_control(EQ_Enable)) {
if (first_selected_stripable()->eq_enable_controllable()->get_value()) { if (first_selected_stripable()->mapped_control(EQ_Enable)->get_value()) {
dev_status = dev_active; dev_status = dev_active;
} else { } else {
dev_status = dev_inactive; dev_status = dev_inactive;
@ -1303,8 +1301,8 @@ LaunchControlXL::dm_mb_eq_gain_enabled(uint8_t band)
uint8_t dev_status = dev_nonexistant; uint8_t dev_status = dev_nonexistant;
if (first_selected_stripable()->eq_enable_controllable()) { if (first_selected_stripable()->mapped_control(EQ_Enable)) {
if (first_selected_stripable()->eq_enable_controllable()->get_value()) { if (first_selected_stripable()->mapped_control(EQ_Enable)->get_value()) {
dev_status = dev_active; dev_status = dev_active;
} else { } else {
dev_status = dev_inactive; dev_status = dev_inactive;
@ -1328,9 +1326,9 @@ LaunchControlXL::dm_mb_eq (KnobID k, bool gain, uint8_t band)
std::shared_ptr<AutomationControl> ac; std::shared_ptr<AutomationControl> ac;
std::shared_ptr<Knob> knob = knob_by_id (k); std::shared_ptr<Knob> knob = knob_by_id (k);
if (gain) { if (gain) {
ac = first_selected_stripable()->eq_gain_controllable(band); ac = first_selected_stripable()->mapped_control(EQ_Gain, band);
} else { } 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)) { if (ac && check_pick_up(knob, ac)) {
@ -1345,9 +1343,9 @@ LaunchControlXL::dm_mb_eq_shape_switch (uint8_t band)
return; return;
} }
if (first_selected_stripable()->eq_shape_controllable(band)) { if (first_selected_stripable()->mapped_control (EQ_Shape, band)) {
first_selected_stripable()->eq_shape_controllable(band)->set_value first_selected_stripable()->mapped_control (EQ_Shape, band)->set_value
(!first_selected_stripable()->eq_shape_controllable(band)->get_value(), PBD::Controllable::NoGroup ); (!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; uint8_t dev_status = dev_nonexistant;
if (first_selected_stripable()->eq_shape_controllable(band)) { if (first_selected_stripable()->mapped_control (EQ_Shape, band)) {
if (first_selected_stripable()->eq_shape_controllable(band)->get_value()) { if (first_selected_stripable()->mapped_control (EQ_Shape, band)->get_value()) {
dev_status = dev_active; dev_status = dev_active;
} else { } else {
dev_status = dev_inactive; dev_status = dev_inactive;
@ -1380,9 +1378,9 @@ LaunchControlXL::dm_mb_eq_switch()
return; return;
} }
if (first_selected_stripable()->eq_enable_controllable()) { if (first_selected_stripable()->mapped_control(EQ_Enable)) {
first_selected_stripable()->eq_enable_controllable()->set_value first_selected_stripable()->mapped_control(EQ_Enable)->set_value
(!first_selected_stripable()->eq_enable_controllable()->get_value(), PBD::Controllable::NoGroup ); (!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"); DEBUG_TRACE (DEBUG::LaunchControlXL, "dm_mb_flt_enabled()\n");
uint8_t dev_status = dev_nonexistant; 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"); 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"); DEBUG_TRACE (DEBUG::LaunchControlXL, "dm_mb_flt_enabled: get_value true\n");
dev_status = dev_active; dev_status = dev_active;
} else { } else {
@ -1417,9 +1415,9 @@ LaunchControlXL::dm_mb_flt_switch()
return; return;
} }
if (first_selected_stripable()->filter_enable_controllable(true)) { if (first_selected_stripable()->mapped_control (HPF_Enable)) {
first_selected_stripable()->filter_enable_controllable(true)->set_value first_selected_stripable()->mapped_control (HPF_Enable)->set_value
(!first_selected_stripable()->filter_enable_controllable(true)->get_value(), PBD::Controllable::NoGroup ); (!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<AutomationControl> ac; std::shared_ptr<AutomationControl> ac;
std::shared_ptr<Knob> knob = knob_by_id (k); std::shared_ptr<Knob> knob = knob_by_id (k);
if (hpf) { if (hpf) {
ac = first_selected_stripable()->filter_freq_controllable(true); ac = first_selected_stripable()->mapped_control (HPF_Freq);
} else { } else {
ac = first_selected_stripable()->filter_freq_controllable(false); ac = first_selected_stripable()->mapped_control (LPF_Freq);
} }
if (ac && check_pick_up(knob, ac)) { if (ac && check_pick_up(knob, ac)) {
@ -1524,8 +1522,8 @@ LaunchControlXL::dm_mb_comp_enabled()
} }
uint8_t dev_status = dev_nonexistant; uint8_t dev_status = dev_nonexistant;
if (first_selected_stripable()->comp_enable_controllable()) { if (first_selected_stripable()->mapped_control (Comp_Enable)) {
if (first_selected_stripable()->comp_enable_controllable()->get_value()) { if (first_selected_stripable()->mapped_control (Comp_Enable)->get_value()) {
dev_status = dev_active; dev_status = dev_active;
} else { } else {
dev_status = dev_inactive; dev_status = dev_inactive;
@ -1543,11 +1541,11 @@ LaunchControlXL::dm_mb_comp_switch()
return; 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, "comp_enable_controllable exists\n");
DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose("comp_enable_controllable(): '%1'\n", first_selected_stripable()->comp_enable_controllable()->get_value() )); DEBUG_TRACE (DEBUG::LaunchControlXL, string_compose("mapped_control (Comp_Enable): '%1'\n", first_selected_stripable()->mapped_control (Comp_Enable)->get_value() ));
first_selected_stripable()->comp_enable_controllable()->set_value first_selected_stripable()->mapped_control (Comp_Enable)->set_value
(!first_selected_stripable()->comp_enable_controllable()->get_value(), PBD::Controllable::NoGroup); (!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) { switch (c) {
case (CompMakeup): case (CompMakeup):
ac = first_selected_stripable()->comp_makeup_controllable(); ac = first_selected_stripable()->mapped_control (Comp_Makeup);
break; break;
case (CompMode): case (CompMode):
ac = first_selected_stripable()->comp_mode_controllable(); ac = first_selected_stripable()->mapped_control (Comp_Mode);
break;
case (CompSpeed):
ac = first_selected_stripable()->comp_speed_controllable();
break; break;
} }
@ -1595,7 +1590,7 @@ LaunchControlXL::dm_mb_comp_thresh (FaderID id) {
fader = f->second; 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)) { if (ac && check_pick_up(fader, ac)) {
ac->set_value ( ac->interface_to_internal( fader->value() / 127.0), PBD::Controllable::UseGroup ); 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<AutomationControl> ac; std::shared_ptr<AutomationControl> ac;
std::shared_ptr<Knob> knob = knob_by_id (k); std::shared_ptr<Knob> 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)) { if (ac && check_pick_up(knob, ac)) {
ac->set_value ( ac->interface_to_internal( knob->value() / 127.0), PBD::Controllable::UseGroup ); ac->set_value ( ac->interface_to_internal( knob->value() / 127.0), PBD::Controllable::UseGroup );

View file

@ -47,8 +47,7 @@
#include "ardour/types_convert.h" #include "ardour/types_convert.h"
#include "ardour/vca.h" #include "ardour/vca.h"
#include "ardour/vca_manager.h" #include "ardour/vca_manager.h"
#include "ardour/well_known_enum.h"
#include "gtkmm2ext/gui_thread.h" #include "gtkmm2ext/gui_thread.h"
@ -1177,25 +1176,25 @@ LaunchControlXL::init_dm_callbacks()
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl); MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl);
} }
#ifdef MIXBUS #ifdef MIXBUS
if (first_selected_stripable()->eq_enable_controllable()) { if (first_selected_stripable()->mapped_control(EQ_Enable)) {
first_selected_stripable()->eq_enable_controllable()->Changed.connect (stripable_connections, first_selected_stripable()->mapped_control(EQ_Enable)->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons,this), lcxl); MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons,this), lcxl);
} }
if (first_selected_stripable()->eq_shape_controllable(0)) { if (first_selected_stripable()->mapped_control (EQ_Shape, 0)) {
first_selected_stripable()->eq_shape_controllable(0)->Changed.connect (stripable_connections, first_selected_stripable()->mapped_control (EQ_Shape, 0)->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl); MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl);
} }
if (first_selected_stripable()->eq_shape_controllable(3)) { if (first_selected_stripable()->mapped_control (EQ_Shape, 3)) {
first_selected_stripable()->eq_shape_controllable(3)->Changed.connect (stripable_connections, first_selected_stripable()->mapped_control (EQ_Shape, 3)->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl); MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_buttons,this), lcxl);
} }
if (first_selected_stripable()->comp_enable_controllable()) { if (first_selected_stripable()->mapped_control (Comp_Enable)) {
first_selected_stripable()->comp_enable_controllable()->Changed.connect (stripable_connections, first_selected_stripable()->mapped_control (Comp_Enable)->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons,this), lcxl); 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 if (first_selected_stripable()->mapped_control (HPF_Enable)) { // only handle one case, as Mixbus only has one
first_selected_stripable()->filter_enable_controllable(true)->Changed.connect (stripable_connections, first_selected_stripable()->mapped_control (HPF_Enable)->Changed.connect (stripable_connections,
MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons, this), lcxl); MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::init_knobs_and_buttons, this), lcxl);
} }
if (first_selected_stripable()->master_send_enable_controllable()) { if (first_selected_stripable()->master_send_enable_controllable()) {

View file

@ -153,7 +153,6 @@ public:
enum CompParam { enum CompParam {
CompMakeup, CompMakeup,
CompMode, CompMode,
CompSpeed
}; };
#endif #endif

View file

@ -35,6 +35,7 @@
#include "ardour/solo_isolate_control.h" #include "ardour/solo_isolate_control.h"
#include "ardour/stripable.h" #include "ardour/stripable.h"
#include "ardour/track.h" #include "ardour/track.h"
#include "ardour/well_known_enum.h"
#include "mackie_control_protocol.h" #include "mackie_control_protocol.h"
#include "pot.h" #include "pot.h"
@ -329,7 +330,7 @@ void EQSubview::setup_vpot(
case 4: case 4:
case 6: case 6:
eq_band = global_strip_position / 2; 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); band_name = _subview_stripable->eq_band_name (eq_band);
pot_id = band_name + "Freq"; pot_id = band_name + "Freq";
break; break;
@ -338,22 +339,22 @@ void EQSubview::setup_vpot(
case 5: case 5:
case 7: case 7:
eq_band = global_strip_position / 2; 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); band_name = _subview_stripable->eq_band_name (eq_band);
pot_id = band_name + "Gain"; pot_id = band_name + "Gain";
break; break;
case 8: 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"; band_name = "lo";
pot_id = band_name + " Shp"; pot_id = band_name + " Shp";
break; break;
case 9: 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"; band_name = "hi";
pot_id = band_name + " Shp"; pot_id = band_name + " Shp";
break; break;
case 10: case 10:
pc = _subview_stripable->eq_enable_controllable(); pc = _subview_stripable->mapped_control(EQ_Enable);
pot_id = "EQ"; pot_id = "EQ";
break; break;
} }
@ -364,7 +365,7 @@ void EQSubview::setup_vpot(
case 1: case 1:
case 2: case 2:
eq_band = global_strip_position; 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); band_name = _subview_stripable->eq_band_name (eq_band);
pot_id = band_name + "Gain"; pot_id = band_name + "Gain";
break; break;
@ -426,7 +427,7 @@ DynamicsSubview::~DynamicsSubview()
bool DynamicsSubview::subview_mode_would_be_ok (std::shared_ptr<ARDOUR::Stripable> r, std::string& reason_why_not) bool DynamicsSubview::subview_mode_would_be_ok (std::shared_ptr<ARDOUR::Stripable> r, std::string& reason_why_not)
{ {
if (r && r->comp_enable_controllable()) { if (r && r->mapped_control (Comp_Enable)) {
return true; return true;
} }
@ -456,15 +457,22 @@ void DynamicsSubview::setup_vpot(
return; return;
} }
std::shared_ptr<AutomationControl> tc = _subview_stripable->comp_threshold_controllable (); std::shared_ptr<AutomationControl> hpfc = _subview_stripable->mapped_control (HPF_Freq);
std::shared_ptr<AutomationControl> sc = _subview_stripable->comp_speed_controllable (); std::shared_ptr<AutomationControl> lpfc = _subview_stripable->mapped_control (LPF_Freq);
std::shared_ptr<AutomationControl> mc = _subview_stripable->comp_mode_controllable (); std::shared_ptr<AutomationControl> fec = _subview_stripable->mapped_control (HPF_Enable); // shared HP/LP
std::shared_ptr<AutomationControl> kc = _subview_stripable->comp_makeup_controllable ();
std::shared_ptr<AutomationControl> ec = _subview_stripable->comp_enable_controllable ();
std::shared_ptr<AutomationControl> hpfc = _subview_stripable->filter_freq_controllable (true); std::shared_ptr<AutomationControl> ctc = _subview_stripable->mapped_control (Comp_Threshold);
std::shared_ptr<AutomationControl> lpfc = _subview_stripable->filter_freq_controllable (false); std::shared_ptr<AutomationControl> crc = _subview_stripable->mapped_control (Comp_Ratio);
std::shared_ptr<AutomationControl> fec = _subview_stripable->filter_enable_controllable (true); // shared HP/LP std::shared_ptr<AutomationControl> cac = _subview_stripable->mapped_control (Comp_Attack);
std::shared_ptr<AutomationControl> csc = _subview_stripable->mapped_control (Comp_Release);
std::shared_ptr<AutomationControl> ckc = _subview_stripable->mapped_control (Comp_Makeup);
std::shared_ptr<AutomationControl> cec = _subview_stripable->mapped_control (Comp_Enable);
std::shared_ptr<AutomationControl> gtc = _subview_stripable->mapped_control (Gate_Threshold);
std::shared_ptr<AutomationControl> gdc = _subview_stripable->mapped_control (Gate_Depth);
std::shared_ptr<AutomationControl> gac = _subview_stripable->mapped_control (Gate_Attack);
std::shared_ptr<AutomationControl> gsc = _subview_stripable->mapped_control (Gate_Release);
std::shared_ptr<AutomationControl> gec = _subview_stripable->mapped_control (Gate_Enable);
/* we will control the global_strip_position-th available parameter, from the list in the /* we will control the global_strip_position-th available parameter, from the list in the
* order shown above. * order shown above.
@ -473,16 +481,24 @@ void DynamicsSubview::setup_vpot(
std::vector<std::pair<std::shared_ptr<AutomationControl>, std::string > > available; std::vector<std::pair<std::shared_ptr<AutomationControl>, std::string > > available;
std::vector<AutomationType> params; std::vector<AutomationType> params;
if (tc) { available.push_back (std::make_pair (tc, "Thresh")); } //Mixbus32C needs to spill the filter controls into the comp section
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")); }
if (hpfc) { available.push_back (std::make_pair (hpfc, "HPF")); } if (hpfc) { available.push_back (std::make_pair (hpfc, "HPF")); }
if (lpfc) { available.push_back (std::make_pair (lpfc, "LPF")); } if (lpfc) { available.push_back (std::make_pair (lpfc, "LPF")); }
if (fec) { available.push_back (std::make_pair (fec, "FiltIn")); } 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()) { if (global_strip_position >= available.size()) {
/* this knob is not needed to control the available parameters */ /* this knob is not needed to control the available parameters */
vpot->set_control (std::shared_ptr<AutomationControl>()); vpot->set_control (std::shared_ptr<AutomationControl>());
@ -534,7 +550,7 @@ DynamicsSubview::notify_change (std::weak_ptr<ARDOUR::AutomationControl> pc, uin
if (control) { if (control) {
float val = control->get_value(); 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 (); pending_display[1] = control->get_user_string ();
} else { } else {
do_parameter_display(pending_display[1], control->desc(), val, strip, true); do_parameter_display(pending_display[1], control->desc(), val, strip, true);

View file

@ -68,6 +68,7 @@
#include "ardour/solo_isolate_control.h" #include "ardour/solo_isolate_control.h"
#include "ardour/solo_safe_control.h" #include "ardour/solo_safe_control.h"
#include "ardour/vca_manager.h" #include "ardour/vca_manager.h"
#include "ardour/well_known_enum.h"
#include "ardour/zeroconf.h" #include "ardour/zeroconf.h"
#include "osc_select_observer.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/pan_lfe_control"), "f", sel_pan_lfe);
REGISTER_CALLBACK (serv, X_("/select/comp_enable"), "f", sel_comp_enable); 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_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_mode"), "f", sel_comp_mode);
REGISTER_CALLBACK (serv, X_("/select/comp_makeup"), "f", sel_comp_makeup); REGISTER_CALLBACK (serv, X_("/select/comp_makeup"), "f", sel_comp_makeup);
REGISTER_CALLBACK (serv, X_("/select/eq_enable"), "f", sel_eq_enable); 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<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->comp_enable_controllable()) { if (s->mapped_control (Comp_Enable)) {
s->comp_enable_controllable()->set_value (s->comp_enable_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (Comp_Enable)->set_value (s->mapped_control (Comp_Enable)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5767,29 +5767,14 @@ OSC::sel_comp_threshold (float val, lo_message msg)
std::shared_ptr<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->comp_threshold_controllable()) { if (s->mapped_control (Comp_Threshold)) {
s->comp_threshold_controllable()->set_value (s->comp_threshold_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (Comp_Threshold)->set_value (s->mapped_control (Comp_Threshold)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
return float_message(X_("/select/comp_threshold"), 0, get_address (msg)); 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<Stripable> 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 int
OSC::sel_comp_mode (float val, lo_message msg) 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<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->comp_mode_controllable()) { if (s->mapped_control (Comp_Mode)) {
s->comp_mode_controllable()->set_value (s->comp_mode_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (Comp_Mode)->set_value (s->mapped_control (Comp_Mode)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5812,8 +5797,8 @@ OSC::sel_comp_makeup (float val, lo_message msg)
std::shared_ptr<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->comp_makeup_controllable()) { if (s->mapped_control (Comp_Makeup)) {
s->comp_makeup_controllable()->set_value (s->comp_makeup_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (Comp_Makeup)->set_value (s->mapped_control (Comp_Makeup)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5829,8 +5814,8 @@ OSC::sel_eq_enable (float val, lo_message msg)
std::shared_ptr<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->eq_enable_controllable()) { if (s->mapped_control(EQ_Enable)) {
s->eq_enable_controllable()->set_value (s->eq_enable_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control(EQ_Enable)->set_value (s->mapped_control(EQ_Enable)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5844,8 +5829,8 @@ OSC::sel_eq_hpf_freq (float val, lo_message msg)
std::shared_ptr<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->filter_freq_controllable(true)) { if (s->mapped_control (HPF_Freq)) {
s->filter_freq_controllable(true)->set_value (s->filter_freq_controllable(true)->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (HPF_Freq)->set_value (s->mapped_control (HPF_Freq)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5859,8 +5844,8 @@ OSC::sel_eq_lpf_freq (float val, lo_message msg)
std::shared_ptr<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->filter_freq_controllable(false)) { if (s->mapped_control (LPF_Freq)) {
s->filter_freq_controllable(false)->set_value (s->filter_freq_controllable(false)->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (LPF_Freq)->set_value (s->mapped_control (LPF_Freq)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5874,8 +5859,8 @@ OSC::sel_eq_hpf_enable (float val, lo_message msg)
std::shared_ptr<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->filter_enable_controllable(true)) { if (s->mapped_control (HPF_Enable)) {
s->filter_enable_controllable(true)->set_value (s->filter_enable_controllable(true)->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (HPF_Enable)->set_value (s->mapped_control (HPF_Enable)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5889,8 +5874,8 @@ OSC::sel_eq_lpf_enable (float val, lo_message msg)
std::shared_ptr<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->filter_enable_controllable(false)) { if (s->mapped_control (LPF_Enable)) {
s->filter_enable_controllable(false)->set_value (s->filter_enable_controllable(false)->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (LPF_Enable)->set_value (s->mapped_control (LPF_Enable)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5904,8 +5889,8 @@ OSC::sel_eq_hpf_slope (float val, lo_message msg)
std::shared_ptr<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->filter_slope_controllable(true)) { if (s->mapped_control (HPF_Slope)) {
s->filter_slope_controllable(true)->set_value (s->filter_slope_controllable(true)->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (HPF_Slope)->set_value (s->mapped_control (HPF_Slope)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5919,8 +5904,8 @@ OSC::sel_eq_lpf_slope (float val, lo_message msg)
std::shared_ptr<Stripable> s; std::shared_ptr<Stripable> s;
s = sur->select; s = sur->select;
if (s) { if (s) {
if (s->filter_slope_controllable(false)) { if (s->mapped_control (LPF_Slope)) {
s->filter_slope_controllable(false)->set_value (s->filter_slope_controllable(false)->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (LPF_Slope)->set_value (s->mapped_control (LPF_Slope)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5937,8 +5922,8 @@ OSC::sel_eq_gain (int id, float val, lo_message msg)
if (id > 0) { if (id > 0) {
--id; --id;
} }
if (s->eq_gain_controllable (id)) { if (s->mapped_control (EQ_Gain, id)) {
s->eq_gain_controllable (id)->set_value (s->eq_gain_controllable(id)->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (EQ_Gain, id)->set_value (s->mapped_control(EQ_Gain, id)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5955,8 +5940,8 @@ OSC::sel_eq_freq (int id, float val, lo_message msg)
if (id > 0) { if (id > 0) {
--id; --id;
} }
if (s->eq_freq_controllable (id)) { if (s->mapped_control (EQ_Freq, id)) {
s->eq_freq_controllable (id)->set_value (s->eq_freq_controllable(id)->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (EQ_Freq, id)->set_value (s->mapped_control (EQ_Freq, id)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5973,8 +5958,8 @@ OSC::sel_eq_q (int id, float val, lo_message msg)
if (id > 0) { if (id > 0) {
--id; --id;
} }
if (s->eq_q_controllable (id)) { if (s->mapped_control (EQ_Q, id)) {
s->eq_q_controllable (id)->set_value (s->eq_q_controllable(id)->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (EQ_Q, id)->set_value (s->mapped_control (EQ_Q, id)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }
@ -5991,8 +5976,8 @@ OSC::sel_eq_shape (int id, float val, lo_message msg)
if (id > 0) { if (id > 0) {
--id; --id;
} }
if (s->eq_shape_controllable (id)) { if (s->mapped_control (EQ_Shape, id)) {
s->eq_shape_controllable (id)->set_value (s->eq_shape_controllable(id)->interface_to_internal (val), PBD::Controllable::NoGroup); s->mapped_control (EQ_Shape, id)->set_value (s->mapped_control (EQ_Shape, id)->interface_to_internal (val), PBD::Controllable::NoGroup);
return 0; return 0;
} }
} }

View file

@ -553,7 +553,6 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
PATH_CALLBACK1_MSG(sel_plugin_activate,f); PATH_CALLBACK1_MSG(sel_plugin_activate,f);
PATH_CALLBACK1_MSG(sel_comp_enable,f); PATH_CALLBACK1_MSG(sel_comp_enable,f);
PATH_CALLBACK1_MSG(sel_comp_threshold,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_mode,f);
PATH_CALLBACK1_MSG(sel_comp_makeup,f); PATH_CALLBACK1_MSG(sel_comp_makeup,f);
PATH_CALLBACK1_MSG(sel_eq_enable,f); PATH_CALLBACK1_MSG(sel_eq_enable,f);
@ -731,7 +730,6 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
int sel_pan_lfe (float val, lo_message msg); int sel_pan_lfe (float val, lo_message msg);
int sel_comp_enable (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_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_mode (float val, lo_message msg);
int sel_comp_makeup (float val, lo_message msg); int sel_comp_makeup (float val, lo_message msg);
int sel_eq_enable (float val, lo_message msg); int sel_eq_enable (float val, lo_message msg);

View file

@ -41,6 +41,7 @@
#include "ardour/processor.h" #include "ardour/processor.h"
#include "ardour/readonly_control.h" #include "ardour/readonly_control.h"
#include "ardour/vca.h" #include "ardour/vca.h"
#include "ardour/well_known_enum.h"
#include "osc.h" #include "osc.h"
#include "osc_select_observer.h" #include "osc_select_observer.h"
@ -235,25 +236,21 @@ OSCSelectObserver::refresh_strip (std::shared_ptr<ARDOUR::Stripable> new_strip,
} }
// Compressor // Compressor
if (_strip->comp_enable_controllable ()) { if (_strip->mapped_control (Comp_Enable)) {
_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()); _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->comp_enable_controllable()); enable_message (X_("/select/comp_enable"), _strip->mapped_control (Comp_Enable));
} }
if (_strip->comp_threshold_controllable ()) { if (_strip->mapped_control (Comp_Threshold)) {
_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()); _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->comp_threshold_controllable()); change_message (X_("/select/comp_threshold"), _strip->mapped_control (Comp_Threshold));
} }
if (_strip->comp_speed_controllable ()) { if (_strip->mapped_control (Comp_Mode)) {
_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()); _strip->mapped_control (Comp_Mode)->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::comp_mode, this), 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());
comp_mode (); comp_mode ();
} }
if (_strip->comp_makeup_controllable ()) { if (_strip->mapped_control (Comp_Makeup)) {
_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()); _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->comp_makeup_controllable()); change_message (X_("/select/comp_makeup"), _strip->mapped_control (Comp_Makeup));
} }
renew_sends (); renew_sends ();
renew_plugin (); renew_plugin ();
@ -624,8 +621,8 @@ OSCSelectObserver::tick ()
gain_message (); gain_message ();
} }
} }
if (_strip->comp_redux_controllable() && _strip->comp_enable_controllable() && _strip->comp_enable_controllable()->get_value()) { if (_strip->mapped_output (Comp_Redux) && _strip->mapped_control (Comp_Enable) && _strip->mapped_control (Comp_Enable)->get_value()) {
float new_value = _strip->comp_redux_controllable()->get_parameter(); float new_value = _strip->mapped_output (Comp_Redux)->get_parameter();
if (_comp_redux != new_value) { if (_comp_redux != new_value) {
_osc.float_message (X_("/select/comp_redux"), new_value, addr); _osc.float_message (X_("/select/comp_redux"), new_value, addr);
_comp_redux = new_value; _comp_redux = new_value;
@ -1060,48 +1057,47 @@ OSCSelectObserver::send_enable (string path, uint32_t id, std::shared_ptr<Proces
void void
OSCSelectObserver::comp_mode () OSCSelectObserver::comp_mode ()
{ {
change_message (X_("/select/comp_mode"), _strip->comp_mode_controllable()); change_message (X_("/select/comp_mode"), _strip->mapped_control (Comp_Mode));
_osc.text_message (X_("/select/comp_mode_name"), _strip->comp_mode_controllable()->get_user_string(), addr); _osc.text_message (X_("/select/comp_mode_name"), _strip->mapped_control (Comp_Mode)->get_user_string(), addr);
_osc.text_message (X_("/select/comp_speed_name"), _strip->comp_speed_controllable()->get_user_string(), addr);
} }
void void
OSCSelectObserver::eq_init() OSCSelectObserver::eq_init()
{ {
// HPF and enable are special case, rest are in bands // HPF and enable are special case, rest are in bands
if (_strip->filter_enable_controllable (true)) { if (_strip->mapped_control (HPF_Enable)) {
_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()); _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->filter_enable_controllable(true)); change_message (X_("/select/eq_hpf/enable"), _strip->mapped_control (HPF_Enable));
} }
if (_strip->filter_enable_controllable (false)) { if (_strip->mapped_control (LPF_Enable)) {
_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()); _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->filter_enable_controllable(false)); change_message (X_("/select/eq_lpf/enable"), _strip->mapped_control (LPF_Enable));
} }
if (_strip->filter_freq_controllable (true)) { if (_strip->mapped_control (HPF_Freq)) {
_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()); _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->filter_freq_controllable(true)); change_message (X_("/select/eq_hpf/freq"), _strip->mapped_control (HPF_Freq));
} }
if (_strip->filter_freq_controllable (false)) { if (_strip->mapped_control (LPF_Freq)) {
_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()); _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->filter_freq_controllable(false)); change_message (X_("/select/eq_lpf/freq"), _strip->mapped_control (LPF_Freq));
} }
if (_strip->filter_slope_controllable (true)) { if (_strip->mapped_control (HPF_Slope)) {
_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()); _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->filter_slope_controllable(true)); change_message (X_("/select/eq_hpf/slope"), _strip->mapped_control (HPF_Slope));
} }
if (_strip->filter_slope_controllable (false)) { if (_strip->mapped_control (LPF_Slope)) {
_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()); _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->filter_slope_controllable(false)); change_message (X_("/select/eq_lpf/slope"), _strip->mapped_control (LPF_Slope));
} }
if (_strip->eq_enable_controllable ()) { if (_strip->mapped_control (EQ_Enable)) {
_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()); _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->eq_enable_controllable()); enable_message (X_("/select/eq_enable"), _strip->mapped_control(EQ_Enable));
} }
eq_bands = _strip->eq_band_cnt (); eq_bands = _strip->eq_band_cnt ();
@ -1116,21 +1112,21 @@ OSCSelectObserver::eq_init()
if (_strip->eq_band_name(i).size()) { 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); _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)) { if (_strip->mapped_control (EQ_Gain, 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()); _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->eq_gain_controllable(i)); change_message_with_id (X_("/select/eq_gain"), i + 1, _strip->mapped_control(EQ_Gain, i));
} }
if (_strip->eq_freq_controllable (i)) { if (_strip->mapped_control (EQ_Freq, 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()); _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->eq_freq_controllable(i)); change_message_with_id (X_("/select/eq_freq"), i + 1, _strip->mapped_control (EQ_Freq, i));
} }
if (_strip->eq_q_controllable (i)) { if (_strip->mapped_control (EQ_Q, 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()); _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->eq_q_controllable(i)); change_message_with_id (X_("/select/eq_q"), i + 1, _strip->mapped_control (EQ_Q, i));
} }
if (_strip->eq_shape_controllable (i)) { if (_strip->mapped_control (EQ_Shape, 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()); _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->eq_shape_controllable(i)); change_message_with_id (X_("/select/eq_shape"), i + 1, _strip->mapped_control (EQ_Shape, i));
} }
} }
} }

View file

@ -55,6 +55,7 @@
#include "ardour/user_bundle.h" #include "ardour/user_bundle.h"
#include "ardour/profile.h" #include "ardour/profile.h"
#include "ardour/value_as_string.h" #include "ardour/value_as_string.h"
#include "ardour/well_known_enum.h"
#include "us2400_control_protocol.h" #include "us2400_control_protocol.h"
#include "surface_port.h" #include "surface_port.h"
@ -816,20 +817,20 @@ Strip::setup_trackview_vpot (std::shared_ptr<Stripable> r)
break; break;
case 2: case 2:
pc = r->comp_threshold_controllable(); pc = r->mapped_control (Comp_Threshold);
break; break;
case 3: case 3:
pc = r->comp_speed_controllable(); pc = r->mapped_control (Comp_Attack);
break; break;
case 4: case 4:
pc = r->comp_mode_controllable(); pc = r->mapped_control (Comp_Mode);
_vpot->set_mode(Pot::wrap); _vpot->set_mode(Pot::wrap);
break; break;
case 5: case 5:
pc = r->comp_makeup_controllable(); pc = r->mapped_control (Comp_Makeup);
break; break;
@ -847,14 +848,14 @@ Strip::setup_trackview_vpot (std::shared_ptr<Stripable> r)
break; break;
case 7: case 7:
pc = r->tape_drive_controllable(); pc = r->mapped_control (TapeDrive_Drive);
break; break;
case 8: case 8:
case 9: case 9:
case 10: case 10:
eq_band = (global_pos-8); 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); _vpot->set_mode(Pot::boost_cut);
break; break;
} }
@ -863,24 +864,24 @@ Strip::setup_trackview_vpot (std::shared_ptr<Stripable> r)
switch (global_pos) { switch (global_pos) {
case 6: case 6:
pc = r->filter_freq_controllable(true); pc = r->mapped_control (HPF_Freq);
break; break;
case 7: case 7:
pc = r->filter_freq_controllable(false); pc = r->mapped_control (LPF_Freq);
break; break;
case 8: case 8:
case 10: case 10:
case 12: case 12:
case 14: { case 14: {
eq_band = (global_pos-8) / 2; eq_band = (global_pos-8) / 2;
pc = r->eq_freq_controllable (eq_band); pc = r->mapped_control (EQ_Freq, eq_band);
} break; } break;
case 9: case 9:
case 11: case 11:
case 13: case 13:
case 15: { case 15: {
eq_band = (global_pos-8) / 2; 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); _vpot->set_mode(Pot::boost_cut);
} break; } break;
} }