Volume Control
Application-specific hotkeys for Windows
|
Manages a list of AudioSession instances and their related events for any number of AudioDeviceSessionManager instances. More...
Public Member Functions | |
AudioSessionManager () | |
Creates a new AudioSessionManager instance without any SessionManagers. More... | |
AudioSessionManager (IEnumerable< AudioDeviceSessionManager > sessionManagers) | |
Creates a new AudioSessionManager instance with the given sessionManagers . More... | |
AudioSession? | FindSession (Func< AudioSession, bool > predicate, bool includeHiddenSessions=false) |
Finds an audio session using a predicate function. More... | |
AudioSession? | FindSessionWithPID (uint processId, DataFlow? dataFlow, bool includeHiddenSessions=false) |
Finds the audio session whose owning process has the given processId . More... | |
AudioSession? | FindSessionWithPID (uint processId, bool includeHiddenSessions=false) |
Finds the audio session whose owning process has the given processId . More... | |
AudioSession? | FindSessionWithProcessName (string processName, StringComparison stringComparison=StringComparison.Ordinal, bool includeHiddenSessions=false) |
Finds the audio session whose owning process has the given processName . More... | |
AudioSession? | FindSessionWithName (string sessionName, DataFlow? dataFlow, StringComparison stringComparison=StringComparison.Ordinal, bool includeHiddenSessions=false) |
Finds the audio session whose owning process has the given sessionName . More... | |
AudioSession? | FindSessionWithName (string sessionName, StringComparison stringComparison=StringComparison.Ordinal, bool includeHiddenSessions=false) |
Finds the audio session whose owning process has the given sessionName . More... | |
AudioSession? | FindSessionWithExactProcessIdentifier (string processIdentifier, StringComparison stringComparison=StringComparison.Ordinal, bool includeHiddenSessions=false) |
Finds the audio session with the given processIdentifier . More... | |
AudioSession? | FindSessionWithSimilarProcessIdentifier (string processIdentifier, StringComparison stringComparison=StringComparison.OrdinalIgnoreCase, bool includeHiddenSessions=false) |
Finds the audio session that matches - or is very similar to - the given processIdentifier . More... | |
AudioSession? | FindSessionWithSessionIdentifier (string sessionIdentifier, StringComparison stringComparison=StringComparison.Ordinal, bool includeHiddenSessions=false) |
Finds the first audio session with the specified sessionIdentifier . More... | |
AudioSession? | FindSessionWithSessionInstanceIdentifier (string sessionInstanceIdentifier, StringComparison stringComparison=StringComparison.Ordinal, bool includeHiddenSessions=false) |
Finds the audio session with the specified sessionInstanceIdentifier . More... | |
bool | AddSessionManager (AudioDeviceSessionManager sessionManager) |
Adds the given sessionManager to the SessionManagers list. More... | |
bool | RemoveSessionManager (AudioDeviceSessionManager sessionManager) |
Removes the given sessionManager from the SessionManagers list. More... | |
void | HideSession (AudioSession session) |
Hides the specified session by moving it from the Sessions list to the HiddenSessions list. More... | |
void | UnhideSession (AudioSession session) |
Unhides the specified session by moving it from the HiddenSessions list to the Sessions list. More... | |
void | Dispose () |
Properties | |
IReadOnlyList< AudioDeviceSessionManager > | SessionManagers [get] |
Gets the list of AudioDeviceSessionManager instances currently being managed by this AudioSessionManager instance. More... | |
IReadOnlyList< AudioSession > | Sessions [get] |
Gets the list of AudioSession instances currently being managed by this AudioSessionManager instance. More... | |
IReadOnlyList< AudioSession > | HiddenSessions [get] |
Gets the list of hidden AudioSession instances (AudioSession.IsHidden) currently being managed by this AudioSessionManager instance. More... | |
Events | |
PreviewSessionNameEventHandler? | PreviewSessionName |
Occurs before an AudioSession is added to the Sessions list to get its initial name. More... | |
PreviewSessionIsHiddenEventHandler? | PreviewSessionIsHidden |
Occurs before an AudioSession is added to the Sessions list to get its initial hidden state. More... | |
EventHandler< AudioSession >? | AddingSessionToList |
Occurs prior to an AudioSession being added to the Sessions list for any reason. More... | |
EventHandler< AudioSession >? | AddedSessionToList |
Occurs when an AudioSession is added to the Sessions list for any reason. More... | |
EventHandler< AudioSession >? | RemovingSessionFromList |
Occurs prior to an AudioSession being removed from the Sessions list for any reason. More... | |
EventHandler< AudioSession >? | RemovedSessionFromList |
Occurs when an AudioSession is removed from the Sessions list for any reason. More... | |
EventHandler< AudioSession >? | AddingSessionToHiddenList |
Occurs prior to an AudioSession being added to the HiddenSessions list for any reason. More... | |
EventHandler< AudioSession >? | AddedSessionToHiddenList |
Occurs when an AudioSession is added to the HiddenSessions list for any reason. More... | |
EventHandler< AudioSession >? | RemovingSessionFromHiddenList |
Occurs prior to an AudioSession being removed from the HiddenSessions list for any reason. More... | |
EventHandler< AudioSession >? | RemovedSessionFromHiddenList |
Occurs when an AudioSession is removed from the HiddenSessions list for any reason. More... | |
EventHandler< AudioDeviceSessionManager >? | SessionManagerAddedToList |
Occurs when an AudioDeviceSessionManager is added to the SessionManagers list for any reason. More... | |
EventHandler< AudioDeviceSessionManager >? | SessionManagerRemovedFromList |
Occurs when an AudioDeviceSessionManager is removed from the SessionManagers list for any reason. More... | |
Manages a list of AudioSession instances and their related events for any number of AudioDeviceSessionManager instances.
AudioDeviceSessionManager instances can be retrieved from AudioDevice.SessionManager
VolumeControl.CoreAudio.AudioSessionManager.AudioSessionManager | ( | ) |
Creates a new AudioSessionManager instance without any SessionManagers.
VolumeControl.CoreAudio.AudioSessionManager.AudioSessionManager | ( | IEnumerable< AudioDeviceSessionManager > | sessionManagers | ) |
Creates a new AudioSessionManager instance with the given sessionManagers .
sessionManagers | Any number of AudioDeviceSessionManager instances to add to the SessionManagers list. |
References VolumeControl.CoreAudio.AudioSessionManager.AddSessionManager().
bool VolumeControl.CoreAudio.AudioSessionManager.AddSessionManager | ( | AudioDeviceSessionManager | sessionManager | ) |
Adds the given sessionManager to the SessionManagers list.
sessionManager | A AudioDeviceSessionManager instance to add. |
true
when successful; otherwise false
if the sessionManager is already in the list.References VolumeControl.CoreAudio.AudioDeviceSessionManager.SessionAddedToList, VolumeControl.CoreAudio.AudioSessionManager.SessionManagers, and VolumeControl.CoreAudio.AudioDeviceSessionManager.SessionRemovedFromList.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.AudioSessionManager().
AudioSession? VolumeControl.CoreAudio.AudioSessionManager.FindSession | ( | Func< AudioSession, bool > | predicate, |
bool | includeHiddenSessions = false |
||
) |
Finds an audio session using a predicate function.
predicate | A predicate delegate that accepts an AudioSession and returns true to indicate a match or false to continue. |
includeHiddenSessions | When true , also searches the hidden sessions; otherwise when false , only searches through visible sessions. |
true
for; otherwise null
.AudioSession? VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithExactProcessIdentifier | ( | string | processIdentifier, |
StringComparison | stringComparison = StringComparison.Ordinal , |
||
bool | includeHiddenSessions = false |
||
) |
Finds the audio session with the given processIdentifier .
processIdentifier | A Process Identifier to search for. See AudioSession.ProcessIdentifier. |
stringComparison | The StringComparison type to use when comparing process identifier strings. |
includeHiddenSessions | When true , also searches the hidden sessions; otherwise when false , only searches through visible sessions. |
null
.References VolumeControl.CoreAudio.AudioSessionManager.HiddenSessions, VolumeControl.CoreAudio.AudioSession.ProcessIdentifier, and VolumeControl.CoreAudio.AudioSessionManager.Sessions.
AudioSession? VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithName | ( | string | sessionName, |
DataFlow? | dataFlow, | ||
StringComparison | stringComparison = StringComparison.Ordinal , |
||
bool | includeHiddenSessions = false |
||
) |
Finds the audio session whose owning process has the given sessionName .
sessionName | A Name or Process Name to search for. See AudioSession.Name & AudioSession.ProcessName. |
dataFlow | The data flow type of the session to search for. |
stringComparison | The StringComparison type to use when comparing process name strings. |
includeHiddenSessions | When true , also searches the hidden sessions; otherwise when false , only searches through visible sessions. |
null
.References VolumeControl.CoreAudio.AudioSession.DataFlow, VolumeControl.CoreAudio.AudioSession.HasMatchingName(), VolumeControl.CoreAudio.AudioSessionManager.HiddenSessions, and VolumeControl.CoreAudio.AudioSessionManager.Sessions.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSimilarProcessIdentifier().
AudioSession? VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithName | ( | string | sessionName, |
StringComparison | stringComparison = StringComparison.Ordinal , |
||
bool | includeHiddenSessions = false |
||
) |
Finds the audio session whose owning process has the given sessionName .
sessionName | A Name or Process Name to search for. See AudioSession.Name & AudioSession.ProcessName. |
stringComparison | The StringComparison type to use when comparing process name strings. |
includeHiddenSessions | When true , also searches the hidden sessions; otherwise when false , only searches through visible sessions. |
null
.References VolumeControl.CoreAudio.AudioSession.HasMatchingName(), VolumeControl.CoreAudio.AudioSessionManager.HiddenSessions, and VolumeControl.CoreAudio.AudioSessionManager.Sessions.
AudioSession? VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithPID | ( | uint | processId, |
bool | includeHiddenSessions = false |
||
) |
Finds the audio session whose owning process has the given processId .
processId | A Process ID to search for. See AudioSession.PID. |
includeHiddenSessions | When true , also searches the hidden sessions; otherwise when false , only searches through visible sessions. |
null
.References VolumeControl.CoreAudio.AudioSessionManager.HiddenSessions, VolumeControl.CoreAudio.AudioSession.PID, and VolumeControl.CoreAudio.AudioSessionManager.Sessions.
AudioSession? VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithPID | ( | uint | processId, |
DataFlow? | dataFlow, | ||
bool | includeHiddenSessions = false |
||
) |
Finds the audio session whose owning process has the given processId .
processId | A Process ID to search for. See AudioSession.PID. |
dataFlow | The data flow type of the session to search for. |
includeHiddenSessions | When true , also searches the hidden sessions; otherwise when false , only searches through visible sessions. |
null
.References VolumeControl.CoreAudio.AudioSession.DataFlow, VolumeControl.CoreAudio.AudioSessionManager.HiddenSessions, VolumeControl.CoreAudio.AudioSession.PID, and VolumeControl.CoreAudio.AudioSessionManager.Sessions.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSimilarProcessIdentifier().
AudioSession? VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithProcessName | ( | string | processName, |
StringComparison | stringComparison = StringComparison.Ordinal , |
||
bool | includeHiddenSessions = false |
||
) |
Finds the audio session whose owning process has the given processName .
Note that this method checks ONLY the AudioSession.ProcessName property, which can differ from the name shown in the UI (AudioSession.Name)!
To check both properties, use FindSessionWithName(string, StringComparison, bool) instead.
processName | A Process Name to search for. See AudioSession.ProcessName. |
stringComparison | The StringComparison type to use when comparing process name strings. |
includeHiddenSessions | When true , also searches the hidden sessions; otherwise when false , only searches through visible sessions. |
null
.References VolumeControl.CoreAudio.AudioSessionManager.HiddenSessions, VolumeControl.CoreAudio.AudioSession.ProcessName, and VolumeControl.CoreAudio.AudioSessionManager.Sessions.
AudioSession? VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSessionIdentifier | ( | string | sessionIdentifier, |
StringComparison | stringComparison = StringComparison.Ordinal , |
||
bool | includeHiddenSessions = false |
||
) |
Finds the first audio session with the specified sessionIdentifier .
sessionIdentifier | A SessionIdentifier string to search for. See AudioSession.SessionIdentifier. |
stringComparison | The StringComparison type to use when comparing session identifier strings. |
includeHiddenSessions | When true , also searches the hidden sessions; otherwise when false , only searches through visible sessions. |
null
.References VolumeControl.CoreAudio.AudioSessionManager.HiddenSessions, VolumeControl.CoreAudio.AudioSession.SessionIdentifier, and VolumeControl.CoreAudio.AudioSessionManager.Sessions.
AudioSession? VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSessionInstanceIdentifier | ( | string | sessionInstanceIdentifier, |
StringComparison | stringComparison = StringComparison.Ordinal , |
||
bool | includeHiddenSessions = false |
||
) |
Finds the audio session with the specified sessionInstanceIdentifier .
sessionInstanceIdentifier | A SessionInstanceIdentifier to search for. See AudioSession.SessionInstanceIdentifier. |
stringComparison | The StringComparison type to use when comparing session instance identifier strings. |
includeHiddenSessions | When true , also searches the hidden sessions; otherwise when false , only searches through visible sessions. |
null
.References VolumeControl.CoreAudio.AudioSessionManager.HiddenSessions, VolumeControl.CoreAudio.AudioSession.SessionInstanceIdentifier, and VolumeControl.CoreAudio.AudioSessionManager.Sessions.
AudioSession? VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSimilarProcessIdentifier | ( | string | processIdentifier, |
StringComparison | stringComparison = StringComparison.OrdinalIgnoreCase , |
||
bool | includeHiddenSessions = false |
||
) |
Finds the audio session that matches - or is very similar to - the given processIdentifier .
When searching for text entered by the user, this method should always be used over the other FindSession... methods.
processIdentifier | A ProcessIdentifier to search for. See AudioSession.ProcessIdentifier. Supports partial identifiers that only include the PID or ProcessName component, with or without the separator character. |
stringComparison | The StringComparison type to use when comparing strings. |
includeHiddenSessions | When true , also searches the hidden sessions; otherwise when false , only searches through visible sessions. |
null
. References VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithName(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithPID(), VolumeControl.CoreAudio.AudioSession.HasMatchingName(), VolumeControl.CoreAudio.AudioSession.ProcessIdentifierInputChar, VolumeControl.CoreAudio.AudioSession.ProcessIdentifierOutputChar, and VolumeControl.CoreAudio.AudioSession.ProcessIdentifierSeparatorChar.
void VolumeControl.CoreAudio.AudioSessionManager.HideSession | ( | AudioSession | session | ) |
Hides the specified session by moving it from the Sessions list to the HiddenSessions list.
session | The AudioSession instance to hide. |
References VolumeControl.CoreAudio.AudioSession.IsHidden.
bool VolumeControl.CoreAudio.AudioSessionManager.RemoveSessionManager | ( | AudioDeviceSessionManager | sessionManager | ) |
Removes the given sessionManager from the SessionManagers list.
sessionManager | A AudioDeviceSessionManager instance to remove. |
true
when successful; otherwise false
when the sessionManager wasn't in the list.References VolumeControl.CoreAudio.AudioDeviceSessionManager.SessionAddedToList, VolumeControl.CoreAudio.AudioSessionManager.SessionManagers, and VolumeControl.CoreAudio.AudioDeviceSessionManager.SessionRemovedFromList.
void VolumeControl.CoreAudio.AudioSessionManager.UnhideSession | ( | AudioSession | session | ) |
Unhides the specified session by moving it from the HiddenSessions list to the Sessions list.
session |
References VolumeControl.CoreAudio.AudioSession.IsHidden.
|
get |
Gets the list of hidden AudioSession instances (AudioSession.IsHidden) currently being managed by this AudioSessionManager instance.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.Dispose(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithExactProcessIdentifier(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithName(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithPID(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithProcessName(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSessionIdentifier(), and VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSessionInstanceIdentifier().
|
get |
Gets the list of AudioDeviceSessionManager instances currently being managed by this AudioSessionManager instance.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.AddSessionManager(), VolumeControl.CoreAudio.AudioSessionManager.Dispose(), and VolumeControl.CoreAudio.AudioSessionManager.RemoveSessionManager().
|
get |
Gets the list of AudioSession instances currently being managed by this AudioSessionManager instance.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.Dispose(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithExactProcessIdentifier(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithName(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithPID(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithProcessName(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSessionIdentifier(), VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSessionInstanceIdentifier(), VolumeControl.CoreAudio.AudioSessionSelector.SelectNextSession(), and VolumeControl.CoreAudio.AudioSessionSelector.SelectPreviousSession().
EventHandler<AudioSession>? VolumeControl.CoreAudio.AudioSessionManager.AddedSessionToHiddenList |
Occurs when an AudioSession is added to the HiddenSessions list for any reason.
EventHandler<AudioSession>? VolumeControl.CoreAudio.AudioSessionManager.AddedSessionToList |
Occurs when an AudioSession is added to the Sessions list for any reason.
Referenced by VolumeControl.CoreAudio.AudioSessionMultiSelector.AudioSessionMultiSelector().
EventHandler<AudioSession>? VolumeControl.CoreAudio.AudioSessionManager.AddingSessionToHiddenList |
Occurs prior to an AudioSession being added to the HiddenSessions list for any reason.
EventHandler<AudioSession>? VolumeControl.CoreAudio.AudioSessionManager.AddingSessionToList |
Occurs prior to an AudioSession being added to the Sessions list for any reason.
PreviewSessionIsHiddenEventHandler? VolumeControl.CoreAudio.AudioSessionManager.PreviewSessionIsHidden |
Occurs before an AudioSession is added to the Sessions list to get its initial hidden state.
This allows handler methods to set whether the audio session is hidden by default.
PreviewSessionNameEventHandler? VolumeControl.CoreAudio.AudioSessionManager.PreviewSessionName |
Occurs before an AudioSession is added to the Sessions list to get its initial name.
This allows the name of the audio session to be changed by setting the PreviewSessionNameEventArgs.SessionName property in a handler method.
EventHandler<AudioSession>? VolumeControl.CoreAudio.AudioSessionManager.RemovedSessionFromHiddenList |
Occurs when an AudioSession is removed from the HiddenSessions list for any reason.
EventHandler<AudioSession>? VolumeControl.CoreAudio.AudioSessionManager.RemovedSessionFromList |
Occurs when an AudioSession is removed from the Sessions list for any reason.
Referenced by VolumeControl.CoreAudio.AudioSessionSelector.AudioSessionSelector().
EventHandler<AudioSession>? VolumeControl.CoreAudio.AudioSessionManager.RemovingSessionFromHiddenList |
Occurs prior to an AudioSession being removed from the HiddenSessions list for any reason.
EventHandler<AudioSession>? VolumeControl.CoreAudio.AudioSessionManager.RemovingSessionFromList |
Occurs prior to an AudioSession being removed from the Sessions list for any reason.
Referenced by VolumeControl.CoreAudio.AudioSessionMultiSelector.AudioSessionMultiSelector().
EventHandler<AudioDeviceSessionManager>? VolumeControl.CoreAudio.AudioSessionManager.SessionManagerAddedToList |
Occurs when an AudioDeviceSessionManager is added to the SessionManagers list for any reason.
EventHandler<AudioDeviceSessionManager>? VolumeControl.CoreAudio.AudioSessionManager.SessionManagerRemovedFromList |
Occurs when an AudioDeviceSessionManager is removed from the SessionManagers list for any reason.