DEVICENOTIFYPROC callback

Device list notification callback function used with BASS_CONFIG_DEV_NOTIFY.

void CALLBACK DeviceNotifyProc(
    DWORD notify
);

Parameters

notifyThe notification, one of the following.
BASS_DEVICENOTIFY_ENABLEDThe BASS_DEVICE_ENABLED flag has been (un)set on one or more devices. This includes new devices, and both output and recording devices.
BASS_DEVICENOTIFY_DEFAULTThe output BASS_DEVICE_DEFAULT flag has changed device.
BASS_DEVICENOTIFY_DEFAULTCOMThe output BASS_DEVICE_DEFAULTCOM flag has changed device.
BASS_DEVICENOTIFY_REC_DEFAULTThe recording BASS_DEVICE_DEFAULT flag has changed device.
BASS_DEVICENOTIFY_REC_DEFAULTCOMThe recording BASS_DEVICE_DEFAULTCOM flag has changed device.

Remarks

The notification does not tell which device(s) has changed; the device lists need to be refreshed with BASS_GetDeviceInfo and BASS_RecordGetDeviceInfo to find that out. There may be multiple notifications in quick succession, eg. connecting new hardware may result in notifications for a new output device, new recording device, and new default devices. So you may want to wait a bit before refreshing the device list(s), but do not wait in the callback, eg. start a timer instead.

Devices should not be initialized or freed within a callback. Do that in another thread.

See also

BASS_CONFIG_DEV_NOTIFY