Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CLuCheng committed Jan 3, 2021
1 parent a10e3c8 commit 6dddc9d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion windows/APIExample/APIExample/APIExample.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ if exist en.ini (copy en.ini $(SolutionDir)$(Platform)\$(Configuration))
<ClCompile Include="DirectShow\DShowHelper.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="DSoundRender.cpp" />
<ClCompile Include="dsound\DSoundRender.cpp" />
<ClCompile Include="RtcChannelHelperPlugin\AgoraRtcChannelPublishHelper.cpp" />
<ClCompile Include="RtcChannelHelperPlugin\utils\AudioCircularBuffer.cc" />
<ClCompile Include="RtcChannelHelperPlugin\utils\ExtendAudioFrameObserver.cpp" />
Expand Down
6 changes: 3 additions & 3 deletions windows/APIExample/APIExample/APIExample.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,6 @@
<ClCompile Include="Advanced\MediaIOCustomVideoCaptrue\CAgoraMediaIOVideoCaptureDlg.cpp">
<Filter>Advanced\MediaIOCustomVideoCapture</Filter>
</ClCompile>
<ClCompile Include="DSoundRender.cpp">
<Filter>dsound</Filter>
</ClCompile>
<ClCompile Include="Advanced\AudioEffect\CAgoraEffectDlg.cpp">
<Filter>Advanced\AudioEffect</Filter>
</ClCompile>
Expand Down Expand Up @@ -392,6 +389,9 @@
<ClCompile Include="Advanced\PreCallTest\CAgoraPreCallTestDlg.cpp">
<Filter>Advanced\PreCallTest</Filter>
</ClCompile>
<ClCompile Include="dsound\DSoundRender.cpp">
<Filter>dsound</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="APIExample.rc">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ BEGIN_MESSAGE_MAP(CAgoraEffectDlg, CDialogEx)
ON_BN_CLICKED(IDC_BUTTON_STOP_ALL_EFFECT2, &CAgoraEffectDlg::OnBnClickedButtonStopAllEffect2)
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_AGIN, &CAgoraEffectDlg::OnDeltaposSpinGain)
ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_PITCH, &CAgoraEffectDlg::OnDeltaposSpinPitch)
ON_MESSAGE(WM_MSGID(EID_JOINCHANNEL_SUCCESS), &CAgoraEffectDlg::OnEIDJoinChannelSuccess)
ON_MESSAGE(WM_MSGID(EID_LEAVE_CHANNEL), &CAgoraEffectDlg::OnEIDLeaveChannel)
ON_MESSAGE(WM_MSGID(EID_USER_JOINED), &CAgoraEffectDlg::OnEIDUserJoined)
ON_MESSAGE(WM_MSGID(EID_USER_OFFLINE), &CAgoraEffectDlg::OnEIDUserOffline)
ON_MESSAGE(WM_MSGID(EID_REMOTE_VIDEO_STATE_CHANED), &CAgoraEffectDlg::OnEIDRemoteVideoStateChanged)

ON_LBN_SELCHANGE(IDC_LIST_INFO_BROADCASTING, &CAgoraEffectDlg::OnSelchangeListInfoBroadcasting)
ON_WM_SHOWWINDOW()
ON_BN_CLICKED(IDC_BUTTON_STOP_EFFECT, &CAgoraEffectDlg::OnBnClickedButtonStopEffect)
Expand Down Expand Up @@ -187,7 +193,7 @@ void CAgoraEffectDlg::ResumeStatus()
m_lstInfo.ResetContent();
m_edtChannel.SetWindowText(_T(""));
m_edtEffectPath.SetWindowText(_T(""));
m_edtGain.SetWindowText(_T("0.0"));
m_edtGain.SetWindowText(_T("100.0"));
m_edtLoops.SetWindowText(_T("0"));
m_edtPitch.SetWindowText(_T("1.0"));
m_cmbPan.SetCurSel(0);
Expand Down Expand Up @@ -234,13 +240,13 @@ void CAgoraEffectDlg::OnBnClickedButtonAddEffect()
CString strPath;
m_edtEffectPath.GetWindowText(strPath);
//judge file is exists.
if (PathFileExists(strPath))
if (!strPath.IsEmpty())
{
m_cmbEffect.InsertString(m_cmbEffect.GetCount(), strPath);
m_mapEffect.insert(std::make_pair(strPath, m_soundId++));
}
else {
MessageBox(_T("file is not exists."));
MessageBox(_T("url can not empty."));
}
m_cmbEffect.SetCurSel(0);
}
Expand All @@ -257,7 +263,7 @@ void CAgoraEffectDlg::OnBnClickedButtonPreload()
m_cmbEffect.GetWindowText(strEffect);
std::string strPath = cs2utf8(strEffect);
//pre load effect
m_rtcEngine->preloadEffect(m_mapEffect[strEffect], strPath.c_str());
int nRet = m_rtcEngine->preloadEffect(m_mapEffect[strEffect], strPath.c_str());
CString strInfo;
strInfo.Format(_T("preload effect :path:%s"), strEffect);
m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo);
Expand Down Expand Up @@ -326,9 +332,9 @@ void CAgoraEffectDlg::OnBnClickedButtonResumeEffect()
m_cmbEffect.GetWindowText(strEffect);
// resume effect by sound id.
m_rtcEngine->resumeEffect(m_mapEffect[strEffect]);

CString strInfo;
strInfo.Format(_T("resume effect :path:%s"),strEffect);
strInfo.Format(_T("resume effect :path:%s"), strEffect);
m_lstInfo.InsertString(m_lstInfo.GetCount(), strInfo);
}

Expand Down Expand Up @@ -361,8 +367,8 @@ void CAgoraEffectDlg::OnBnClickedButtonPlayEffect()

BOOL publish = m_chkPublish.GetCheck();
//play effect by effect path.
m_rtcEngine->playEffect(m_mapEffect[strEffect], strFile.c_str(), loops, pitch, pan, gain, publish);

int nRet = m_rtcEngine->playEffect(m_mapEffect[strEffect], strFile.c_str(),
loops, pitch, pan, gain, publish);
CString strInfo;
strInfo.Format(_T("play effect :path:%s,loops:%d,pitch:%.1f,pan:%.0f,gain:%d,publish:%d"),
strEffect, loops, pitch, pan, gain, publish);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void CAgoraCaptureAduioDlg::RenderLocalVideo()
{
if (m_rtcEngine) {
//start preview in the engine.
//m_rtcEngine->startPreview();
m_rtcEngine->startPreview();
VideoCanvas canvas;
canvas.renderMode = RENDER_MODE_FIT;
canvas.uid = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ void CAgoraScreenCapture::ReFreshWnd()
void CAgoraScreenCapture::GetCaptureParameterFromCtrl(agora::rtc::ScreenCaptureParameters& capParam)
{
capParam.captureMouseCursor = m_chkShareCursor.GetCheck();
static view_t excludeWnd[2];
CString str;
m_edtFPS.GetWindowText(str);
if (str.IsEmpty())
Expand All @@ -480,7 +481,8 @@ void CAgoraScreenCapture::GetCaptureParameterFromCtrl(agora::rtc::ScreenCaptureP
capParam.frameRate = _ttoi(str);
HWND hWnd = NULL;
hWnd = m_listWnd.GetAt(m_listWnd.FindIndex(m_cmbScreenCap.GetCurSel()));
capParam.excludeWindowList = (view_t*)hWnd;
excludeWnd[0] = hWnd;
capParam.excludeWindowList = excludeWnd;
capParam.windowFocus = m_chkWndFocus.GetCheck();
capParam.excludeWindowCount = 1;
str.Empty();
Expand Down Expand Up @@ -704,8 +706,8 @@ BOOL CMonitors::MonitorFunc(HMONITOR hMonitor, HDC hDc, LPRECT lpRect, LPARAM lP
devMode.dmSize = sizeof(DEVMODE);
EnumDisplaySettings(info.szDevice, ENUM_CURRENT_SETTINGS, &devMode);

DEVICE_SCALE_FACTOR scale;
HRESULT hr = GetScaleFactorForMonitor(hMonitor, &scale);
//DEVICE_SCALE_FACTOR scale;
//HRESULT hr = GetScaleFactorForMonitor(hMonitor, &scale);
MonitorInformation monitorInfo;
monitorInfo.monitorInfo = info;
monitorInfo.hMonitor = hMonitor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ LRESULT CLiveBroadcastingDlg::OnEIDUserJoined(WPARAM wParam, LPARAM lParam)
canvas.uid = wParam;
canvas.view = m_videoWnds[i].GetSafeHwnd();
canvas.renderMode = RENDER_MODE_FIT;
m_videoWnds[i].SetUID(wParam);
//setup remote video in engine to the canvas.
m_rtcEngine->setupRemoteVideo(canvas);
break;
Expand Down

0 comments on commit 6dddc9d

Please sign in to comment.