Methods (9) Properties (4)
Namespace: CSCore.CoreAudioAPI

Syntax

public class MMDevice : ComObject

Base Type

Summary

Encapsulates the generic features of a multimedia device resource.

Uses

Used by

Methods

MMDevice(IntPtr ptr)

Initializes a new instance of the MMDevice class.

public void MMDevice(IntPtr ptr)

Parameters

ptr

IntPtr

Native pointer.

Remarks

Use the MMDeviceEnumerator class to create a new MMDevice instance.

Activate(Guid iid, CLSCTX context, IntPtr activationParams)

Creates a COM object with the specified interface.

public IntPtr Activate(Guid iid, CLSCTX context, IntPtr activationParams)

Parameters

iid

Guid

The interface identifier. This parameter is a reference to a GUID that identifies the interface that the caller requests be activated. The caller will use this interface to communicate with the COM object.

context

CLSCTX

The execution context in which the code that manages the newly created object will run.

activationParams

IntPtr

Use Zero as the default value. See http://msdn.microsoft.com/en-us/library/windows/desktop/dd371405%28v=vs.85%29.aspx for more details.

Returns

A pointer variable into which the method writes the address of the interface specified by parameter iid.

public Int32 ActivateNative(Guid iid, CLSCTX context, IntPtr activationParams, IntPtr& pinterface)

Parameters

iid

Guid

The interface identifier. This parameter is a reference to a GUID that identifies the interface that the caller requests be activated. The caller will use this interface to communicate with the COM object.

context

CLSCTX

The execution context in which the code that manages the newly created object will run.

activationParams

IntPtr

Use Zero as the default value. See http://msdn.microsoft.com/en-us/library/windows/desktop/dd371405%28v=vs.85%29.aspx for more details.

pinterface

IntPtr&

A pointer variable into which the method writes the address of the interface specified by parameter iid.

Returns

HRESULT

Dispose(Boolean disposing)

Disposes the MMDevice and its default property store (see PropertyStore property).

protected void Dispose(Boolean disposing)

Parameters

disposing

Boolean

True to release both managed and unmanaged resources; false to release only unmanaged resources.

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom

GetIdNative(String& deviceid)

Retrieves an endpoint ID string that identifies the audio endpoint device.

public Int32 GetIdNative(String& deviceid)

Parameters

deviceid

String&

The variable which will receive the id of the device.

Returns

HRESULT

GetStateNative(DeviceState& state)

Retrieves the current device state.

public Int32 GetStateNative(DeviceState& state)

Parameters

state

DeviceState&

The variable which will receive the DeviceState of the device.

Returns

HRESULT

OpenPropertyStore(StorageAccess storageAccess)

Retrieves an interface to the device's property store.

public PropertyStore OpenPropertyStore(StorageAccess storageAccess)

Parameters

storageAccess

StorageAccess

The storage-access mode. This parameter specifies whether to open the property store in read mode, write mode, or read/write mode.

Returns

PropertyStore for the MMDevice.

OpenPropertyStoreNative(StorageAccess storageAccess, IntPtr& propertyStore)

Retrieves an interface to the device's property store.

public Int32 OpenPropertyStoreNative(StorageAccess storageAccess, IntPtr& propertyStore)

Parameters

storageAccess

StorageAccess

The storage-access mode. This parameter specifies whether to open the property store in read mode, write mode, or read/write mode.

propertyStore

IntPtr&

A pointer variable into which the method writes the address of the IPropertyStore interface of the device's property store.

Returns

HRESULT

ToString()

Returns the FriendlyName of the MMDevice.

public String ToString()

Returns

The FriendlyName.

Properties

DeviceID

Gets the device id. For information, see .

public String DeviceID { get; }

DeviceState

Gets the device state of the device.

public DeviceState DeviceState { get; }

FriendlyName

Gets the friendly name of the device.

public String FriendlyName { get; }

Remarks

This value is stored in the PropertyStore.

PropertyStore

Gets the propertystore associated with the MMDevice.

public PropertyStore PropertyStore { get; }

Remarks

Warning: This PropertyStore is only readable. Use the OpenPropertyStore-Method to get writeable PropertyStore.

Class Diagram

public classMMDeviceActivateActivateNativeDisposeGetIdNativeGetStateNativeOpenPropertyStoreOpenPropertyStoreNativeToStringMMDeviceDeviceID { get; }DeviceState { get; }FriendlyName { get; }PropertyStore { get; }public classComObjectUnsafeBasePtrAddRefDisposeDisposeFinalizeQueryInterfaceQueryInterfaceQueryInterfaceReleaseComObjectComObjectBasePtr { get; set; }IsDisposed { get; }public classAudioClientIID_IAudioClientFromMMDeviceGetBufferSizeGetBufferSizeNativeGetCurrentPaddingGetCurrentPaddingNativeGetDevicePeriodNativeGetMixFormatGetMixFormatNativeGetServiceGetServiceNativeGetStreamLatencyGetStreamLatencyNativeInitializeInitializeNativeInitializeNativeIsFormatSupportedIsFormatSupportedIsFormatSupportedNativeResetResetNativeSetEventHandleSetEventHandleSetEventHandleNativeStartStartNativeStopStopNativeAudioClientBufferSize { get; }CurrentPadding { get; }DefaultDevicePeriod { get; }MinimumDevicePeriod { get; }MixFormat { get; }StreamLatency { get; }public classAudioEndpointVolumeFromDeviceGetChannelCountGetChannelCountNativeGetChannelVolumeLevelGetChannelVolumeLevelNativeGetChannelVolumeLevelScalarGetChannelVolumeLevelScalarNativeGetMasterVolumeLevelGetMasterVolumeLevelNativeGetMasterVolumeLevelScalarGetMasterVolumeLevelScalarNativeGetMuteGetMuteNativeGetVolumeRangeGetVolumeRangeNativeGetVolumeStepInfoGetVolumeStepInfoNativeQueryHardwareSupportQueryHardwareSupportNativeRegisterControlChangeNotifyRegisterControlChangeNotifyNativeSetChannelVolumeLevelSetChannelVolumeLevelNativeSetChannelVolumeLevelScalarSetChannelVolumeLevelScalarNativeSetMasterVolumeLevelSetMasterVolumeLevelNativeSetMasterVolumeLevelScalarSetMasterVolumeLevelScalarNativeSetMuteSetMuteNativeUnregisterControlChangeNotifyUnregisterControlChangeNotifyNativeVolumeStepDownVolumeStepDownNativeVolumeStepUpVolumeStepUpNativeAudioEndpointVolumeChannelCount { get; }Channels { get; }MasterVolumeLevel { get; set; }MasterVolumeLevelScalar { get; set; }RegisteredCallbacks { get; }public classAudioMeterInformationFromDeviceGetChannelsPeakValuesGetChannelsPeakValuesGetChannelsPeakValuesNativeGetMeteringChannelCountGetMeteringChannelCountNativeGetPeakValueGetPeakValueNativeQueryHardwareSupportQueryHardwareSupportNativeAudioMeterInformationHardwareSupport { get; }Item { get; }MeteringChannelCount { get; }PeakValue { get; }public classAudioSessionManager2DisposeFromMMDeviceGetSessionEnumeratorGetSessionEnumeratorNativeRegisterDuckNotificationRegisterDuckNotificationNativeRegisterSessionNotificationRegisterSessionNotificationNativeUnregisterDuckNotificationUnregisterDuckNotificationNativeUnregisterSessionNotificationUnregisterSessionNotificationNativeAudioSessionManager2public classCoreAudioAPIExceptionTryCoreAudioAPIExceptionpublic classComObjectUnsafeBasePtrAddRefDisposeDisposeFinalizeQueryInterfaceQueryInterfaceQueryInterfaceReleaseComObjectComObjectBasePtr { get; set; }IsDisposed { get; }public structPropertyVariantBlobValueBoolValueBValueCValueDateDoubleValueFileTimeFloatValueHValueIntValueIValueLValuePointerValueReserved1Reserved2Reserved3SCodeUHValueUIntValueUIValueULValueVartypeDisposeGetValueToStringPropertyVariantDataType { get; set; }

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom