add well known controls to list accessible via a MIDI binding map (or OSC?)

This commit is contained in:
Paul Davis 2018-05-04 09:40:28 -04:00
parent 2e41652e61
commit a5e8a69dec
3 changed files with 159 additions and 3 deletions

View file

@ -152,9 +152,32 @@ namespace ARDOUR {
MonitoringAutomation,
BusSendLevel,
BusSendEnable,
SendLevelAutomation, /* used only by a controllable descriptor
to refer to gain of a particular send
*/
/* used only by Controllable Descriptor to access send parameters */
SendLevelAutomation,
SendEnableAutomation,
SendAzimuthAutomation,
/* these describe "well known" controls of a Stripable that are
covered by the types above. They should be used only as part
of ControllableDescriptor
*/
EQEnableAutomation,
EQGainAutomation,
EQFreqAutomation,
EQQAutomation,
EQShapeAutomation,
FilterFreqAutomation,
FilterSlopeAutomation,
FilterEnableAutomation,
CompressorEnableAutomation,
CompressorThresholdAutomation,
CompressorSpeedAutomation,
CompressorModeAutomation,
CompressorMakeupAutomation,
/* Redux not included because it is read-only */
};
enum AutoState {

View file

@ -176,12 +176,92 @@ ControllableDescriptor::set (const std::string& str)
if (path[2] == "gain") {
_subtype = SendLevelAutomation;
_target.push_back (atoi (rest[1]));
} else if (path[2] == "gain") {
_subtype = SendLevelAutomation;
_target.push_back (atoi (rest[1]));
} else if (path[2] == "enable") {
_subtype = SendLevelAutomation;
_target.push_back (atoi (rest[1]));
} else {
return -1;
}
} else {
return -1;
}
} else if (path[1] == "eq") {
/* /route/eq/gain/<band> */
if (path.size() != 3) {
return -1;
}
_target.push_back (atoi (path[3])); /* band number */
if (path[2] == "enable") {
_subtype = EQEnableAutomation;
} else if (path[2] == "gain") {
_subtype = EQGainAutomation;
} else if (path[2] == "freq") {
_subtype = EQFreqAutomation;
} else if (path[2] == "q") {
_subtype = EQQAutomation;
} else if (path[2] == "shape") {
_subtype = EQShapeAutomation;
} else {
return -1;
}
/* get desired band number */
_target.push_back (atoi (rest[1]));
} else if (path[1] == "filter") {
/* /route/filter/hi/freq */
if (path.size() != 4) {
return -1;
}
if (path[2] == "hi") {
_target.push_back (1); /* high pass filter */
} else {
_target.push_back (0); /* low pass filter */
}
if (path[3] == "enable") {
_subtype = FilterFreqAutomation;
} else if (path[3] == "freq") {
_subtype = FilterFreqAutomation;
} else if (path[3] == "slope") {
_subtype = FilterSlopeAutomation;
} else {
return -1;
}
_target.push_back (atoi (rest[1]));
} else if (path[1] == "compressor") {
if (path.size() != 3) {
return -1;
}
if (path[2] == "enable") {
_subtype = CompressorEnableAutomation;
} else if (path[2] == "threshold") {
_subtype = CompressorThresholdAutomation;
} else if (path[2] == "mode") {
_subtype = CompressorModeAutomation;
} else if (path[2] == "speed") {
_subtype = CompressorSpeedAutomation;
} else if (path[2] == "makeup") {
_subtype = CompressorMakeupAutomation;
} else {
return -1;
}
}
return 0;

View file

@ -3816,6 +3816,58 @@ Session::controllable_by_descriptor (const ControllableDescriptor& desc)
c = s->pan_elevation_control();
break;
case EQEnableAutomation:
c = s->eq_enable_controllable();
break;
case EQGainAutomation:
c = s->eq_gain_controllable(desc.target (0));
break;
case EQFreqAutomation:
c = s->eq_freq_controllable(desc.target(0));
break;
case EQQAutomation:
c = s->eq_q_controllable(desc.target(0));
break;
case EQShapeAutomation:
c = s->eq_shape_controllable(desc.target(0));
break;
case FilterFreqAutomation:
c = s->filter_freq_controllable(desc.target(0));
break;
case FilterSlopeAutomation:
c = s->filter_slope_controllable(desc.target(0));
break;
case FilterEnableAutomation:
c = s->filter_enable_controllable(desc.target(0));
break;
case CompressorEnableAutomation:
c = s->comp_enable_controllable();
break;
case CompressorThresholdAutomation:
c = s->comp_threshold_controllable();
break;
case CompressorSpeedAutomation:
c = s->comp_speed_controllable();
break;
case CompressorModeAutomation:
c = s->comp_mode_controllable();
break;
case CompressorMakeupAutomation:
c = s->comp_makeup_controllable();
break;
case PluginAutomation:
{
uint32_t plugin = desc.target (0);
@ -3856,6 +3908,7 @@ Session::controllable_by_descriptor (const ControllableDescriptor& desc)
break;
}
default:
/* relax and return a null pointer */
break;