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

Manages multiple "selected" audio sessions for a given CoreAudio.AudioSessionManager instance. More...

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

Public Member Functions

 AudioSessionMultiSelector (AudioSessionManager audioSessionManager)
 Creates a new AudioSessionMultiSelector instance for the specified audioSessionManager . More...
 
bool GetSessionIsSelected (AudioSession audioSession)
 Gets whether the specified audioSession is selected or not. More...
 
void SetSessionIsSelected (AudioSession audioSession, bool isSelected)
 Sets whether the specified audioSession is selected or not. More...
 
void SetSessionIsSelected (int index, bool isSelected)
 Sets whether the AudioSession at the specified index is selected or not. More...
 
void SetAllSessionSelectionStates (bool isSelected)
 Sets whether all AudioSession instances in the Sessions list are selected or not. More...
 
void SetSelectedSessions (params AudioSession[] sessions)
 Sets only the specified sessions as selected. More...
 
void SetSelectedSessions (IEnumerable< AudioSession > sessions)
 
void SetSelectedSessionsOrCurrentSession (params AudioSession[] sessions)
 Sets only the specified sessions as selected, unless sessions contains exactly 1 session in which case the CurrentSession is set and all sessions are deselected. More...
 
void SetSelectedSessionsOrCurrentSession (IEnumerable< AudioSession > sessions)
 
void ClearSelectedSessions ()
 Unselects all SelectedSessions. More...
 
void SelectCurrentItem ()
 Selects the CurrentItem. More...
 
void DeselectCurrentItem ()
 Deselects the CurrentItem. More...
 
void ToggleSelectCurrentItem ()
 Toggles whether the CurrentItem is selected. More...
 
void IncrementCurrentIndex ()
 Increments the CurrentIndex by 1, looping back around to 0 when it exceeds the length of the Sessions list. More...
 
void DecrementCurrentIndex ()
 Decrements the CurrentIndex by 1, looping back around to the length of the Sessions list when it goes past 0. More...
 
void UnsetCurrentIndex ()
 Sets the CurrentIndex to 0. More...
 

Properties

IReadOnlyList< bool > SelectionStates [get, set]
 
IReadOnlyList< AudioSessionSelectedSessions [get, set]
 Gets or sets the list of selected AudioSession instances. More...
 
bool HasSelectedSessions [get]
 Gets whether there are any selected sessions or not. More...
 
int? CurrentIndex [get, set]
 
bool LockCurrentIndex [get, set]
 
AudioSession?? CurrentSession [get, set]
 Gets or sets the session that the selector is currently pointing at. More...
 
bool LockSelection [get, set]
 
bool LockCurrentIndexOnLockSelection [get, set]
 Gets or sets whether the LockCurrentIndex property is also set when LockSelection is changed. More...
 
- Properties inherited from VolumeControl.CoreAudio.Interfaces.IAudioMultiSelector
IReadOnlyList< bool > SelectionStates [get, set]
 Gets or sets the selection state of each AudioSession instance in the Sessions list. More...
 
int CurrentIndex [get, set]
 Gets or sets the current index of the selector in the Sessions list. More...
 
bool LockCurrentIndex [get, set]
 Gets or sets whether the CurrentIndex can be changed. More...
 
bool LockSelection [get, set]
 Gets or sets whether the selected items can be changed. More...
 

Events

PropertyChangedEventHandler? PropertyChanged
 
EventHandler< AudioSession >? SessionSelected
 Occurs when a session is selected for any reason. More...
 
EventHandler< AudioSession >? SessionDeselected
 Occurs when a session is deselected for any reason. More...
 
EventHandler< AudioSession?>? CurrentSessionChanged
 Occurs when the CurrentItem is changed for any reason. More...
 
PreviewSessionIsSelectedEventHandler? PreviewSessionIsSelected
 Occurs prior to a new session being added, allowing handlers to determine if it should be selected by default. More...
 

Detailed Description

Manages multiple "selected" audio sessions for a given CoreAudio.AudioSessionManager instance.

Constructor & Destructor Documentation

◆ AudioSessionMultiSelector()

VolumeControl.CoreAudio.AudioSessionMultiSelector.AudioSessionMultiSelector ( AudioSessionManager  audioSessionManager)

Member Function Documentation

◆ ClearSelectedSessions()

void VolumeControl.CoreAudio.AudioSessionMultiSelector.ClearSelectedSessions ( )

Unselects all SelectedSessions.

◆ DecrementCurrentIndex()

void VolumeControl.CoreAudio.AudioSessionMultiSelector.DecrementCurrentIndex ( )

Decrements the CurrentIndex by 1, looping back around to the length of the Sessions list when it goes past 0.

Does nothing when LockCurrentIndex is true.

References VolumeControl.CoreAudio.AudioSessionMultiSelector.CurrentIndex, VolumeControl.CoreAudio.AudioSessionMultiSelector.LockCurrentIndex, and VolumeControl.CoreAudio.AudioSessionMultiSelector.SelectionStates.

◆ DeselectCurrentItem()

void VolumeControl.CoreAudio.AudioSessionMultiSelector.DeselectCurrentItem ( )

◆ GetSessionIsSelected()

bool VolumeControl.CoreAudio.AudioSessionMultiSelector.GetSessionIsSelected ( AudioSession  audioSession)

Gets whether the specified audioSession is selected or not.

Parameters
audioSessionAn AudioSession instance.
Returns
true when the audioSession is selected; otherwise false.
Exceptions
ArgumentExceptionThe specified audioSession does not exist in the AudioSessionManager.

References VolumeControl.CoreAudio.AudioSessionMultiSelector.SelectionStates.

◆ IncrementCurrentIndex()

void VolumeControl.CoreAudio.AudioSessionMultiSelector.IncrementCurrentIndex ( )

Increments the CurrentIndex by 1, looping back around to 0 when it exceeds the length of the Sessions list.

Does nothing when LockCurrentIndex is true.

References VolumeControl.CoreAudio.AudioSessionMultiSelector.CurrentIndex, VolumeControl.CoreAudio.AudioSessionMultiSelector.LockCurrentIndex, and VolumeControl.CoreAudio.AudioSessionMultiSelector.SelectionStates.

◆ SelectCurrentItem()

void VolumeControl.CoreAudio.AudioSessionMultiSelector.SelectCurrentItem ( )

◆ SetAllSessionSelectionStates()

void VolumeControl.CoreAudio.AudioSessionMultiSelector.SetAllSessionSelectionStates ( bool  isSelected)

Sets whether all AudioSession instances in the Sessions list are selected or not.

Parameters
isSelectedtrue selects the sessions; false deselects the sessions.

References VolumeControl.CoreAudio.AudioSessionMultiSelector.SelectionStates, and VolumeControl.CoreAudio.AudioSessionMultiSelector.SetSessionIsSelected().

Referenced by VolumeControl.CoreAudio.AudioSessionMultiSelector.SetSelectedSessionsOrCurrentSession().

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

◆ SetSelectedSessions()

void VolumeControl.CoreAudio.AudioSessionMultiSelector.SetSelectedSessions ( params AudioSession[]  sessions)

Sets only the specified sessions as selected.

Parameters
sessionsAny number of audio sessions.

References VolumeControl.CoreAudio.AudioSessionMultiSelector.SelectionStates, and VolumeControl.CoreAudio.AudioSessionMultiSelector.SetSessionIsSelected().

Referenced by VolumeControl.CoreAudio.AudioSessionMultiSelector.SetSelectedSessionsOrCurrentSession().

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

◆ SetSelectedSessionsOrCurrentSession()

void VolumeControl.CoreAudio.AudioSessionMultiSelector.SetSelectedSessionsOrCurrentSession ( params AudioSession[]  sessions)

Sets only the specified sessions as selected, unless sessions contains exactly 1 session in which case the CurrentSession is set and all sessions are deselected.

Parameters
sessionsAny number of audio sessions.

References VolumeControl.CoreAudio.AudioSessionMultiSelector.CurrentSession, VolumeControl.CoreAudio.AudioSessionMultiSelector.SetAllSessionSelectionStates(), and VolumeControl.CoreAudio.AudioSessionMultiSelector.SetSelectedSessions().

Here is the call graph for this function:

◆ SetSessionIsSelected() [1/2]

void VolumeControl.CoreAudio.AudioSessionMultiSelector.SetSessionIsSelected ( AudioSession  audioSession,
bool  isSelected 
)

Sets whether the specified audioSession is selected or not.

Parameters
audioSessionAn AudioSession instance.
isSelectedtrue selects the audioSession ; false deselects the audioSession .
Exceptions
ArgumentExceptionThe specified audioSession does not exist in the AudioSessionManager.

Referenced by VolumeControl.CoreAudio.AudioSessionMultiSelector.SetAllSessionSelectionStates(), and VolumeControl.CoreAudio.AudioSessionMultiSelector.SetSelectedSessions().

Here is the caller graph for this function:

◆ SetSessionIsSelected() [2/2]

void VolumeControl.CoreAudio.AudioSessionMultiSelector.SetSessionIsSelected ( int  index,
bool  isSelected 
)

Sets whether the AudioSession at the specified index is selected or not.

Parameters
indexThe zero-based index of the AudioSession instance to (de)select.
isSelectedtrue selects the session; false deselects the session.
Exceptions
ArgumentOutOfRangeExceptionThe specified index is out-of-range of the Sessions list.

◆ ToggleSelectCurrentItem()

void VolumeControl.CoreAudio.AudioSessionMultiSelector.ToggleSelectCurrentItem ( )

◆ UnsetCurrentIndex()

void VolumeControl.CoreAudio.AudioSessionMultiSelector.UnsetCurrentIndex ( )

Property Documentation

◆ CurrentSession

◆ HasSelectedSessions

bool VolumeControl.CoreAudio.AudioSessionMultiSelector.HasSelectedSessions
get

Gets whether there are any selected sessions or not.

Returns
true when there is at least one selected session; otherwise false.

◆ LockCurrentIndexOnLockSelection

bool VolumeControl.CoreAudio.AudioSessionMultiSelector.LockCurrentIndexOnLockSelection
getset

Gets or sets whether the LockCurrentIndex property is also set when LockSelection is changed.

◆ SelectedSessions

IReadOnlyList<AudioSession> VolumeControl.CoreAudio.AudioSessionMultiSelector.SelectedSessions
getset

Gets or sets the list of selected AudioSession instances.

Returns
An array of all selected AudioSessions in the order that they appear in the Sessions list.

Event Documentation

◆ CurrentSessionChanged

EventHandler<AudioSession?>? VolumeControl.CoreAudio.AudioSessionMultiSelector.CurrentSessionChanged

Occurs when the CurrentItem is changed for any reason.

◆ PreviewSessionIsSelected

PreviewSessionIsSelectedEventHandler? VolumeControl.CoreAudio.AudioSessionMultiSelector.PreviewSessionIsSelected

Occurs prior to a new session being added, allowing handlers to determine if it should be selected by default.

◆ SessionDeselected

EventHandler<AudioSession>? VolumeControl.CoreAudio.AudioSessionMultiSelector.SessionDeselected

Occurs when a session is deselected for any reason.

◆ SessionSelected

EventHandler<AudioSession>? VolumeControl.CoreAudio.AudioSessionMultiSelector.SessionSelected

Occurs when a session is selected for any reason.


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