Ejemplo n.º 1
0
        private void ResetApplicationDefaultDevice(DataFlow dataFlow)
        {
            ObservableProcess process = (cb_applications.SelectedItem as ObservableProcess);

            AudioInterfaceCollection.ClearApplicationDefaultDevice(dataFlow, process);
            UpdateApplicationAudioDevices(cb_applications.SelectedItem as ObservableProcess, true);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 4
0
        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);
 }
Ejemplo n.º 6
0
 private static async Task ToggleAllCustomAudioDevices()
 {
     await Task.Run(
         () => AudioInterfaceCollection.ToggleAllDefaultApplicationDevice()
         ).ConfigureAwait(true);
 }
Ejemplo n.º 7
0
 private void ResetCustomAudioDevices()
 {
     AudioInterfaceCollection.ClearAllApplicationDefaultDevices(DataFlow.All);
     UpdateApplicationAudioDevices(cb_applications.SelectedItem as ObservableProcess, true);
 }
Ejemplo n.º 8
0
 private void MakeInterfaceDefaultRenderDevice()
 {
     AudioInterfaceCollection.ChangeDefaultDevice((cb_interfaces.SelectedItem as AudioInterface).ID);
 }