Skip to content

Commit 6dddc9d

Browse files
committed
fix bug
1 parent a10e3c8 commit 6dddc9d

File tree

6 files changed

+25
-16
lines changed

6 files changed

+25
-16
lines changed

windows/APIExample/APIExample/APIExample.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ if exist en.ini (copy en.ini $(SolutionDir)$(Platform)\$(Configuration))
351351
<ClCompile Include="DirectShow\DShowHelper.cpp">
352352
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
353353
</ClCompile>
354-
<ClCompile Include="DSoundRender.cpp" />
354+
<ClCompile Include="dsound\DSoundRender.cpp" />
355355
<ClCompile Include="RtcChannelHelperPlugin\AgoraRtcChannelPublishHelper.cpp" />
356356
<ClCompile Include="RtcChannelHelperPlugin\utils\AudioCircularBuffer.cc" />
357357
<ClCompile Include="RtcChannelHelperPlugin\utils\ExtendAudioFrameObserver.cpp" />

windows/APIExample/APIExample/APIExample.vcxproj.filters

+3-3
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,6 @@
362362
<ClCompile Include="Advanced\MediaIOCustomVideoCaptrue\CAgoraMediaIOVideoCaptureDlg.cpp">
363363
<Filter>Advanced\MediaIOCustomVideoCapture</Filter>
364364
</ClCompile>
365-
<ClCompile Include="DSoundRender.cpp">
366-
<Filter>dsound</Filter>
367-
</ClCompile>
368365
<ClCompile Include="Advanced\AudioEffect\CAgoraEffectDlg.cpp">
369366
<Filter>Advanced\AudioEffect</Filter>
370367
</ClCompile>
@@ -392,6 +389,9 @@
392389
<ClCompile Include="Advanced\PreCallTest\CAgoraPreCallTestDlg.cpp">
393390
<Filter>Advanced\PreCallTest</Filter>
394391
</ClCompile>
392+
<ClCompile Include="dsound\DSoundRender.cpp">
393+
<Filter>dsound</Filter>
394+
</ClCompile>
395395
</ItemGroup>
396396
<ItemGroup>
397397
<ResourceCompile Include="APIExample.rc">

windows/APIExample/APIExample/Advanced/AudioEffect/CAgoraEffectDlg.cpp

+14-8
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ BEGIN_MESSAGE_MAP(CAgoraEffectDlg, CDialogEx)
6767
ON_BN_CLICKED(IDC_BUTTON_STOP_ALL_EFFECT2, &CAgoraEffectDlg::OnBnClickedButtonStopAllEffect2)
6868
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_AGIN, &CAgoraEffectDlg::OnDeltaposSpinGain)
6969
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_PITCH, &CAgoraEffectDlg::OnDeltaposSpinPitch)
70+
ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CAgoraEffectDlg::OnEIDJoinChannelSuccess)
71+
ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CAgoraEffectDlg::OnEIDLeaveChannel)
72+
ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CAgoraEffectDlg::OnEIDUserJoined)
73+
ON_MESSAGE(WM_MSGID(EID_USER_OFFLINE), &CAgoraEffectDlg::OnEIDUserOffline)
74+
ON_MESSAGE(WM_MSGID(EID_REMOTE_VIDEO_STATE_CHANED), &CAgoraEffectDlg::OnEIDRemoteVideoStateChanged)
75+
7076
ON_LBN_SELCHANGE(IDC_LIST_INFO_BROADCASTING, &CAgoraEffectDlg::OnSelchangeListInfoBroadcasting)
7177
ON_WM_SHOWWINDOW()
7278
ON_BN_CLICKED(IDC_BUTTON_STOP_EFFECT, &CAgoraEffectDlg::OnBnClickedButtonStopEffect)
@@ -187,7 +193,7 @@ void CAgoraEffectDlg::ResumeStatus()
187193
m_lstInfo.ResetContent();
188194
m_edtChannel.SetWindowText(_T(""));
189195
m_edtEffectPath.SetWindowText(_T(""));
190-
m_edtGain.SetWindowText(_T("0.0"));
196+
m_edtGain.SetWindowText(_T("100.0"));
191197
m_edtLoops.SetWindowText(_T("0"));
192198
m_edtPitch.SetWindowText(_T("1.0"));
193199
m_cmbPan.SetCurSel(0);
@@ -234,13 +240,13 @@ void CAgoraEffectDlg::OnBnClickedButtonAddEffect()
234240
CString strPath;
235241
m_edtEffectPath.GetWindowText(strPath);
236242
//judge file is exists.
237-
if (PathFileExists(strPath))
243+
if (!strPath.IsEmpty())
238244
{
239245
m_cmbEffect.InsertString(m_cmbEffect.GetCount(), strPath);
240246
m_mapEffect.insert(std::make_pair(strPath, m_soundId++));
241247
}
242248
else {
243-
MessageBox(_T("file is not exists."));
249+
MessageBox(_T("url can not empty."));
244250
}
245251
m_cmbEffect.SetCurSel(0);
246252
}
@@ -257,7 +263,7 @@ void CAgoraEffectDlg::OnBnClickedButtonPreload()
257263
m_cmbEffect.GetWindowText(strEffect);
258264
std::string strPath = cs2utf8(strEffect);
259265
//pre load effect
260-
m_rtcEngine->preloadEffect(m_mapEffect[strEffect], strPath.c_str());
266+
int nRet = m_rtcEngine->preloadEffect(m_mapEffect[strEffect], strPath.c_str());
261267
CString strInfo;
262268
strInfo.Format(_T("preload effect :path:%s"), strEffect);
263269
m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo);
@@ -326,9 +332,9 @@ void CAgoraEffectDlg::OnBnClickedButtonResumeEffect()
326332
m_cmbEffect.GetWindowText(strEffect);
327333
// resume effect by sound id.
328334
m_rtcEngine->resumeEffect(m_mapEffect[strEffect]);
329-
335+
330336
CString strInfo;
331-
strInfo.Format(_T("resume effect :path:%s"),strEffect);
337+
strInfo.Format(_T("resume effect :path:%s"), strEffect);
332338
m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo);
333339
}
334340

@@ -361,8 +367,8 @@ void CAgoraEffectDlg::OnBnClickedButtonPlayEffect()
361367

362368
BOOL publish = m_chkPublish.GetCheck();
363369
//play effect by effect path.
364-
m_rtcEngine->playEffect(m_mapEffect[strEffect], strFile.c_str(), loops, pitch, pan, gain, publish);
365-
370+
int nRet = m_rtcEngine->playEffect(m_mapEffect[strEffect], strFile.c_str(),
371+
loops, pitch, pan, gain, publish);
366372
CString strInfo;
367373
strInfo.Format(_T("play effect :path:%s,loops:%d,pitch:%.1f,pan:%.0f,gain:%d,publish:%d"),
368374
strEffect, loops, pitch, pan, gain, publish);

windows/APIExample/APIExample/Advanced/CustomAudioCapture/CAgoraCaptureAudioDlg.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ void CAgoraCaptureAduioDlg::RenderLocalVideo()
178178
{
179179
if (m_rtcEngine) {
180180
//start preview in the engine.
181-
//m_rtcEngine->startPreview();
181+
m_rtcEngine->startPreview();
182182
VideoCanvas canvas;
183183
canvas.renderMode = RENDER_MODE_FIT;
184184
canvas.uid = 0;

windows/APIExample/APIExample/Advanced/ScreenShare/AgoraScreenCapture.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ void CAgoraScreenCapture::ReFreshWnd()
472472
void CAgoraScreenCapture::GetCaptureParameterFromCtrl(agora::rtc::ScreenCaptureParameters& capParam)
473473
{
474474
capParam.captureMouseCursor = m_chkShareCursor.GetCheck();
475+
static view_t excludeWnd[2];
475476
CString str;
476477
m_edtFPS.GetWindowText(str);
477478
if (str.IsEmpty())
@@ -480,7 +481,8 @@ void CAgoraScreenCapture::GetCaptureParameterFromCtrl(agora::rtc::ScreenCaptureP
480481
capParam.frameRate = _ttoi(str);
481482
HWND hWnd = NULL;
482483
hWnd = m_listWnd.GetAt(m_listWnd.FindIndex(m_cmbScreenCap.GetCurSel()));
483-
capParam.excludeWindowList = (view_t*)hWnd;
484+
excludeWnd[0] = hWnd;
485+
capParam.excludeWindowList = excludeWnd;
484486
capParam.windowFocus = m_chkWndFocus.GetCheck();
485487
capParam.excludeWindowCount = 1;
486488
str.Empty();
@@ -704,8 +706,8 @@ BOOL CMonitors::MonitorFunc(HMONITOR hMonitor, HDC hDc, LPRECT lpRect, LPARAM lP
704706
devMode.dmSize = sizeof(DEVMODE);
705707
EnumDisplaySettings(info.szDevice, ENUM_CURRENT_SETTINGS, &devMode);
706708

707-
DEVICE_SCALE_FACTOR scale;
708-
HRESULT hr = GetScaleFactorForMonitor(hMonitor, &scale);
709+
//DEVICE_SCALE_FACTOR scale;
710+
//HRESULT hr = GetScaleFactorForMonitor(hMonitor, &scale);
709711
MonitorInformation monitorInfo;
710712
monitorInfo.monitorInfo = info;
711713
monitorInfo.hMonitor = hMonitor;

windows/APIExample/APIExample/Basic/LiveBroadcasting/CLiveBroadcastingDlg.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ LRESULT CLiveBroadcastingDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam)
435435
canvas.uid = wParam;
436436
canvas.view = m_videoWnds[i].GetSafeHwnd();
437437
canvas.renderMode = RENDER_MODE_FIT;
438+
m_videoWnds[i].SetUID(wParam);
438439
//setup remote video in engine to the canvas.
439440
m_rtcEngine->setupRemoteVideo(canvas);
440441
break;

0 commit comments

Comments
 (0)