@@ -111,17 +111,13 @@ void CLiveBroadcastingDlg::DoDataExchange(CDataExchange* pDX)
111111 DDX_Control (pDX, IDC_CHECK_REPORT, m_chkReport);
112112 DDX_Control (pDX, IDC_CHECK_MODERATION, m_chkModeration);
113113 DDX_Control (pDX, IDC_BUTTON_SNAPSHOT, m_chkSnapshot);
114- DDX_Control (pDX, IDC_COMBO_PLAYBACK, m_cmbPlayback);
115- DDX_Control (pDX, IDC_COMBO_LOOPBACK, m_cmbLoopback);
116114}
117115
118116
119117BEGIN_MESSAGE_MAP (CLiveBroadcastingDlg, CDialogEx)
120118 ON_BN_CLICKED(IDC_BUTTON_JOINCHANNEL, &CLiveBroadcastingDlg::OnBnClickedButtonJoinchannel)
121119 ON_CBN_SELCHANGE(IDC_COMBO_PERSONS, &CLiveBroadcastingDlg::OnSelchangeComboPersons)
122120 ON_CBN_SELCHANGE(IDC_COMBO_ROLE, &CLiveBroadcastingDlg::OnSelchangeComboRole)
123- ON_CBN_SELCHANGE(IDC_COMBO_PLAYBACK, &CLiveBroadcastingDlg::OnSelchangeComboPlayback)
124- ON_CBN_SELCHANGE(IDC_COMBO_LOOPBACK, &CLiveBroadcastingDlg::OnSelchangeComboLoopback)
125121 ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CLiveBroadcastingDlg::OnEIDJoinChannelSuccess)
126122 ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CLiveBroadcastingDlg::OnEIDLeaveChannel)
127123 ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CLiveBroadcastingDlg::OnEIDUserJoined)
@@ -333,8 +329,6 @@ void CLiveBroadcastingDlg::ResumeStatus()
333329 m_lstInfo.ResetContent ();
334330 m_cmbRole.SetCurSel (0 );
335331 m_cmbPersons.SetCurSel (0 );
336- m_cmbPlayback.SetCurSel (0 );
337- m_cmbLoopback.SetCurSel (0 );
338332 m_cmbVideoEncoder.SetCurSel (1 );
339333 ShowVideoWnds ();
340334 InitCtrlText ();
@@ -376,29 +370,6 @@ void CLiveBroadcastingDlg::StopLocalVideo()
376370 }
377371}
378372
379- void CLiveBroadcastingDlg::SetupAudioDeviceLayout ()
380- {
381- char szDeviceName[1024 ];
382- char szDeviceId[1024 ];
383-
384- m_cmbPlayback.ResetContent ();
385- m_cmbLoopback.ResetContent ();
386- m_mapPlaybackDevices.clear ();
387-
388- // get audio record devices and add to combobox and insert map.
389- IAudioDeviceCollection* audioPlaybackDevices = (*m_audioDeviceManager)->enumeratePlaybackDevices ();
390- for (int i = 0 ; i < audioPlaybackDevices->getCount (); i++)
391- {
392- int nRet = audioPlaybackDevices->getDevice (i, szDeviceName, szDeviceId);
393- m_cmbPlayback.AddString (utf82cs (szDeviceName));
394- m_cmbLoopback.AddString (utf82cs (szDeviceName));
395- m_mapPlaybackDevices.insert (std::make_pair (utf82cs (szDeviceName), szDeviceId));
396- }
397- audioPlaybackDevices->release ();
398- m_cmbPlayback.SetCurSel (0 );
399- m_cmbLoopback.SetCurSel (0 );
400- }
401-
402373
403374void CLiveBroadcastingDlg::OnSelchangeComboPersons ()
404375{
@@ -424,51 +395,6 @@ void CLiveBroadcastingDlg::OnSelchangeComboRole()
424395 }
425396}
426397
427- void CLiveBroadcastingDlg::OnSelchangeComboPlayback ()
428- {
429- if (!m_audioDeviceManager) {
430- return ;
431- }
432-
433- int nSel = m_cmbPlayback.GetCurSel ();
434- if (nSel < 0 ) return ;
435-
436- CString strDeviceName;
437- m_cmbPlayback.GetLBText (nSel, strDeviceName);
438-
439- const char * deviceId = m_mapPlaybackDevices[strDeviceName].c_str ();
440- int ret = (*m_audioDeviceManager)->setPlaybackDevice (deviceId);
441- CString infoStr;
442- infoStr.Format (_T (" PlaybackDeviceName : %s" ), strDeviceName);
443- m_lstInfo.InsertString (m_lstInfo.GetCount (), infoStr);
444- infoStr.Format (_T (" PlaybackDeviceId : %s" ), utf82cs (deviceId));
445- m_lstInfo.InsertString (m_lstInfo.GetCount (), infoStr);
446- infoStr.Format (_T (" setPlaybackDevice : %d" ), ret);
447- m_lstInfo.InsertString (m_lstInfo.GetCount (), infoStr);
448- }
449-
450- void CLiveBroadcastingDlg::OnSelchangeComboLoopback ()
451- {
452- if (!m_audioDeviceManager) {
453- return ;
454- }
455-
456- int nSel = m_cmbLoopback.GetCurSel ();
457- if (nSel < 0 ) return ;
458-
459- CString strDeviceName;
460- m_cmbLoopback.GetLBText (nSel, strDeviceName);
461-
462- const char * deviceId = m_mapPlaybackDevices[strDeviceName].c_str ();
463- int ret = (*m_audioDeviceManager)->setLoopbackDevice (deviceId);
464- CString infoStr;
465- infoStr.Format (_T (" LoopbackkDeviceName : %s" ), strDeviceName);
466- m_lstInfo.InsertString (m_lstInfo.GetCount (), infoStr);
467- infoStr.Format (_T (" LoopbackDeviceId : %s" ), utf82cs (deviceId));
468- m_lstInfo.InsertString (m_lstInfo.GetCount (), infoStr);
469- infoStr.Format (_T (" setLoopbackDevice : %d" ), ret);
470- m_lstInfo.InsertString (m_lstInfo.GetCount (), infoStr);
471- }
472398
473399void CLiveBroadcastingDlg::OnBnClickedButtonJoinchannel ()
474400{
@@ -482,7 +408,6 @@ void CLiveBroadcastingDlg::OnBnClickedButtonJoinchannel()
482408 AfxMessageBox (_T (" Fill channel name first" ));
483409 return ;
484410 }
485- m_rtcEngine->enableLoopbackRecording (true );
486411
487412 VideoEncoderConfiguration config;
488413 if (m_cmbVideoEncoder.GetCurSel () < 3 )
@@ -521,7 +446,6 @@ void CLiveBroadcastingDlg::OnShowWindow(BOOL bShow, UINT nStatus)
521446
522447 if (bShow) {
523448 RenderLocalVideo ();
524- SetupAudioDeviceLayout ();
525449 }
526450 else
527451 {
0 commit comments