-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
61 lines (55 loc) · 1.96 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Windows;
using System.Windows.Forms;
using WorkingAttenuationSoftware.Controls;
namespace WorkingAttenuationSoftware
{
public partial class App : System.Windows.Application
{
private SettingWindow _SettingWindow = null;
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
#region Initialize settings tray icon
NotifyIcon trayIcon = new NotifyIcon
{
Text = "WAS",
Visible = true,
Icon = WorkingAttenuationSoftware.Properties.Resources.TrayIcon
};
//TODO: Add ui:
//TODO: Add mic selection
//TODO: Add whitelist program selection
//TODO: Add voip program selection
//TODO: Add minimum noise length (seconds) input
//TODO: Add minimum mic volume input
//TODO: Add minimum app volume input
//TODO: Add restore volume after input
trayIcon.Click += this._TrayIconClicked;
#endregion
#region Initialize service
AudioReducer reducer = new AudioReducer(0.4);
reducer.SetMinimumNoiseLength(0.3);
reducer.SetMinimumMicVolume(0.08);
reducer.SetRestoreVolumeAfter(3);
reducer.SetMinimumAppVolume(0.2);
reducer.AddVOIPApp("discord.exe");
reducer.AddVOIPApp("chrome.exe");
reducer.ListenForIncomingVOIP();
reducer.ListenForMic();
#endregion
}
private void _TrayIconClicked(Object sender, EventArgs e)
{
if(this._SettingWindow == null)
{
this._SettingWindow = new SettingWindow();
this._SettingWindow.Closed += (closeSender, closeE) =>
{
this._SettingWindow = null;
};
}
this._SettingWindow.Show();
}
}
}