Mac Developer Library

Developer

IOAudioPort Class Reference

Options
Deployment Target:

On This Page
Language:

IOAudioPort

Represents a logical or physical port or functional unit in an audio device. More...

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable @import Kernel;

Availability


Available in OS X v10.1 and later.
  • Adds a newly created IOAudioControl instance to the port.

    Declaration

    C++

    virtual IOReturn addAudioControl( IOAudioControl *control);

    Parameters

    control

    A newly created IOAudioControl instance that should belong to this port.

    Return Value

    Returns true on successfully staring the IOAudioControl.

    Discussion

    This method is responsible for starting the new IOAudioControl and adding it to the internal audioControls array.

    Import Statement

  • Called to shut down all of the audio controls for this port.

    Declaration

    C++

    virtual void deactivateAudioControls();

    Discussion

    This will stop all of the audio controls and release them so that the instances may be freed. This is called from the free() method.

    Import Statement

  • Frees all of the resources allocated by the IOAudioPort.

    Declaration

    C++

    virtual void free();

    Discussion

    Do not call this directly. This is called automatically by the system when the instance's refcount goes to 0. To decrement the refcount, call release() on the object.

    Import Statement

  • Initializes a newly allocated IOAudioPort instance with the given attributes

    Declaration

    C++

    virtual bool initWithAttributes( UInt32 portType, const char *portName = 0, UInt32 subType = 0, OSDictionary *properties = 0);

    Parameters

    portType

    A readable string representing the type of port. Common port types are defined in IOAudioTypes.h and are prefixed with 'kIOAudioPortType'. Please provide feedback if there are other common port types that should be included.

    portName

    A readable string representing the name of the port. For example: 'Internal Speaker', 'Line Out'. This field is optional, but useful for providing information to the application/user.

    subType

    Developer defined readable string representing a subtype for the port. (optional)

    properties

    Standard property list passed to the init of any new IOService. This dictionary gets stored in the registry for this instance. (optional)

    Return Value

    Returns true on success.

    Discussion

    The properties parameter is passed on the superclass' init(). The portType, subType and properties parameters are optional, however portType is recommended.

    Import Statement

  • Called to start a newly created IOAudioPort.

    Declaration

    C++

    virtual bool start( IOService *provider);

    Parameters

    provider

    The IOAudioDevice that owns this port

    Return Value

    Returns true on success

    Discussion

    This is called automatically by IOAudioDevice when attachAudioPort() is called.

    Import Statement

  • Called when the IOAudioDevice is stopping when it is no longer available.

    Declaration

    C++

    virtual void stop( IOService *provider);

    Parameters

    provider

    The IOAudioDevice that owns this port

    Discussion

    This method calls deactivateAudioControls() to shut down all of the controls associated with this port.

    Import Statement

  • Allocates a new IOAudioPort instance with the given attributes

    Declaration

    C++

    static IOAudioPort *withAttributes( UInt32 portType, const char *portName = 0, UInt32 subType = 0, OSDictionary *properties = 0);

    Parameters

    portType

    A readable string representing the type of port. Common port types are defined in IOAudioTypes.h and are prefixed with 'kIOAudioPortType'. Please provide feedback if there are other common port types that should be included.

    portName

    A readable string representing the name of the port. For example: 'Internal Speaker', 'Line Out'. This field is optional, but useful for providing information to the application/user.

    subType

    Developer defined readable string representing a subtype for the port. (optional)

    properties

    Standard property list passed to the init of any new IOService. This dictionary gets stored in the registry for this instance. (optional)

    Return Value

    Returns the newly allocated and initialized IOAudioPort instance.

    Discussion

    This static method allocates a new IOAudioPort and calls initWithAttributes() on it with the parameters passed in to it.

    Import Statement