IMMNotificationClient interface(MSDN理解)

来源:互联网 发布:禁止xp下载 安装软件 编辑:程序博客网 时间:2024/06/07 03:47

1. 名称:多媒体客户端产生通知的接口

2. 作用:

1)MSDN:

The IMMNotificationClient interface provides notifications when an audio endpoint device is added or removed, when the state or properties of an endpoint device change, or when there is a change in the default role assigned to an endpoint device.

2)中文:IMMNotificationClient 接口会提供发送通知的功能,当多媒体终端驱动被添加进来,或者移除了,它们的驱动变更了,又或者他们的默认参数发生了改动,等等情况下,

IMMNotificationClient就能产生通知。

3. 用法:

1)MSDN:To receive notifications, the client passes a pointer to its IMMNotificationClient interface instance as a parameter to theIMMDeviceEnumerator::RegisterEndpointNotificationCallback method.

2)中文:要想接受到通知,客户端程序必须传递一个指向IMMNotificationClient interface instance的指针作为IMMDeviceEnumerator::RegisterEndpointNotificationCallback

函数的参数值,这只是个注册函数。。。

3)接着,我们得调用IMMNotificationClient interface的方法获得你想要了解的驱动ID

A client can use the endpoint ID string that it receives as an input parameter in a call to anIMMNotificationClient method in two ways:

  • The client can create an instance of the device that the endpoint ID string identifies. The client does this by calling theIMMDeviceEnumerator::GetDevice method and supplying the endpoint ID string as an input parameter.
  • The client can compare the endpoint ID string with the endpoint ID string of an existing device instance. To obtain the second endpoint ID string, the client calls theIMMDevice::GetId method of the device instance. If the two strings match, they identify the same device.
MethodDescriptionOnDefaultDeviceChanged

Notifies the client that the default audio endpoint device for a particular role has changed.

OnDeviceAdded

Indicates that a new audio endpoint device has been added.

OnDeviceRemoved

Indicates that an audio endpoint device has been removed.

OnDeviceStateChanged

Indicates that the state of an audio endpoint device has changed.

OnPropertyValueChanged

Indicates that the value of a property belonging to an audio endpoint device has changed.


0 0