Updated README.md

This commit is contained in:
EonaCat 2025-07-23 20:36:42 +02:00
parent 58b5d08338
commit e5d8cbe0aa
5 changed files with 27 additions and 2 deletions

View File

@ -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.
/// <summary>
/// Interaction logic for App.xaml
/// </summary>

View File

@ -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,

View File

@ -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)

View File

@ -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.
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>

View File

@ -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;
}
}
}
}
```