Volume Control
Application-specific hotkeys for Windows
|
A single audio session running on an audio device. More...
Public Member Functions | |
override string | ToString () |
Gets the ProcessIdentifier associated with this AudioSession instance. More... | |
Process? | GetProcess () |
Gets the process that created this audio session. More... | |
TargetInfo | GetTargetInfo () |
Gets a new TargetInfo object representing this AudioSession instance. More... | |
bool | HasMatchingName (string name, StringComparison stringComparison=StringComparison.Ordinal) |
Determines whether the specified name is equal to this instance's Name or ProcessName. More... | |
void | Dispose () |
Static Public Member Functions | |
static bool | TryParseProcessIdentifier (string processIdentifier, out uint? processId, out string? processName) |
Splits the given processIdentifier into its ProcessID & ProcessName components, and converts the ProcessID to an unsigned integer. More... | |
Static Public Attributes | |
const char | ProcessIdentifierSeparatorChar = ':' |
The character that separates the PID & ProcessName components of ProcessIdentifier strings. More... | |
const char | ProcessIdentifierInputChar = 'I' |
The character used in the process identifier to indicate that a session is a capture session. More... | |
const char | ProcessIdentifierOutputChar = 'O' |
The character used in the process identifier to indicate that a session is a render session. More... | |
static ? uint | processId |
Splits the given processIdentifier into its ProcessID and ProcessName components, if they exist. More... | |
Properties | |
AudioDevice | AudioDevice [get] |
Gets the CoreAudio.AudioDevice that this AudioSession instance is running on. More... | |
AudioSessionControl2 | AudioSessionControl [get] |
Gets the AudioSessionControl2 controller instance associated with this AudioSession instance. More... | |
DataFlow | DataFlow [get] |
Gets the DataFlow direction of this audio session. More... | |
uint | PID [get] |
Gets the process ID of the process associated with this AudioSession instance. More... | |
string | ProcessName [get] |
Gets the Process Name of the process associated with this AudioSession instance. More... | |
string | Name [get, set] |
Gets or sets the name of this AudioSession instance. More... | |
bool | HasCustomName [get] |
Gets whether this session has a Name that differs from its ProcessName. More... | |
string | ProcessIdentifier [get] |
Gets the process identifier of this audio session. More... | |
string | SessionIdentifier [get] |
Gets the session identifier string from the windows API. More... | |
string | SessionInstanceIdentifier [get] |
Gets the session instance identifier from the windows API. More... | |
float | NativeVolume [get, set] |
int | Volume [get, set] |
bool | Mute [get, set] |
float | PeakMeterValue [get] |
bool | IsHidden [get, set] |
Gets or sets whether this session is hidden in the AudioSessionManager. More... | |
Properties inherited from VolumeControl.CoreAudio.Interfaces.IAudioControl | |
float | NativeVolume [get, set] |
Gets or sets the volume level of the audio instance, in the native float format. More... | |
int | Volume [get, set] |
Gets or sets the volume level of the audio instance. More... | |
bool | Mute [get, set] |
Gets or sets the mute state of the audio instance. More... | |
DataFlow | DataFlow [get] |
Gets whether this audio control is a capture or render instance. More... | |
Properties inherited from VolumeControl.CoreAudio.Interfaces.IReadOnlyAudioControl | |
float | NativeVolume [get] |
Gets the volume level, in the native float format. More... | |
int | Volume [get] |
Gets the volume level. More... | |
bool | Mute [get] |
Gets the mute state. More... | |
DataFlow | DataFlow [get] |
Gets whether this audio control is a capture or render instance. More... | |
Properties inherited from VolumeControl.CoreAudio.Interfaces.IHideableAudioControl | |
bool | IsHidden [get, set] |
Gets or sets whether this audio instance is hidden. More... | |
Properties inherited from VolumeControl.CoreAudio.Interfaces.IAudioPeakMeter | |
float | PeakMeterValue [get] |
The current peak meter value. More... | |
Events | |
PropertyChangedEventHandler? | PropertyChanged |
AudioSessionControl2.? SessionDisconnectedDelegate | SessionDisconnected |
Occurs when this AudioSession instance has been disconnected. More... | |
EventHandler< AudioSessionState >? | StateChanged |
Occurs when the state of this AudioSession instance was changed. More... | |
EventHandler< string >? | DisplayNameChanged |
Occurs when the display name of this AudioSession instance has changed. More... | |
EventHandler< string >? | IconPathChanged |
Occurs when the display icon path for this AudioSession instance has changed. More... | |
VolumeChangedEventHandler? | VolumeChanged |
Occurs when the volume level or mute state of this AudioSession has changed. More... | |
A single audio session running on an audio device.
Process? VolumeControl.CoreAudio.AudioSession.GetProcess | ( | ) |
Gets the process that created this audio session.
The caller is responsible for calling Process.Dispose(bool).
null
if an error occurred.References VolumeControl.Log.FLog.Error(), and VolumeControl.CoreAudio.AudioSession.PID.
TargetInfo VolumeControl.CoreAudio.AudioSession.GetTargetInfo | ( | ) |
Gets a new TargetInfo object representing this AudioSession instance.
References VolumeControl.CoreAudio.AudioSession.PID, VolumeControl.CoreAudio.AudioSession.ProcessName, and VolumeControl.CoreAudio.AudioSession.SessionInstanceIdentifier.
bool VolumeControl.CoreAudio.AudioSession.HasMatchingName | ( | string | name, |
StringComparison | stringComparison = StringComparison.Ordinal |
||
) |
Determines whether the specified name is equal to this instance's Name or ProcessName.
Compares the specified name to the ProcessName property and also the Name property when HasCustomName is true
.
name | The Name or ProcessName of an audio session. |
stringComparison | Specifies how strings will be compared. |
true
when the specified name matches this session; otherwise false
.Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithName(), and VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSimilarProcessIdentifier().
override string VolumeControl.CoreAudio.AudioSession.ToString | ( | ) |
Gets the ProcessIdentifier associated with this AudioSession instance.
|
static |
Splits the given processIdentifier into its ProcessID & ProcessName components, and converts the ProcessID to an unsigned integer.
processIdentifier | A Process Identifier string. See ProcessIdentifier. |
processId | The ProcessID component of the processIdentifier when it contains one & the method returned true ; otherwise null . |
processName | The ProcessName component of the processIdentifier when it contains one & the method returned true ; otherwise null . |
true
when successful and no exceptions were thrown; otherwise false
.References VolumeControl.CoreAudio.AudioSession.processId.
|
static |
Splits the given processIdentifier into its ProcessID and ProcessName components, if they exist.
processIdentifier | A process identifier string. |
ArgumentNullException |
|
Referenced by VolumeControl.CoreAudio.AudioSession.TryParseProcessIdentifier().
|
static |
The character used in the process identifier to indicate that a session is a capture session.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSimilarProcessIdentifier().
|
static |
The character used in the process identifier to indicate that a session is a render session.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSimilarProcessIdentifier().
|
static |
The character that separates the PID & ProcessName components of ProcessIdentifier strings.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSimilarProcessIdentifier().
|
get |
Gets the CoreAudio.AudioDevice that this AudioSession instance is running on.
|
get |
Gets the AudioSessionControl2 controller instance associated with this AudioSession instance.
Referenced by VolumeControl.CoreAudio.AudioSession.Dispose().
|
get |
Gets the DataFlow direction of this audio session.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithName(), and VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithPID().
|
get |
Gets whether this session has a Name that differs from its ProcessName.
true
when the Name is not the same as the ProcessName; otherwise false
.
|
getset |
Gets or sets whether this session is hidden in the AudioSessionManager.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.HideSession(), and VolumeControl.CoreAudio.AudioSessionManager.UnhideSession().
|
getset |
Gets or sets the name of this AudioSession instance.
This defaults to the internal AudioSessionControl2.DisplayName if available, otherwise it defaults to the ProcessName.
|
get |
Gets the process ID of the process associated with this AudioSession instance.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithPID(), VolumeControl.CoreAudio.AudioSession.GetProcess(), and VolumeControl.CoreAudio.AudioSession.GetTargetInfo().
|
get |
Gets the process identifier of this audio session.
Process Identifiers are composed of the PID and ProcessName of a session, separated by a colon.
Example: "1234:SomeProcess"
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithExactProcessIdentifier().
|
get |
Gets the Process Name of the process associated with this AudioSession instance.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithProcessName(), and VolumeControl.CoreAudio.AudioSession.GetTargetInfo().
|
get |
Gets the session identifier string from the windows API.
Processes that create multiple audio sessions will create multiple AudioSession instances with identical SessionIdentifier strings. For an identifier that is unique across all audio sessions, use SessionInstanceIdentifier or ProcessIdentifier instead.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSessionIdentifier().
|
get |
Gets the session instance identifier from the windows API.
Unlike the SessionIdentifier, each SessionInstanceIdentifier is guaranteed to be unique to this AudioSession instance.
Referenced by VolumeControl.CoreAudio.AudioSessionManager.FindSessionWithSessionInstanceIdentifier(), and VolumeControl.CoreAudio.AudioSession.GetTargetInfo().
EventHandler<string>? VolumeControl.CoreAudio.AudioSession.DisplayNameChanged |
Occurs when the display name of this AudioSession instance has changed.
EventHandler<string>? VolumeControl.CoreAudio.AudioSession.IconPathChanged |
Occurs when the display icon path for this AudioSession instance has changed.
AudioSessionControl2.? SessionDisconnectedDelegate VolumeControl.CoreAudio.AudioSession.SessionDisconnected |
Occurs when this AudioSession instance has been disconnected.
EventHandler<AudioSessionState>? VolumeControl.CoreAudio.AudioSession.StateChanged |
Occurs when the state of this AudioSession instance was changed.
VolumeChangedEventHandler? VolumeControl.CoreAudio.AudioSession.VolumeChanged |
Occurs when the volume level or mute state of this AudioSession has changed.