Copyright © 2001-2019 MultiMedia Soft

CallbackForCoreAudioEventsSet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Sets a callback for receiving notification of events generated by CoreAudio devices, allowing to synchronize these devices with the container application; the usage of this callback can be an alternative to the usage of regular events.

 

This method is only intended for usage with Windows Vista and later versions: further information about management of audio devices in Windows Vista and later versions can be found inside the How to access settings of audio devices in Windows Vista and later versions tutorial.

 

 

Syntax

 

[Visual Basic]

control.CallbackForCoreAudioEventsSet (

pCallback as Long

) as enumErrorCodes


 

[C++]

short control.CallbackForCoreAudioEventsSet (

long pCallback

);


 

Parameter

Description

 

 

pCallback

Pointer to the callback function that will receive CoreAudio devices related events. Remember that callback functions must be as fast as possible in order to avoid slowing down overall performances.

A callback function is defined like this:

 

[Visual Basic ]

 

Public Sub MyCdDriveCallback (

ByVal nEvent As enumCoreAudioEvents,

ByVal nData1 As Long,

ByVal nData2 As Long,

ByVal nData3 As Long

)

 

[Visual C++]

 

void FAR PASCAL MyCdDriveCallback (

long nEvent,

long nData1,

long nData2,

long nData3

);

 

where

nEvent

Event reported by the CoreAudio device.

Supported values are the following:

Mnemonic constant

Value

Meaning with data parameters

EV_COREAUDIO_DEVICE_STATE_CHANGED

0

Alternative to the CoreAudioDeviceStateChange event.

Involved data parameters:

nData1: See the nDeviceIndex parameter of the CoreAudioDeviceStateChange event.

nData2: See the nDataFlow parameter of the CoreAudioDeviceStateChange event.

nData3: See the nNewState parameter of the CoreAudioDeviceStateChange event.

EV_COREAUDIO_DEVICE_ADDED

1

Alternative to the CoreAudioDeviceAdded event.

Involved data parameters: none.

EV_COREAUDIO_DEVICE_REMOVED

2

Alternative to the CoreAudioDeviceRemoved event.

Involved data parameters: none.

EV_COREAUDIO_DEVICE_DEFAULT_CHANGE

3

Alternative to the CoreAudioDeviceDefaultChange event.

Involved data parameters:

nData1: See the nDeviceIndex parameter of the CoreAudioDeviceDefaultChange event.

nData2: See the nDataFlow parameter of the CoreAudioDeviceDefaultChange event.

nData3: See the nRole parameter of the CoreAudioDeviceDefaultChange event.

EV_COREAUDIO_DEVICE_VOLUME_CHANGE

4

Alternative to the CoreAudioDeviceVolumeChange event.

Involved data parameters:

nData1: See the nDeviceIndex parameter of the CoreAudioDeviceVolumeChange event.

nData2: See the nDataFlow parameter of the CoreAudioDeviceVolumeChange event.

EV_COREAUDIO_DEVICE_VUMETER_CHANGE

5

Alternative to the CoreAudioDeviceVuMeterChange event.

Involved data parameters:

nData1: See the nDeviceIndex parameter of the CoreAudioDeviceVuMeterChange event.

nData2: See the nDataFlow parameter of the CoreAudioDeviceVuMeterChange event.

nData1

First 32 bits integer value containing event specific data; its value and meaning depends upon the specific event received: see the table above for possible values.

nData2

Second 32 bits integer value containing event specific data; its value and meaning depends upon the specific event received: see the table above for possible values.

nData3

Third 32 bits integer value containing event specific data; its value and meaning depends upon the specific event received: see the table above for possible values.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to get the error code

enumErrorCodes.ERR_NOERROR (0)

The method call was successful