Skip to content

Latest commit

 

History

History
97 lines (71 loc) · 5.34 KB

nf-mmdeviceapi-immnotificationclient-ondefaultdevicechanged.md

File metadata and controls

97 lines (71 loc) · 5.34 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:mmdeviceapi.IMMNotificationClient.OnDefaultDeviceChanged
IMMNotificationClient::OnDefaultDeviceChanged (mmdeviceapi.h)
The OnDefaultDeviceChanged method notifies the client that the default audio endpoint device for a particular device role has changed.
IMMNotificationClient interface [Core Audio]
OnDefaultDeviceChanged method
IMMNotificationClient.OnDefaultDeviceChanged
IMMNotificationClient::OnDefaultDeviceChanged
IMMNotificationClientOnDefaultDeviceChanged
OnDefaultDeviceChanged
OnDefaultDeviceChanged method [Core Audio]
OnDefaultDeviceChanged method [Core Audio]
IMMNotificationClient interface
coreaudio.immnotificationclient_ondefaultdevicechanged
mmdeviceapi/IMMNotificationClient::OnDefaultDeviceChanged
coreaudio\immnotificationclient_ondefaultdevicechanged.htm
CoreAudio
3d484e5d-bdc6-41f1-bd94-ab0c9e109222
12/05/2018
IMMNotificationClient interface [Core Audio],OnDefaultDeviceChanged method, IMMNotificationClient.OnDefaultDeviceChanged, IMMNotificationClient::OnDefaultDeviceChanged, IMMNotificationClientOnDefaultDeviceChanged, OnDefaultDeviceChanged, OnDefaultDeviceChanged method [Core Audio], OnDefaultDeviceChanged method [Core Audio],IMMNotificationClient interface, coreaudio.immnotificationclient_ondefaultdevicechanged, mmdeviceapi/IMMNotificationClient::OnDefaultDeviceChanged
mmdeviceapi.h
Windows
Windows Vista [desktop apps only]
Windows Server 2008 [desktop apps only]
Windows
19H1
IMMNotificationClient::OnDefaultDeviceChanged
mmdeviceapi/IMMNotificationClient::OnDefaultDeviceChanged
c++
APIRef
kbSyntax
COM
Mmdeviceapi.h
IMMNotificationClient.OnDefaultDeviceChanged

IMMNotificationClient::OnDefaultDeviceChanged

-description

The OnDefaultDeviceChanged method notifies the client that the default audio endpoint device for a particular device role has changed.

-parameters

-param flow [in]

The data-flow direction of the endpoint device. This parameter is set to one of the following EDataFlow enumeration values:

eRender

eCapture

The data-flow direction for a rendering device is eRender. The data-flow direction for a capture device is eCapture.

-param role [in]

The device role of the audio endpoint device. This parameter is set to one of the following ERole enumeration values:

eConsole

eMultimedia

eCommunications

-param pwstrDefaultDeviceId [in]

Pointer to the endpoint ID string that identifies the audio endpoint device. This parameter points to a null-terminated, wide-character string containing the endpoint ID. The string remains valid for the duration of the call. If the user has removed or disabled the default device for a particular role, and no other device is available to assume that role, then pwstrDefaultDevice is NULL.

-returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

-remarks

The three input parameters specify the data-flow direction, device role, and endpoint ID string of the new default audio endpoint device.

In Windows Vista, the MMDevice API supports device roles but the system-supplied user interface programs do not. The user interface in Windows Vista enables the user to select a default audio device for rendering and a default audio device for capture. When the user changes the default rendering or capture device, the system assigns all three device roles (eConsole, eMultimedia, and eCommunications) to the new device. Thus, when the user changes the default rendering or capture device, the system calls the client's OnDefaultDeviceChanged method three times—once for each of the three device roles.

In a future version of Windows, the user interface might enable the user to assign individual roles to different devices. In that case, if the user changes the assignment of only one or two device roles to a new rendering or capture device, the system will call the client's OnDefaultDeviceChanged method only once or twice (that is, one call per changed role). Depending on how the OnDefaultDeviceChanged method responds to role changes, the behavior of an audio application developed to run in Windows Vista might change when run in a future version of Windows. For more information, see Device Roles in Windows Vista.

For a code example that implements the OnDefaultDeviceChanged method, see Device Events.

-see-also

IMMNotificationClient Interface