Audio Unit View Components

Header file: AudioUnit/AudioUnitCarbonView.h


Functions
 AudioUnitCarbonViewCreate Open a view component's user interface.
 AudioUnitCarbonViewSetEventListener Installs an event listener in an AudioUnitCarbonView.
Callbacks
 AudioUnitCarbonViewEventListener Receive notifications from user-interface events.
Defined Types
 AudioUnitCarbonView
Enumerations
 kAudioUnitCarbonViewComponentType
 AudioUnitCarbonViewEventID

AudioUnitCarbonViewCreate

Open a view component's user interface.
ComponentResult AudioUnitCarbonViewCreate(
  AudioUnitCarbonView   inView,
  AudioUnit             inAudioUnit,
  WindowRef             inWindow,
  ControlRef            inParentControl,
  const Float32Point *  inLocation,
  const Float32Point *  inSize,
  ControlRef *          outControl
);
The host application specifies the AudioUnit which the view is to control, and provides a window, parent control, and rectangle into which the AudioUnitCarbonView component is to create itself.

The host application is responsible for closing the AudioUnitCarbonView component (via CloseComponent) before closing its window.

Parameters

inView
The view component instance.
inAudioUnit
The AudioUnit component instance which the view is to control.
inWindow
The Carbon window in which the user interface is to be opened.
inParentControl
The Carbon control into which the user interface is to be embedded (often but not necessarily the window's root control).
inLocation
The host application's requested location for the view. The view should always create itself at the specified location,
inSize
The host application's requested size for the view. The view may choose a different size for itself, determined by the dimensions of outControl.
outControl
On exit, the Carbon control which contains the entire user interface.

AudioUnitCarbonViewSetEventListener

Installs an event listener in an AudioUnitCarbonView.
ComponentResult AudioUnitCarbonViewSetEventListener(
  AudioUnitCarbonView               inView,
  AudioUnitCarbonViewEventListener  inCallback,
  void *                            inUserData
);

Parameters

inView
The view component instance.
inCallback
The event listener callback function.
inUserData
A user data pointer passed to the callback.

AudioUnitCarbonViewEventListener

Receive notifications from user-interface events.
typedef void (*AudioUnitCarbonViewEventListener)(
  void *                      inUserData,
  AudioUnitCarbonView         inView,
  const AudioUnitParameter *  inParameter,
  AudioUnitCarbonViewEventID  inEvent,
  const void *                inEventParam
);
This callback function is called when certain events occur in an AudioUnitCarbonView, such as mouse-down and up events on a control.

Parameters

inUserData
User-defined pointer that was passed to AudioUnitCarbonViewSetEventListener.
inView
The AudioUnitCarbonVIew generating the message.
inParameter
The parameter associated with the control generating the message.
inEvent
The type of event.
inEventParam
Further information about the event, dependent on its type.

AudioUnitCarbonView

typedef ComponentInstance AudioUnitCarbonView;

kAudioUnitCarbonViewComponentType

enum {
  kAudioUnitCarbonViewComponentType  = FOUR_CHAR_CODE('auvw')
};

Constants

kAudioUnitCarbonViewComponentType

AudioUnitCarbonViewEventID

typedef SInt32 AudioUnitCarbonViewEventID;
enum {
  kAudioUnitCarbonViewEvent_MouseDownInControl  = 0,
  kAudioUnitCarbonViewEvent_MouseUpInControl    = 1
};
Specifies an event passed to an AudioUnitCarbonViewEventListener.

Constants

kAudioUnitCarbonViewEvent_MouseDownInControl
kAudioUnitCarbonViewEvent_MouseUpInControl