Exemplo n.º 1
0
        private static void OnIsRecordingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            AudioInWPF target = d as AudioInWPF;

            if (target != null)
            {
                target.SetRecording((bool?)e.NewValue == true);
            }
        }
Exemplo n.º 2
0
        private static void OnAdvancedControlsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            AudioInWPF target = (AudioInWPF)d;

            if (((bool)e.NewValue) == false)
            {
                target.UseWaveEvent = false;
                if (target.comboInputGroups.Items != null && target.comboInputGroups.Items.Count > 0)
                {
                    target.comboInputGroups.SelectedIndex = 0;
                }
                if (target.comboBoxCodecs.Items != null && target.comboBoxCodecs.Items.Count > 0)
                {
                    target.comboBoxCodecs.SelectedIndex = 0;
                }
            }
        }
Exemplo n.º 3
0
        private static void OnSelectedInputSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            AudioInWPF target = d as AudioInWPF;

            if (target != null && e.NewValue != null)
            {
                var oldModel = e.OldValue as InputDeviceModel;
                if (oldModel != null)
                {
                    oldModel.LastLatency = target.BufferTargetMs;
                }

                var newModel = e.NewValue as InputDeviceModel;
                target.UpdateMinBufferDurationForDevice(newModel);

                target.RestartRecording();
            }
        }