Class AudioEndpointVolumeChannels
- Namespace
- AudioDeviceLib.CoreAudioApi
- Assembly
- AudioDeviceLib.dll
The collection of per-channel volume controls for an audio endpoint.
public sealed class AudioEndpointVolumeChannels : IReadOnlyList<AudioEndpointVolumeChannel>, IReadOnlyCollection<AudioEndpointVolumeChannel>, IEnumerable<AudioEndpointVolumeChannel>, IEnumerable
- Inheritance
-
AudioEndpointVolumeChannels
- Implements
- Inherited Members
Remarks
This collection is a snapshot taken when the owning AudioEndpointVolume was created: the channel count is read once and the per-channel controls are built once. The count comes from the endpoint's stream format, which a user can in principle alter (by reconfiguring the speaker layout, for example), and Windows raises no notification for such a change. Should it happen, this collection keeps describing the layout as it was; re-acquire the device - and with it AudioEndpointVolume - to pick up the new one. In practice endpoint channel counts are fixed: onboard, USB, Bluetooth and HDMI endpoints alike reject any channel count but their native one.
Properties
Count
Gets the number of channels in this snapshot, which is always the number of controls the indexer can return.
public int Count { get; }
Property Value
Remarks
Read from the endpoint once, when this collection was built. It therefore costs no COM call, cannot fail, and cannot disagree with the indexer. See the remarks on AudioEndpointVolumeChannels for when the snapshot can go stale.
this[int]
Gets the volume control for the channel at the specified zero-based index.
public AudioEndpointVolumeChannel this[int index] { get; }
Parameters
Property Value
- AudioEndpointVolumeChannel
The AudioEndpointVolumeChannel at the requested position.
Methods
GetEnumerator()
Enumerates the controls in this snapshot.
public IEnumerator<AudioEndpointVolumeChannel> GetEnumerator()
Returns
- IEnumerator<AudioEndpointVolumeChannel>
An enumerator over the snapshot.