Updated README.md
This commit is contained in:
parent
58b5d08338
commit
e5d8cbe0aa
|
@ -4,6 +4,8 @@ using System.Windows;
|
||||||
|
|
||||||
namespace EonaCat.VolumeMixer.Tester.WPF
|
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>
|
/// <summary>
|
||||||
/// Interaction logic for App.xaml
|
/// Interaction logic for App.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
using System.Windows;
|
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(
|
[assembly: ThemeInfo(
|
||||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
//(used if a resource is not found in the page,
|
//(used if a resource is not found in the page,
|
||||||
|
|
|
@ -3,6 +3,8 @@ using System.Windows.Data;
|
||||||
|
|
||||||
namespace EonaCat.VolumeMixer.Tester.WPF.Converter
|
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 class VolumeToPercentageConverter : IValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
|
|
@ -10,6 +10,8 @@ using System.Windows.Threading;
|
||||||
|
|
||||||
namespace EonaCat.VolumeMixer.Tester.WPF
|
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>
|
/// <summary>
|
||||||
/// Interaction logic for MainWindow.xaml
|
/// Interaction logic for MainWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
20
README.md
20
README.md
|
@ -86,7 +86,12 @@ using EonaCat.VolumeMixer.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
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
|
// Playback management example
|
||||||
using (var volumeMixer = new VolumeMixerManager())
|
using (var volumeMixer = new VolumeMixerManager())
|
||||||
|
@ -119,7 +124,17 @@ using System.Threading.Tasks;
|
||||||
foreach (var session in sessions)
|
foreach (var session in sessions)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"- {session.DisplayName} ({await session.GetProcessNameAsync()})");
|
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()}");
|
Console.WriteLine($" Muted: {await session.GetMuteAsync()}");
|
||||||
session.Dispose();
|
session.Dispose();
|
||||||
}
|
}
|
||||||
|
@ -241,4 +256,5 @@ using System.Threading.Tasks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
```
|
```
|
Loading…
Reference in New Issue