summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2018-05-04 09:40:28 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2018-05-04 09:40:28 -0400
commita5e8a69dec467cc7d938cc3d92acb218b04486a9 (patch)
tree045d9dd7650548dfb4a9a8262e856b12a809d7be
parent2e41652e617a9d9e938aca267035bf788d096753 (diff)
add well known controls to list accessible via a MIDI binding map (or OSC?)
-rw-r--r--libs/ardour/ardour/types.h29
-rw-r--r--libs/ardour/controllable_descriptor.cc80
-rw-r--r--libs/ardour/session_state.cc53
3 files changed, 159 insertions, 3 deletions
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index 1d08c5bea3..ed6ba96617 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -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 {
diff --git a/libs/ardour/controllable_descriptor.cc b/libs/ardour/controllable_descriptor.cc
index 11947103c0..8bc749041f 100644
--- a/libs/ardour/controllable_descriptor.cc
+++ b/libs/ardour/controllable_descriptor.cc
@@ -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;
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index fcaa76e2ee..346a359229 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -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;