diff --git a/SoundSwitch.Common/Framework/Audio/Device/DeviceFullInfo.cs b/SoundSwitch.Common/Framework/Audio/Device/DeviceFullInfo.cs index a0112b0c1e..535683b416 100644 --- a/SoundSwitch.Common/Framework/Audio/Device/DeviceFullInfo.cs +++ b/SoundSwitch.Common/Framework/Audio/Device/DeviceFullInfo.cs @@ -13,6 +13,8 @@ public class DeviceFullInfo : DeviceInfo public System.Drawing.Icon LargeIcon => AudioDeviceIconExtractor.ExtractIconFromPath(IconPath, Type, true); public System.Drawing.Icon SmallIcon => AudioDeviceIconExtractor.ExtractIconFromPath(IconPath, Type, false); + public int Volume { get; } = 0; + [JsonConstructor] public DeviceFullInfo(string name, string id, DataFlow type, string iconPath, DeviceState state, bool isUsb) : base(name, id, type, isUsb, DateTime.UtcNow) { @@ -24,6 +26,14 @@ public DeviceFullInfo(MMDevice device) : base(device) { IconPath = device.IconPath; State = device.State; + try + { + Volume = (int)(device.AudioEndpointVolume.MasterVolumeLevelScalar * 100); + } + catch + { + //Ignored + } } } } \ No newline at end of file diff --git a/SoundSwitch/Framework/TrayIcon/TooltipInfoManager/TootipInfo/TooltipInfoPlayback.cs b/SoundSwitch/Framework/TrayIcon/TooltipInfoManager/TootipInfo/TooltipInfoPlayback.cs index 1181bd4d09..a92eeb0f63 100644 --- a/SoundSwitch/Framework/TrayIcon/TooltipInfoManager/TootipInfo/TooltipInfoPlayback.cs +++ b/SoundSwitch/Framework/TrayIcon/TooltipInfoManager/TootipInfo/TooltipInfoPlayback.cs @@ -32,7 +32,7 @@ public string TextToDisplay() var playbackDefaultDevice = AudioSwitcher.Instance.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eConsole); return playbackDefaultDevice == null ? null - : string.Format(SettingsStrings.activePlayback, playbackDefaultDevice.NameClean); + : string.Format(SettingsStrings.activePlayback + " - {1}%", playbackDefaultDevice.NameClean, playbackDefaultDevice.Volume); } public override string ToString() diff --git a/SoundSwitch/Framework/TrayIcon/TooltipInfoManager/TootipInfo/TooltipInfoRecording.cs b/SoundSwitch/Framework/TrayIcon/TooltipInfoManager/TootipInfo/TooltipInfoRecording.cs index b4efa17abb..85cd8d9cf1 100644 --- a/SoundSwitch/Framework/TrayIcon/TooltipInfoManager/TootipInfo/TooltipInfoRecording.cs +++ b/SoundSwitch/Framework/TrayIcon/TooltipInfoManager/TootipInfo/TooltipInfoRecording.cs @@ -32,7 +32,7 @@ public string TextToDisplay() var recordingDevice = AudioSwitcher.Instance.GetDefaultAudioEndpoint(EDataFlow.eCapture, ERole.eConsole); return recordingDevice == null ? null - : string.Format(SettingsStrings.activeRecording, recordingDevice.NameClean); + : string.Format(SettingsStrings.activePlayback + " - {1}%", recordingDevice.NameClean, recordingDevice.Volume); } public override string ToString()