public MainWindow() { InitializeComponent(); Environment.CurrentDirectory = AssemblyHelper.GetDirectory(); tray = new TaskbarIcon(); tray.Visibility = Visibility.Hidden; tray.ToolTipText = "Open Voice Modder"; tray.TrayLeftMouseDown += (s, e) => { tray.Visibility = Visibility.Hidden; this.Show(); this.WindowState = WindowState.Normal; }; tray.TrayRightMouseDown += (s, e) => this.MuteOutput.IsChecked = !this.MuteOutput.IsChecked; this.MuteOutput.IsChecked = Properties.Settings.Default.Muted; try { AudioManager.instance.UpdateDevices( AudioDevices.ListDevices(DataFlow.Capture)[Properties.Settings.Default.InputIndex], AudioDevices.ListDevices(DataFlow.Render)[Properties.Settings.Default.OutputIndex]); } catch (Exception ex) { MessageBox.Show("Error, please update your settings."); } if (!String.IsNullOrEmpty(Properties.Settings.Default.Save)) { RestoreAudioData(JObject.Parse(Properties.Settings.Default.Save)); } KeyboardHook.Initialize(); KeyboardHook.KeyIntercept += (a, k) => { if (a == KeyAction.WM_KEYDOWN) { foreach (UIElement element in SongsHolder.Children) { if (element is SoundController) { if ((element as SoundController).KeyBind == k.ToString()) { (element as SoundController).Play(); } } } if (k.ToString() == Properties.Settings.Default.BeepKey) { AudioResampler.Instance.Censor = true; } } if (a == KeyAction.WM_KEYUP) { if (k.ToString() == Properties.Settings.Default.BeepKey) { AudioResampler.Instance.Censor = false; } } }; }