Commits

Anonymous committed 0050ccd

Add get/set parameter

Comments (0)

Files changed (2)

lib/DDAudioUnit.h

 - (void) setStreamFormatWithDescription:
     (const AudioStreamBasicDescription *) streamFormat;
 
+- (void) setParameter: (AudioUnitParameterID) parameter
+                scope: (AudioUnitScope) scope
+              element: (AudioUnitElement) element
+                value: (Float32) value
+         bufferOffset: (UInt32) bufferOffset;
+
+- (Float32) getParameter: (AudioUnitParameterID) parameter
+                   scope: (AudioUnitScope) scope
+                 element: (AudioUnitElement) element;
+
 #pragma mark -
 #pragma mark Presets
 

lib/DDAudioUnit.m

                                   sizeof(AudioStreamBasicDescription)));
 }
 
+- (void) setParameter: (AudioUnitParameterID) parameter
+                scope: (AudioUnitScope) scope
+              element: (AudioUnitElement) element
+                value: (Float32) value
+         bufferOffset: (UInt32) bufferOffset;
+{
+    THROW_IF(AudioUnitSetParameter([self AudioUnit], parameter, scope,
+                                   element, value, bufferOffset));
+}
+
+- (Float32) getParameter: (AudioUnitParameterID) parameter
+                   scope: (AudioUnitScope) scope
+                 element: (AudioUnitElement) element;
+{
+    Float32 value = 0;
+    THROW_IF(AudioUnitGetParameter([self AudioUnit], parameter, scope,
+                                   element, &value));
+    return value;
+}
+
 #pragma mark -
 #pragma mark Presets