Table of Contents

Class PropertyStore

Namespace
AudioDeviceLib.CoreAudioApi
Assembly
AudioDeviceLib.dll

Property Store class, only supports reading properties at the moment.

[PublicAPI]
public sealed class PropertyStore : IDisposable
Inheritance
PropertyStore
Implements
Inherited Members

Properties

Count

Gets the number of properties in the store.

public int Count { get; }

Property Value

int

Exceptions

COMException

Thrown when the underlying Core Audio call fails.

this[PropertyKey]

Gets the property that matches the given key exactly.

public PropertyStoreProperty? this[PropertyKey queryKey] { get; }

Parameters

queryKey PropertyKey

The property key (set GUID and property id) to look up.

Property Value

PropertyStoreProperty

The matching PropertyStoreProperty, or null if none is found.

Exceptions

COMException

Thrown when the underlying Core Audio call fails.

this[Guid]

Gets the first property whose property set matches the given GUID.

public PropertyStoreProperty? this[Guid formatId] { get; }

Parameters

formatId Guid

The format identifier (GUID) of the property set to look up.

Property Value

PropertyStoreProperty

The matching PropertyStoreProperty, or null if none is found.

Exceptions

COMException

Thrown when the underlying Core Audio call fails.

this[int]

Gets the property at the specified zero-based index.

public PropertyStoreProperty this[int index] { get; }

Parameters

index int

The zero-based property index (0 to Count - 1).

Property Value

PropertyStoreProperty

The PropertyStoreProperty at the requested position.

Exceptions

COMException

Thrown when the underlying Core Audio call fails.

Methods

Contains(PropertyKey)

Determines whether the store contains a property matching the given key exactly.

public bool Contains(PropertyKey compareKey)

Parameters

compareKey PropertyKey

The property key (set GUID and property id) to look for.

Returns

bool

true if a matching property exists; otherwise false.

Contains(Guid)

Determines whether the store contains any property from the given property set.

public bool Contains(Guid formatId)

Parameters

formatId Guid

The format identifier (GUID) of the property set to look for.

Returns

bool

true if a property with the matching set GUID exists; otherwise false.

Dispose()

Invalidates this wrapper without releasing externally held COM references.

public void Dispose()

Get(int)

Gets the property key at the specified zero-based index.

public PropertyKey Get(int index)

Parameters

index int

The zero-based property index (0 to Count - 1).

Returns

PropertyKey

The PropertyKey at the requested position.

Exceptions

COMException

Thrown when the underlying Core Audio call fails.

GetValue(int)

Gets the managed property value at the specified zero-based index.

public PropertyValue GetValue(int index)

Parameters

index int

The zero-based property index (0 to Count - 1).

Returns

PropertyValue

The PropertyValue snapshot at the requested position.

Remarks

The returned snapshot holds no unmanaged resources and requires no cleanup.

Exceptions

COMException

Thrown when the underlying Core Audio call fails.

TryGetValue(PropertyKey, out PropertyValue)

Reads the value of a single property by key, without scanning the store.

public bool TryGetValue(PropertyKey key, out PropertyValue value)

Parameters

key PropertyKey

The property key (set GUID and property id) to read.

value PropertyValue

The managed snapshot, or an empty snapshot when the key is absent or the COM read fails.

Returns

bool

true if the read succeeds and the variant is neither empty nor null; otherwise false.

Remarks

The returned snapshot holds no unmanaged resources and requires no cleanup.