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; } }
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; } }
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)); } } }
private void OnMicDeviceComboBoxSelectedIndexChanged(object sender, EventArgs e) { if (String.IsNullOrEmpty(this.micDeviceComboBox.Text)) { return; } for (uint i = 0; i < mMicDeviceList.getCount(); i++) { if (mMicDeviceList.getDeviceName(i).Equals(this.micDeviceComboBox.Text)) { mTRTCCloud.setCurrentMicDevice(mMicDeviceList.getDevicePID(i)); mMainForm.OnMicDeviceChange(mMicDeviceList.getDeviceName(i)); } } }
private void RefreshMicDeviceList() { if (mTRTCCloud == null) { return; } this.micDeviceComboBox.Items.Clear(); mMicDevice = mTRTCCloud.getCurrentMicDevice(); Log.I(String.Format("CurrentMicDevice: pid = {0}, name = {1}", mMicDevice.getDevicePID(), mMicDevice.getDeviceName())); mMicDeviceList = mTRTCCloud.getMicDevicesList(); 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; } Log.I(String.Format("MicDevice{0} : name = {1}, pid = {2}", i + 1, mMicDeviceList.getDeviceName(i), mMicDeviceList.getDevicePID(i))); } }
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; } } }
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; } } }