CocoaDev

Edit AllPages

Hey, I’ve been using this class for a while, and thought that someone might find this useful. It is a hack up if various sample code from a long time ago, but I gave it the once over, and it works.

#import <AppKit/AppKit.h> #include <AudioUnit/AudioUnit.h>

// ============================================================================================ // @interface MYAudioUnitEditor : NSWindowController { ComponentDescription _editUnitCD; AudioUnit _editUnit; AudioUnitCarbonView _editView; WindowRef _carbonWindow; NSWindow * _cocoaWindow; NSSize _defaultViewSize; id _delegate; }

// ——————————————————————————————–

@end

// ============================================================================================

@interface NSObject (MYAudioUnitEditorDelegate)

Implementation:

#import “MYAudioUnitEditor.h” #import <AudioUnit/AUCocoaUIView.h>

// ============================================================================================ // Carbon implementation from code at the old ucsb audio tutorial website by Chris Reed (no longer up).

@interface MYAudioUnitEditor(MYAudioUnitEditorPrivate)

// Carbon event handler. static OSStatus WindowClosedHandler ( EventHandlerCallRef myHandler, EventRef theEvent, void* userData) { MYAudioUnitEditor* me = (MYAudioUnitEditor*)userData; [me close]; return noErr; }

// ============================================================================================ @implementation MYAudioUnitEditor

@end