Пример #1
0
 private void RefreshCameraDeviceList()
 {
     if (mTRTCCloud == null)
     {
         return;
     }
     this.cameraDeviceComboBox.Items.Clear();
     mCameraDeviceList = mTRTCCloud.getCameraDevicesList();
     if (mCameraDeviceList.getCount() <= 0)
     {
         return;
     }
     mCameraDevice = mTRTCCloud.getCurrentCameraDevice();
     for (uint i = 0; i < mCameraDeviceList.getCount(); i++)
     {
         this.cameraDeviceComboBox.Items.Add(mCameraDeviceList.getDeviceName(i));
         if (mCameraDevice.getDeviceName().Equals(mCameraDeviceList.getDeviceName(i)))
         {
             this.cameraDeviceComboBox.SelectedIndex = (int)i;
         }
     }
     if (string.IsNullOrEmpty(mCameraDevice.getDeviceName()) && mCameraDeviceList.getCount() > 0)
     {
         this.cameraDeviceComboBox.SelectedIndex = 0;
     }
 }
Пример #2
0
 private void RefreshCameraDeviceList()
 {
     if (mDeviceManager == null)
     {
         return;
     }
     this.cameraDeviceComboBox.Items.Clear();
     mCameraDeviceList = mDeviceManager.getDevicesList(TRTCDeviceType.TXMediaDeviceTypeCamera);
     if (mCameraDeviceList.getCount() <= 0)
     {
         this.cameraDeviceComboBox.Items.Add("");
         this.cameraDeviceComboBox.SelectionStart = this.cameraDeviceComboBox.Text.Length;
         return;
     }
     mCameraDevice = mDeviceManager.getCurrentDevice(TRTCDeviceType.TXMediaDeviceTypeCamera);
     for (uint i = 0; i < mCameraDeviceList.getCount(); i++)
     {
         this.cameraDeviceComboBox.Items.Add(mCameraDeviceList.getDeviceName(i));
         if (mCameraDevice.getDeviceName().Equals(mCameraDeviceList.getDeviceName(i)))
         {
             this.cameraDeviceComboBox.SelectedIndex = (int)i;
         }
     }
     if (string.IsNullOrEmpty(mCameraDevice.getDeviceName()) && mCameraDeviceList.getCount() > 0)
     {
         this.cameraDeviceComboBox.SelectedIndex = 0;
     }
 }
Пример #3
0
 private void OnSpeakerDeviceComboBoxSelectedIndexChanged(object sender, EventArgs e)
 {
     for (uint i = 0; i < mSpeakerDeviceList.getCount(); i++)
     {
         if (mSpeakerDeviceList.getDeviceName(i).Equals(this.speakerDeviceComboBox.Text))
         {
             mTRTCCloud.setCurrentSpeakerDevice(mSpeakerDeviceList.getDevicePID(i));
             mMainForm.OnSpeakerDeviceChange(mSpeakerDeviceList.getDeviceName(i));
         }
     }
 }
Пример #4
0
 private void RefreshSpeakerList()
 {
     if (mTRTCCloud == null)
     {
         return;
     }
     this.speakerDeviceComboBox.Items.Clear();
     mSpeakerDeviceList = mTRTCCloud.getSpeakerDevicesList();
     if (mSpeakerDeviceList.getCount() <= 0)
     {
         return;
     }
     mSpeakerDevice = mTRTCCloud.getCurrentSpeakerDevice();
     for (uint i = 0; i < mSpeakerDeviceList.getCount(); i++)
     {
         this.speakerDeviceComboBox.Items.Add(mSpeakerDeviceList.getDeviceName(i));
         if (mSpeakerDevice.getDeviceName().Equals(mSpeakerDeviceList.getDeviceName(i)))
         {
             this.speakerDeviceComboBox.SelectedIndex = (int)i;
         }
     }
 }
 private void speakerDeviceComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(this.speakerDeviceComboBox.Text))
     {
         return;
     }
     for (uint i = 0; i < mSpeakerDeviceList.getCount(); i++)
     {
         if (mSpeakerDeviceList.getDeviceName(i).Equals(this.speakerDeviceComboBox.Text))
         {
             mDeviceManager.setCurrentDevice(TRTCDeviceType.TXMediaDeviceTypeSpeaker, mSpeakerDeviceList.getDevicePID(i));
             mMainForm.OnSpeakerDeviceChange(mSpeakerDeviceList.getDevicePID(i));
         }
     }
 }
 private void RefreshSpeakerList()
 {
     if (mDeviceManager == null)
     {
         return;
     }
     this.speakerDeviceComboBox.Items.Clear();
     mSpeakerDeviceList = mDeviceManager.getDevicesList(TRTCDeviceType.TXMediaDeviceTypeSpeaker);
     if (mSpeakerDeviceList.getCount() <= 0)
     {
         this.speakerDeviceComboBox.Items.Add("");
         this.speakerDeviceComboBox.SelectionStart = this.speakerDeviceComboBox.Text.Length;
         return;
     }
     mSpeakerDevice = mDeviceManager.getCurrentDevice(TRTCDeviceType.TXMediaDeviceTypeSpeaker);
     for (uint i = 0; i < mSpeakerDeviceList.getCount(); i++)
     {
         this.speakerDeviceComboBox.Items.Add(mSpeakerDeviceList.getDeviceName(i));
         if (mSpeakerDevice.getDeviceName().Equals(mSpeakerDeviceList.getDeviceName(i)))
         {
             this.speakerDeviceComboBox.SelectedIndex = (int)i;
         }
     }
 }
Пример #7
0
 private void cameraDeviceComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(this.cameraDeviceComboBox.Text))
     {
         return;
     }
     for (uint i = 0; i < mCameraDeviceList.getCount(); i++)
     {
         if (mCameraDeviceList.getDeviceName(i).Equals(this.cameraDeviceComboBox.Text))
         {
             mTRTCCloud.setCurrentCameraDevice(mCameraDeviceList.getDevicePID(i));
             mMainForm.OnCameraDeviceChange(mCameraDeviceList.getDevicePID(i));
         }
     }
 }
Пример #8
0
 private void RefreshMicDeviceList()
 {
     if (mTRTCCloud == null)
     {
         return;
     }
     this.micDeviceComboBox.Items.Clear();
     mMicDeviceList = mTRTCCloud.getMicDevicesList();
     if (mMicDeviceList.getCount() <= 0)
     {
         this.micDeviceComboBox.Items.Add("");
         this.micDeviceComboBox.SelectionStart = this.micDeviceComboBox.Text.Length;
         return;
     }
     mMicDevice = mTRTCCloud.getCurrentMicDevice();
     for (uint i = 0; i < mMicDeviceList.getCount(); i++)
     {
         this.micDeviceComboBox.Items.Add(mMicDeviceList.getDeviceName(i));
         if (mMicDevice.getDeviceName().Equals(mMicDeviceList.getDeviceName(i)))
         {
             this.micDeviceComboBox.SelectedIndex = (int)i;
         }
     }
 }
Пример #9
0
 private void RefreshCameraDeviceList()
 {
     if (mTRTCCloud == null)
     {
         return;
     }
     this.cameraDeviceComboBox.Items.Clear();
     mCameraDevice = mTRTCCloud.getCurrentCameraDevice();
     Log.I(String.Format("CurrentCameraDevice: pid = {0}, name = {1}", mCameraDevice.getDevicePID(), mCameraDevice.getDeviceName()));
     mCameraDeviceList = mTRTCCloud.getCameraDevicesList();
     for (uint i = 0; i < mCameraDeviceList.getCount(); i++)
     {
         this.cameraDeviceComboBox.Items.Add(mCameraDeviceList.getDeviceName(i));
         if (mCameraDevice.getDeviceName().Equals(mCameraDeviceList.getDeviceName(i)))
         {
             this.cameraDeviceComboBox.SelectedIndex = (int)i;
         }
         Log.I(String.Format("CameraDevice{0} : name = {1}, pid = {2}", i + 1, mCameraDeviceList.getDeviceName(i), mCameraDeviceList.getDevicePID(i)));
     }
     if (string.IsNullOrEmpty(mCameraDevice.getDeviceName()) && mCameraDeviceList.getCount() > 0)
     {
         this.cameraDeviceComboBox.SelectedIndex = 0;
     }
 }
Пример #10
0
        private void RefreshSpeakerList()
        {
            if (mTRTCCloud == null)
            {
                return;
            }
            this.speakerDeviceComboBox.Items.Clear();
            mSpeakerDevice = mTRTCCloud.getCurrentSpeakerDevice();

            Log.I(String.Format("CurrentSpeakerDevice: pid = {0}, name = {1}", mSpeakerDevice.getDevicePID(), mSpeakerDevice.getDeviceName()));
            mSpeakerDeviceList = mTRTCCloud.getSpeakerDevicesList();
            for (uint i = 0; i < mSpeakerDeviceList.getCount(); i++)
            {
                this.speakerDeviceComboBox.Items.Add(mSpeakerDeviceList.getDeviceName(i));
                if (mSpeakerDevice.getDeviceName().Equals(mSpeakerDeviceList.getDeviceName(i)))
                {
                    this.speakerDeviceComboBox.SelectedIndex = (int)i;
                }
                Log.I(String.Format("SpeakerDevice{0} : name = {1}, pid = {2}", i + 1, mSpeakerDeviceList.getDeviceName(i), mSpeakerDeviceList.getDevicePID(i)));
            }
        }