From e5d8cbe0aaae1056c68cd099c9d9e5a7720828a2 Mon Sep 17 00:00:00 2001 From: EonaCat Date: Wed, 23 Jul 2025 20:36:42 +0200 Subject: [PATCH] Updated README.md --- EonaCat.VolumeMixer.Tester.WPF/App.xaml.cs | 2 ++ .../AssemblyInfo.cs | 3 +++ .../Converter/VolumeToPercentageConverter.cs | 2 ++ .../MainWindow.xaml.cs | 2 ++ README.md | 20 +++++++++++++++++-- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/EonaCat.VolumeMixer.Tester.WPF/App.xaml.cs b/EonaCat.VolumeMixer.Tester.WPF/App.xaml.cs index 0c89563..5dfee8f 100644 --- a/EonaCat.VolumeMixer.Tester.WPF/App.xaml.cs +++ b/EonaCat.VolumeMixer.Tester.WPF/App.xaml.cs @@ -4,6 +4,8 @@ using System.Windows; namespace EonaCat.VolumeMixer.Tester.WPF { + // This file is part of the EonaCat project(s) which is released under the Apache License. + // See the LICENSE file or go to https://EonaCat.com/License for full license details. /// /// Interaction logic for App.xaml /// diff --git a/EonaCat.VolumeMixer.Tester.WPF/AssemblyInfo.cs b/EonaCat.VolumeMixer.Tester.WPF/AssemblyInfo.cs index b0ec827..af9c10e 100644 --- a/EonaCat.VolumeMixer.Tester.WPF/AssemblyInfo.cs +++ b/EonaCat.VolumeMixer.Tester.WPF/AssemblyInfo.cs @@ -1,5 +1,8 @@ using System.Windows; +// This file is part of the EonaCat project(s) which is released under the Apache License. +// See the LICENSE file or go to https://EonaCat.com/License for full license details. + [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, diff --git a/EonaCat.VolumeMixer.Tester.WPF/Converter/VolumeToPercentageConverter.cs b/EonaCat.VolumeMixer.Tester.WPF/Converter/VolumeToPercentageConverter.cs index 3c1a2b8..89dfd7a 100644 --- a/EonaCat.VolumeMixer.Tester.WPF/Converter/VolumeToPercentageConverter.cs +++ b/EonaCat.VolumeMixer.Tester.WPF/Converter/VolumeToPercentageConverter.cs @@ -3,6 +3,8 @@ using System.Windows.Data; namespace EonaCat.VolumeMixer.Tester.WPF.Converter { + // This file is part of the EonaCat project(s) which is released under the Apache License. + // See the LICENSE file or go to https://EonaCat.com/License for full license details. public class VolumeToPercentageConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/EonaCat.VolumeMixer.Tester.WPF/MainWindow.xaml.cs b/EonaCat.VolumeMixer.Tester.WPF/MainWindow.xaml.cs index 16170b1..17291eb 100644 --- a/EonaCat.VolumeMixer.Tester.WPF/MainWindow.xaml.cs +++ b/EonaCat.VolumeMixer.Tester.WPF/MainWindow.xaml.cs @@ -10,6 +10,8 @@ using System.Windows.Threading; namespace EonaCat.VolumeMixer.Tester.WPF { + // This file is part of the EonaCat project(s) which is released under the Apache License. + // See the LICENSE file or go to https://EonaCat.com/License for full license details. /// /// Interaction logic for MainWindow.xaml /// diff --git a/README.md b/README.md index 04ff291..dad6f9f 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,12 @@ using EonaCat.VolumeMixer.Models; using System; using System.Threading.Tasks; - static async Task Main() +class Program +{ + // This file is part of the EonaCat project(s) which is released under the Apache License. + // See the LICENSE file or go to https://EonaCat.com/License for full license details. + [STAThread] + static async Task Main() { // Playback management example using (var volumeMixer = new VolumeMixerManager()) @@ -119,7 +124,17 @@ using System.Threading.Tasks; foreach (var session in sessions) { Console.WriteLine($"- {session.DisplayName} ({await session.GetProcessNameAsync()})"); - Console.WriteLine($" Volume: {await session.GetVolumeAsync():P0}"); + + if ((await session.GetProcessNameAsync()).Equals("msedge", StringComparison.OrdinalIgnoreCase)) + { + Console.WriteLine($" Current Volume: {await session.GetVolumeAsync():P0}"); + await session.SetVolumeAsync(1f).ConfigureAwait(false); + Console.WriteLine($" Set to Volume: {await session.GetVolumeAsync():P0}"); + } + else + { + Console.WriteLine($" Volume: {await session.GetVolumeAsync():P0}"); + } Console.WriteLine($" Muted: {await session.GetMuteAsync()}"); session.Dispose(); } @@ -241,4 +256,5 @@ using System.Threading.Tasks; } } } +} ``` \ No newline at end of file