Volume Control
Application-specific hotkeys for Windows
VolumeControl.CoreAudio.AudioDeviceSelector Class Reference

Manages the currently "selected" AudioDevice instance for a given CoreAudio.AudioDeviceManager object. More...

Inheritance diagram for VolumeControl.CoreAudio.AudioDeviceSelector:
Collaboration diagram for VolumeControl.CoreAudio.AudioDeviceSelector:

Public Member Functions

 AudioDeviceSelector (AudioDeviceManager audioDeviceManager)
 Creates a new AudioDeviceSelector instance bound to the given audioDeviceManager . More...
 
void SelectNextDevice ()
 Changes the Selected item to the next session in the list, looping back if necessary. More...
 
void SelectPreviousDevice ()
 Changes the Selected item to the previous session in the list, looping back if necessary. More...
 
void DeselectDevice ()
 Changes the Selected item to null. More...
 
void SelectDefaultDevice (DataFlow dataFlow=DataFlow.Render)
 Changes the Selected item to the default Multimedia audio device. More...
 

Properties

AudioDeviceSelected [get, set]
 Gets or the sets the selected item. More...
 
int SelectedIndex [get, set]
 
bool LockSelection [get, set]
 
- Properties inherited from VolumeControl.CoreAudio.Interfaces.IAudioSelector
int SelectedIndex [get, set]
 Gets or sets the currently selected item by its index in the list. More...
 
bool LockSelection [get, set]
 Gets or sets whether the selected item can be changed or not. More...
 

Events

PropertyChangedEventHandler? PropertyChanged
 
EventHandler< AudioDevice?>? SelectedDeviceChanged
 Occurs when the selected device is changed for any reason. More...
 

Detailed Description

Manages the currently "selected" AudioDevice instance for a given CoreAudio.AudioDeviceManager object.

Constructor & Destructor Documentation

◆ AudioDeviceSelector()

VolumeControl.CoreAudio.AudioDeviceSelector.AudioDeviceSelector ( AudioDeviceManager  audioDeviceManager)

Creates a new AudioDeviceSelector instance bound to the given audioDeviceManager .

Parameters
audioDeviceManagerAn CoreAudio.AudioDeviceManager instance to select from.

References VolumeControl.CoreAudio.AudioDeviceManager.DeviceRemovedFromList, and VolumeControl.CoreAudio.AudioDeviceSelector.SelectDefaultDevice().

Here is the call graph for this function:

Member Function Documentation

◆ DeselectDevice()

void VolumeControl.CoreAudio.AudioDeviceSelector.DeselectDevice ( )

◆ SelectDefaultDevice()

void VolumeControl.CoreAudio.AudioDeviceSelector.SelectDefaultDevice ( DataFlow  dataFlow = DataFlow.Render)

Changes the Selected item to the default Multimedia audio device.

Does nothing if LockSelection == true.

Parameters
dataFlowWhether to get the default input or output device. Passing DataFlow.All will cause an exception.
Exceptions
ArgumentExceptiondataFlow was set to DataFlow.All.

References VolumeControl.CoreAudio.AudioDeviceManager.GetDefaultDevice(), VolumeControl.CoreAudio.AudioDeviceSelector.LockSelection, and VolumeControl.CoreAudio.AudioDeviceSelector.Selected.

Referenced by VolumeControl.CoreAudio.AudioDeviceSelector.AudioDeviceSelector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectNextDevice()

void VolumeControl.CoreAudio.AudioDeviceSelector.SelectNextDevice ( )

Changes the Selected item to the next session in the list, looping back if necessary.

Does nothing if LockSelection == true.

References VolumeControl.CoreAudio.AudioDeviceManager.Devices, VolumeControl.CoreAudio.AudioDeviceSelector.LockSelection, and VolumeControl.CoreAudio.AudioDeviceSelector.SelectedIndex.

◆ SelectPreviousDevice()

void VolumeControl.CoreAudio.AudioDeviceSelector.SelectPreviousDevice ( )

Changes the Selected item to the previous session in the list, looping back if necessary.

Does nothing if LockSelection == true.

References VolumeControl.CoreAudio.AudioDeviceManager.Devices, VolumeControl.CoreAudio.AudioDeviceSelector.LockSelection, and VolumeControl.CoreAudio.AudioDeviceSelector.SelectedIndex.

Property Documentation

◆ Selected

AudioDevice? VolumeControl.CoreAudio.AudioDeviceSelector.Selected
getset

Event Documentation

◆ SelectedDeviceChanged

EventHandler<AudioDevice?>? VolumeControl.CoreAudio.AudioDeviceSelector.SelectedDeviceChanged

Occurs when the selected device is changed for any reason.


The documentation for this class was generated from the following file: