private void SaveSettings() { PortAudio.AudioDevice indev = comboHeadsetInput.SelectedItem as PortAudio.AudioDevice; PortAudio.AudioDevice outdev = comboHeadsetOutput.SelectedItem as PortAudio.AudioDevice; broker.SetHeadsetDevs(indev == null ? "" : indev.name, outdev == null ? "" : outdev.name); indev = comboSpeakerInput.SelectedItem as PortAudio.AudioDevice; outdev = comboSpeakerOutput.SelectedItem as PortAudio.AudioDevice; broker.SetSpeakerDevs(indev == null ? "" : indev.name, outdev == null ? "" : outdev.name); outdev = comboRingDevice.SelectedItem as PortAudio.AudioDevice; broker.SetRingDev(outdev == null ? "" : outdev.name); broker.IncomingBalloons = chkIncomingBalloons.IsChecked == true; string incoming_key = (comboOnIncomingCall.SelectedItem as ComboOption).key; if (incoming_key == "None") { broker.IncomingKeyboardFocus = broker.IncomingTopMost = false; } else { broker.IncomingTopMost = true; broker.IncomingKeyboardFocus = (incoming_key == "FrontKeyboard"); } broker.ClearDTMFS = chkClearDTMFS.IsChecked == true; broker.UPNPNAT = chkNAT.IsChecked == true; broker.DirectSipDial = chkDirectSip.IsChecked == true; broker.UseNumberOnlyInput = chkUseNumbers.IsChecked == true; broker.recordings_folder = txtRecordingPath.Text; broker.CheckForUpdates = chkUpdatesOnStart.IsChecked == true ? "OnStart" : "Never"; broker.GUIStartup = (comboGUIStartup.SelectedItem as ComboOption).key; broker.theme = (comboTheme.SelectedItem as ComboOption).key; broker.SetActiveHeadset(comboHeadsetDevice.SelectedItem as string); broker.SaveSettings(); }
private void SaveSettings() { PortAudio.AudioDevice indev = comboHeadsetInput.SelectedItem as PortAudio.AudioDevice; PortAudio.AudioDevice outdev = comboHeadsetOutput.SelectedItem as PortAudio.AudioDevice; broker.SetHeadsetDevs(indev == null ? "" : indev.name, outdev == null ? "" : outdev.name); indev = comboSpeakerInput.SelectedItem as PortAudio.AudioDevice; outdev = comboSpeakerOutput.SelectedItem as PortAudio.AudioDevice; broker.SetSpeakerDevs(indev == null ? "" : indev.name, outdev == null ? "" : outdev.name); outdev = comboRingDevice.SelectedItem as PortAudio.AudioDevice; broker.SetRingDev(outdev == null ? "" : outdev.name); broker.IncomingBalloons = chkIncomingBalloons.IsChecked == true; string incoming_key = (comboOnIncomingCall.SelectedItem as ComboOption).key; if (incoming_key == "None") { broker.IncomingKeyboardFocus = broker.IncomingTopMost = false; } else { broker.IncomingTopMost = true; broker.IncomingKeyboardFocus = (incoming_key == "FrontKeyboard"); } broker.ClearDTMFS = chkClearDTMFS.IsChecked == true; broker.UPNPNAT = chkNAT.IsChecked == true; broker.DirectSipDial = chkDirectSip.IsChecked == true; broker.AlwaysOnTopDuringCall = chkAlwaysOnTopDuringCall.IsChecked == true; broker.UseNumberOnlyInput = chkUseNumbers.IsChecked == true; broker.recordings_folder = txtRecordingPath.Text; broker.CheckForUpdates = chkUpdatesOnStart.IsChecked == true ? "OnStart" : "Never"; broker.GUIStartup = (comboGUIStartup.SelectedItem as ComboOption).key; broker.theme = (comboTheme.SelectedItem as ComboOption).key; SetHotKeyFromWindow(GLOBAL_HOT_KEY_TYPE.Focus, chkGlobalAlt, chkGlobalCntrl, chkGlobalShift, chkGlobalWin, txtHotKey); SetHotKeyFromWindow(GLOBAL_HOT_KEY_TYPE.End, chkGlobalEndAlt, chkGlobalEndCntrl, chkGlobalEndShift, chkGlobalEndWin, txtHotKeyEnd); SetHotKeyFromWindow(GLOBAL_HOT_KEY_TYPE.Answer, chkGlobalAnsAlt, chkGlobalAnsCntrl, chkGlobalAnsShift, chkGlobalAnsWin, txtHotKeyAns); SetHotKeyFromWindow(GLOBAL_HOT_KEY_TYPE.Mute, chkGlobalMuteAlt, chkGlobalMuteCntrl, chkGlobalMuteShift, chkGlobalMuteWin, txtHotKeyMute); broker.SetActiveHeadset(comboHeadsetDevice.SelectedItem as string); broker.SaveSettings(); }
private void SaveSettings() { PortAudio.AudioDevice indev = comboHeadsetInput.SelectedItem as PortAudio.AudioDevice; PortAudio.AudioDevice outdev = comboHeadsetOutput.SelectedItem as PortAudio.AudioDevice; broker.SetHeadsetDevs(indev == null ? "" : indev.name, outdev == null ? "" : outdev.name); indev = comboSpeakerInput.SelectedItem as PortAudio.AudioDevice; outdev = comboSpeakerOutput.SelectedItem as PortAudio.AudioDevice; broker.SetSpeakerDevs(indev == null ? "" : indev.name, outdev == null ? "" : outdev.name); outdev = comboRingDevice.SelectedItem as PortAudio.AudioDevice; broker.SetRingDev(outdev == null ? "" : outdev.name); broker.IncomingBalloons = chkIncomingBalloons.IsChecked == true; string incoming_key = (comboOnIncomingCall.SelectedItem as ComboOption).key; if (incoming_key == "None") { broker.IncomingKeyboardFocus = broker.IncomingTopMost = false; } else { broker.IncomingTopMost = true; broker.IncomingKeyboardFocus = (incoming_key == "FrontKeyboard"); } broker.ClearDTMFS = chkClearDTMFS.IsChecked == true; broker.UPNPNAT = chkNAT.IsChecked == true; broker.DirectSipDial = chkDirectSip.IsChecked == true; broker.AlwaysOnTopDuringCall = chkAlwaysOnTopDuringCall.IsChecked == true; broker.UseNumberOnlyInput = chkUseNumbers.IsChecked == true; broker.recordings_folder = txtRecordingPath.Text; broker.CheckForUpdates = chkUpdatesOnStart.IsChecked == true ? "OnStart" : "Never"; broker.GUIStartup = (comboGUIStartup.SelectedItem as ComboOption).key; broker.theme = (comboTheme.SelectedItem as ComboOption).key; System.Windows.Input.Key hot_key = System.Windows.Input.Key.None; var hot_key_modifier = UnManaged.KeyModifier.None; if (chkGlobalAlt.IsChecked == true) { hot_key_modifier |= UnManaged.KeyModifier.Alt; } if (chkGlobalCntrl.IsChecked == true) { hot_key_modifier |= UnManaged.KeyModifier.Ctrl; } if (chkGlobalShift.IsChecked == true) { hot_key_modifier |= UnManaged.KeyModifier.Shift; } if (chkGlobalWin.IsChecked == true) { hot_key_modifier |= UnManaged.KeyModifier.Win; } if (!String.IsNullOrWhiteSpace(txtHotKey.Text)) { var key = txtHotKey.Text.ToUpper(); if (key[0] >= 0 && key[0] <= 9) { key = "D" + key; } Enum.TryParse <System.Windows.Input.Key>(key, out hot_key); } broker.SetHotKey(new Broker.HotKeySetting { modifiers = hot_key_modifier, key = hot_key }); broker.SetActiveHeadset(comboHeadsetDevice.SelectedItem as string); broker.SaveSettings(); }