예제 #1
0
        public bool EnumerateAudioSources()
        {
            try
            {
                WMEncoder Encoder = new WMEncoder();

                // Retrieve source and device plug-in info manager objects from WMEncoder.
                IWMEncSourcePluginInfoManager        SrcPlugMgr = Encoder.SourcePluginInfoManager;
                IWMEncDeviceControlPluginInfoManager DCPlugMgr  = Encoder.DeviceControlPluginInfoManager;

                // Loop through all the audio and video devices on the system.
                IWMEncPluginInfo PlugInfo;
                for (int i = 0; i < SrcPlugMgr.Count; i++)
                {
                    // Set the IWMEncPluginInfo object to the current plug-in.
                    PlugInfo = SrcPlugMgr.Item(i);

                    // Find the device plug-ins that support resources.
                    if (PlugInfo.SchemeType == "DEVICE" && PlugInfo.Resources == true)
                    {
                        // Loop through the resources in the current plug-in.
                        for (int j = 0; j < PlugInfo.Count; j++)
                        {
                            //if(frm_Rec.chkAudio.Checked==true)

                            {
                                // Add audio resources to the cboAudioSource combo box.
                                if (PlugInfo.MediaType == WMENC_SOURCE_TYPE.WMENC_AUDIO)
                                {
                                    m_sourceEnumDlg.audioSources.Items.Add(PlugInfo.Item(j));
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception exp)
            {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Video Recordong Module ===>Screen Capture.cs line==> 147", exp, "Error Enumeration Audio Resources: " + exp.Message.ToString(), true);
                //WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Error Stoping encoder: " + exp.Message.ToString());
                //Trace.WriteLine(exp.ToString()+"---"+exp.Message+"---"+exp.Source+exp.StackTrace+"---"+exp.TargetSite+"---"+exp.InnerException);
            }

            //DialogResult ret = m_sourceEnumDlg.ShowDialog();
            //if( ret == DialogResult.Cancel)
            //	return false;

            //m_szAudioSource = m_sourceEnumDlg.selectedItem;

            m_szAudioSource = config.Read("Driver");

            return(true);
        }
예제 #2
0
        public frm_AudioConfig()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            btn_Previous.Enabled = false;
            btn_Finish.Enabled   = false;

            // Create a WMEncoder object.
            WMEncoder Encoder = new WMEncoder();



            // Retrieve source and device plug-in info manager objects from WMEncoder.
            IWMEncSourcePluginInfoManager        SrcPlugMgr = Encoder.SourcePluginInfoManager;
            IWMEncDeviceControlPluginInfoManager DCPlugMgr  = Encoder.DeviceControlPluginInfoManager;

            // Loop through all the audio and video devices on the system.
            for (int i = 0; i < SrcPlugMgr.Count; i++)
            {
                // Set the IWMEncPluginInfo object to the current plug-in.
                PlugInfo = SrcPlugMgr.Item(i);

                // Find the device plug-ins that support resources.
                if (PlugInfo.SchemeType == "DEVICE" && PlugInfo.Resources == true)
                {
                    // Loop through the resources in the current plug-in.
                    for (int j = 0; j < PlugInfo.Count; j++)
                    {
                        // Add audio resources to the cboAudioSource combo box.
                        if (PlugInfo.MediaType == WMENC_SOURCE_TYPE.WMENC_AUDIO)
                        {
                            cboAudioSource.Items.Add(PlugInfo.Item(j));
                        }
                    }
                }
            }

            cboAudioSource.SelectedIndex = 0;

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }