Ejemplo n.º 1
0
        private void cboMicrophones_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            try
            {
                if (acg != null)
                {
                    AVReg.DeleteValue(AVReg.SelectedMicrophone, acg.Source.Moniker);
                    DeactivateAudioCapability();
                }

                if (cboMicrophones.SelectedIndex != 0)
                {
                    FilterInfo fi = (FilterInfo)cboMicrophones.SelectedItem;
                    ActivateAudioCapability(fi);

                    AVReg.WriteValue(AVReg.SelectedMicrophone, fi.Moniker, fi.Name);
                }

                btnAdvancedAudioSettings.Enabled = cboMicrophones.SelectedIndex > 0;
                ckPlayAudio.Enabled  = cboMicrophones.SelectedIndex > 0;
                lblTestAudio.Enabled = cboMicrophones.SelectedIndex > 0;
            }
            catch (COMException ex)
            {
                Log(DShowError._AMGetErrorText(ex.ErrorCode));
                Log(ex.ToString());
            }
            catch (Exception ex)
            {
                Log(ex.ToString());
            }
        }
Ejemplo n.º 2
0
        private void clbCameras_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
        {
            try
            {
                if (e.NewValue == CheckState.Checked)
                {
                    ActivateVideoCapability((FilterInfo)clbCameras.Items[e.Index]);

                    // Only save the camera after we were able to successfully activate it
                    AVReg.WriteValue(AVReg.SelectedCameras, vcg.Source.Moniker,
                                     vcg.Source.FriendlyName);
                }
                else if (e.NewValue == CheckState.Unchecked)
                {
                    // Remove the camera from the registry, even if we can't shut it down
                    AVReg.DeleteValue(AVReg.SelectedCameras, vcg.Source.Moniker);

                    DeactivateVideoCapability((FilterInfo)clbCameras.SelectedItem);
                }
            }
            catch (COMException ex)
            {
                Log(DShowError._AMGetErrorText(ex.ErrorCode));
                Log(ex.ToString());
            }
            catch (Exception ex)
            {
                Log(ex.ToString());
            }
        }
Ejemplo n.º 3
0
        public void SaveLinkedCamera(FilterInfo fi)
        {
            // Delete previous link value
            string[] linkedCamera = AVReg.ValueNames(AVReg.LinkedCamera);
            if (linkedCamera != null && linkedCamera.Length > 0)
            {
                Debug.Assert(linkedCamera.Length == 1);
                AVReg.DeleteValue(AVReg.LinkedCamera, linkedCamera[0]);
            }

            // Set the new value
            AVReg.WriteValue(AVReg.LinkedCamera, fi.Moniker, fi.Name);
        }
Ejemplo n.º 4
0
        private void cboSpeakers_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            // Delete previous value
            string[] selectedSpeaker = AVReg.ValueNames(AVReg.SelectedSpeaker);
            if (selectedSpeaker != null)
            {
                Debug.Assert(selectedSpeaker.Length == 1);
                AVReg.DeleteValue(AVReg.SelectedSpeaker, selectedSpeaker[0]);
            }

            // Store current value
            FilterInfo fi = (FilterInfo)cboSpeakers.SelectedItem;

            AVReg.WriteValue(AVReg.SelectedSpeaker, fi.Moniker, fi.Name);

            if (acg != null)
            {
                RenderAndRunAudio(acg, false);
                RenderAndRunAudio(acg);
            }
        }