add well known controls to list accessible via a MIDI binding map (or OSC?)
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 4 May 2018 13:40:28 +0000 (09:40 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 4 May 2018 13:40:28 +0000 (09:40 -0400)
libs/ardour/ardour/types.h
libs/ardour/controllable_descriptor.cc
libs/ardour/session_state.cc

index 1d08c5bea3eea4c8a418264585dd62d503e78e28..ed6ba96617bf18b08b8ce003765758a5f8672298 100644 (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 {
index 11947103c0a40eb3b44a1e34ed9af297ec3a06d2..8bc749041f26ab01fda0600092d902351ecec75a 100644 (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;
index fcaa76e2ee3cd0567dd6c11276058d98356b4109..346a3592291c39f93ec90700d47447614ffad8b9 100644 (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;