Commits

Anonymous committed 9b1881e

Add setInputCallback: and show to DDAudioUnitGraph. Reformat DDAudioUnit

  • Participants
  • Parent commits a64df90

Comments (0)

Files changed (4)

lib/DDAudioUnit.h

 
 - (BOOL) bypass;
 
-- (void) setStreamFormatWithDescription:
-    (const AudioStreamBasicDescription *) streamFormat;
+- (void) setStreamFormatWithDescription: (const AudioStreamBasicDescription *) streamFormat;
 
 - (void) setParameter: (AudioUnitParameterID) parameter
                 scope: (AudioUnitScope) scope

lib/DDAudioUnit.m

     return (bypassInt == 0)? NO : YES;
 }
 
-- (void) setStreamFormatWithDescription:
-    (const AudioStreamBasicDescription *) streamFormat;
+- (void) setStreamFormatWithDescription: (const AudioStreamBasicDescription *) streamFormat;
 {
     THROW_IF(AudioUnitSetProperty([self AudioUnit],
                                   kAudioUnitProperty_StreamFormat,

lib/DDAudioUnitGraph.h

 
 - (void) disconnectAll;
 
+- (void) setInputCallback: (AURenderCallback) renderCallBack
+                  context: (void *) context
+                  forNode: (DDAudioUnitNode *) sourceNode
+                    input: (UInt32) input;
+
 - (void) open;
 
 - (void) update;
 
 - (float) cpuLoad;
 
+- (void) show;
+
 @end

lib/DDAudioUnitGraph.m

     THROW_IF(AUGraphClearConnections(mGraph));
 }
 
+- (void) setInputCallback: (AURenderCallback) renderCallBack
+                  context: (void *) context
+                  forNode: (DDAudioUnitNode *) sourceNode
+                    input: (UInt32) input;
+{
+    AURenderCallbackStruct callback = {
+        .inputProc = renderCallBack,
+        .inputProcRefCon = context
+    };
+    THROW_IF(AUGraphSetNodeInputCallback(mGraph, [sourceNode AUNode], input,
+                                         &callback));
+}
+
 - (void) open;
 {
     THROW_IF(AUGraphOpen(mGraph));
     return (float) cpuLoad;
 }
 
+- (void) show;
+{
+    CAShow(mGraph);
+}
+           
+
 @end