private void ResetApplicationDefaultDevice(DataFlow dataFlow) { ObservableProcess process = (cb_applications.SelectedItem as ObservableProcess); AudioInterfaceCollection.ClearApplicationDefaultDevice(dataFlow, process); UpdateApplicationAudioDevices(cb_applications.SelectedItem as ObservableProcess, true); }
private void SetApplicationDefaultDevice() { ObservableProcess process = (cb_applications.SelectedItem as ObservableProcess); AudioInterface currentInterface = (cb_interfaces.SelectedItem as AudioInterface); AudioInterfaceCollection.ChangeDefaultApplicationDevice(currentInterface, process); UpdateApplicationAudioDevices(process, true); }
private async void SystemTrayToggleCustomAudio_Click(object sender, RoutedEventArgs e) { (e.OriginalSource as MenuItem).IsEnabled = false; await Task.Run( () => AudioInterfaceCollection.ToggleAllDefaultApplicationDevice() ).ConfigureAwait(true); (e.OriginalSource as MenuItem).IsEnabled = true; }
private void UpdateApplicationAudioDevices(ObservableProcess process, bool announceChanges) { AudioInterface applicationRender = AudioInterfaceCollection.GetDefaultApplicationDevice(DataFlow.Render, process); AudioInterface applicationCapture = AudioInterfaceCollection.GetDefaultApplicationDevice(DataFlow.Capture, process); string previousAppRenderText = app_render.Text; app_render.Text = applicationRender?.FriendlyName ?? Properties.Resources.text_default; if (announceChanges && app_render.Text != previousAppRenderText) { AnnounceVisualElementChanged(app_render); } string previousAppCaptureText = app_capture.Text; app_capture.Text = applicationCapture?.FriendlyName ?? Properties.Resources.text_default; if (announceChanges && app_capture.Text != previousAppCaptureText) { AnnounceVisualElementChanged(app_capture); } }
private void SystemTrayCaptureDefault_Click(object sender, RoutedEventArgs e) { AudioInterfaceCollection.ChangeDefaultDevice(((sender as MenuItem).DataContext as AudioInterface).ID); }
private static async Task ToggleAllCustomAudioDevices() { await Task.Run( () => AudioInterfaceCollection.ToggleAllDefaultApplicationDevice() ).ConfigureAwait(true); }
private void ResetCustomAudioDevices() { AudioInterfaceCollection.ClearAllApplicationDefaultDevices(DataFlow.All); UpdateApplicationAudioDevices(cb_applications.SelectedItem as ObservableProcess, true); }
private void MakeInterfaceDefaultRenderDevice() { AudioInterfaceCollection.ChangeDefaultDevice((cb_interfaces.SelectedItem as AudioInterface).ID); }