Events (5) Methods (9)
Namespace: CSCore.CoreAudioAPI

Syntax

public class MMNotificationClient : IMMNotificationClient, IDisposable

Implements

Summary

The MMNotificationClient object 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.

Uses

Events

DefaultDeviceChanged

Occurs when the default audio endpoint device for a particular device role has changed.

public DefaultDeviceChanged

DeviceAdded

Occurs when a new audio endpoint device has been added.

public DeviceAdded

DevicePropertyChanged

Occurs when the value of a property belonging to an audio endpoint device has changed.

public DevicePropertyChanged

DeviceRemoved

Occurs when an audio endpoint device has been removed.

public DeviceRemoved

DeviceStateChanged

Occurs when the state of an audio endpoint device has changed.

public DeviceStateChanged

Methods

MMNotificationClient()

Initializes a new instance of the MMNotificationClient class.

public void MMNotificationClient()

MMNotificationClient(MMDeviceEnumerator enumerator)

Initializes a new instance of the MMNotificationClient class based on an existing MMDeviceEnumerator.

public void MMNotificationClient(MMDeviceEnumerator enumerator)

Parameters

enumerator

MMDeviceEnumerator

Dispose()

Disposes und unregisters the MMNotificationClient.

public void Dispose()

Remarks

In order to unregister the MMNotificationClient, this method calls the UnregisterEndpointNotificationCallback method.

Finalize()

Finalizes an instance of the MMNotificationClient class.

protected void Finalize()

OnDefaultDeviceChanged(DataFlow dataFlow, Role role, String deviceId)

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

none Int32 OnDefaultDeviceChanged(DataFlow dataFlow, Role role, String deviceId)

Parameters

dataFlow

DataFlow

The data-flow direction of the endpoint device.

role

Role

The device role of the audio endpoint device.

deviceId

String

The device id that identifies the audio endpoint device.

Returns

HRESULT

OnDeviceAdded(String deviceId)

The OnDeviceAdded method indicates that a new audio endpoint device has been added.

none Int32 OnDeviceAdded(String deviceId)

Parameters

deviceId

String

The device id that identifies the audio endpoint device.

Returns

HRESULT

OnDeviceRemoved(String deviceId)

The OnDeviceRemoved method indicates that an audio endpoint device has been removed.

none Int32 OnDeviceRemoved(String deviceId)

Parameters

deviceId

String

The device id that identifies the audio endpoint device.

Returns

HRESULT

OnDeviceStateChanged(String deviceId, DeviceState deviceState)

The OnDeviceStateChanged method indicates that the state of an audio endpoint device has changed.

none Int32 OnDeviceStateChanged(String deviceId, DeviceState deviceState)

Parameters

deviceId

String

The device id that identifies the audio endpoint device.

deviceState

DeviceState

Specifies the new state of the endpoint device.

Returns

HRESULT

OnPropertyValueChanged(String deviceId, PropertyKey key)

The OnPropertyValueChanged method indicates that the value of a property belonging to an audio endpoint device has changed.

none Int32 OnPropertyValueChanged(String deviceId, PropertyKey key)

Parameters

deviceId

String

The device id that identifies the audio endpoint device.

key

PropertyKey

The PropertyKey that specifies the changed property.

Returns

HRESULT