2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
10 #ifndef WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_WINTESTDLG_H_
11 #define WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_WINTESTDLG_H_
13 #if (_MSC_VER >= 1400)
14 #define PRINT_GET_RESULT(...) \
16 _strMsg.Format(__VA_ARGS__); \
17 SetDlgItemText(IDC_EDIT_GET_OUTPUT, _strMsg); \
20 #define TEST(x, ...) \
23 _strMsg.Format(__VA_ARGS__); \
24 SetDlgItemText(IDC_EDIT_MESSAGE, _strMsg); \
25 _strErr.Format(_T("FAILED (error=%d)"), _veBasePtr->LastError()); \
26 SetDlgItemText(IDC_EDIT_RESULT, _strErr); \
28 SetDlgItemInt(IDC_EDIT_N_FAILS, _failCount); \
29 SetDlgItemInt(IDC_EDIT_LAST_ERROR, _veBasePtr->LastError()); \
33 _strMsg.Format(__VA_ARGS__); \
34 SetDlgItemText(IDC_EDIT_MESSAGE, _strMsg); \
35 SetDlgItemText(IDC_EDIT_RESULT, _T("OK")); \
38 #define TEST2(x, ...) \
41 _strMsg.Format(__VA_ARGS__); \
42 ((CWinTestDlg*)_parentDialogPtr)->UpdateTest(true, _strMsg); \
46 _strMsg.Format(__VA_ARGS__); \
47 ((CWinTestDlg*)_parentDialogPtr)->UpdateTest(false, _strMsg); \
50 #define TEST(x, exp) \
53 _strMsg.Format(exp); \
54 SetDlgItemText(IDC_EDIT_MESSAGE, _strMsg); \
55 _strErr.Format("FAILED (error=%d)", _veBasePtr->LastError()); \
56 SetDlgItemText(IDC_EDIT_RESULT, _strErr); \
58 SetDlgItemInt(IDC_EDIT_N_FAILS, _failCount); \
59 SetDlgItemInt(IDC_EDIT_LAST_ERROR, _veBasePtr->LastError()); \
63 _strMsg.Format(exp); \
64 SetDlgItemText(IDC_EDIT_MESSAGE, _strMsg); \
65 SetDlgItemText(IDC_EDIT_RESULT, _T("OK")); \
68 #define TEST2(x, exp) \
71 _strMsg.Format(exp); \
72 ((CWinTestDlg*)_parentDialogPtr)->UpdateTest(true, _strMsg); \
76 _strMsg.Format(exp); \
77 ((CWinTestDlg*)_parentDialogPtr)->UpdateTest(false, _strMsg); \
83 #include "webrtc/voice_engine/include/voe_base.h"
84 #include "webrtc/voice_engine/include/voe_codec.h"
85 #include "webrtc/voice_engine/include/voe_dtmf.h"
86 #include "webrtc/voice_engine/include/voe_external_media.h"
87 #include "webrtc/voice_engine/include/voe_file.h"
88 #include "webrtc/voice_engine/include/voe_hardware.h"
89 #include "webrtc/voice_engine/include/voe_network.h"
90 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
91 #include "webrtc/voice_engine/include/voe_video_sync.h"
92 #include "webrtc/voice_engine/include/voe_volume_control.h"
94 #include "webrtc/voice_engine/include/voe_audio_processing.h"
95 #include "webrtc/voice_engine/include/voe_errors.h"
96 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
98 class MediaProcessImpl;
102 using namespace webrtc;
104 #define MAX_NUM_OF_CHANNELS 10
106 // CWinTestDlg dialog
107 class CWinTestDlg : public CDialog,
108 public VoiceEngineObserver,
109 public VoERTPObserver
113 CWinTestDlg(CWnd* pParent = NULL); // standard constructor
114 virtual ~CWinTestDlg();
117 enum { IDD = IDD_WINTEST_DIALOG };
119 BOOL UpdateTest(bool failed, const CString& strMsg);
122 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
124 protected: // VoiceEngineObserver
125 virtual void CallbackOnError(int channel, int errCode);
127 protected: // VoERTPObserver
128 virtual void OnIncomingCSRCChanged(
129 int channel, unsigned int CSRC, bool added);
130 virtual void OnIncomingSSRCChanged(
131 int channel, unsigned int SSRC);
137 // Generated message map functions
138 virtual BOOL OnInitDialog();
139 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
140 afx_msg void OnPaint();
141 afx_msg HCURSOR OnQueryDragIcon();
142 DECLARE_MESSAGE_MAP()
144 afx_msg void OnBnClickedButtonCreate1();
145 afx_msg void OnBnClickedButtonDelete1();
150 VoECodec* _veCodecPtr;
151 VoEExternalMedia* _veExternalMediaPtr;
152 VoEVolumeControl* _veVolumeControlPtr;
153 VoEHardware* _veHardwarePtr;
154 VoEVideoSync* _veVideoSyncPtr;
155 VoENetwork* _veNetworkPtr;
157 VoEAudioProcessing* _veApmPtr;
159 VoERTP_RTCP* _veRtpRtcpPtr;
161 MyTransport* _transportPtr;
162 MediaProcessImpl* _externalMediaPtr;
163 RxCallback* _rxVadObserverPtr;
169 bool _externalTransport;
170 bool _externalTransportBuild;
171 int _checkPlayFileIn;
172 int _checkPlayFileIn1;
173 int _checkPlayFileIn2;
174 int _checkPlayFileOut1;
175 int _checkPlayFileOut2;
187 int _checkConference1;
188 int _checkConference2;
191 bool _delayEstimate1;
192 bool _delayEstimate2;
194 int _nErrorCallbacks;
196 std::string _long_audio_file_path;
199 afx_msg void OnBnClickedButtonCreate2();
200 afx_msg void OnBnClickedButtonDelete2();
201 afx_msg void OnCbnSelchangeComboCodec1();
202 afx_msg void OnBnClickedButtonStartListen1();
203 afx_msg void OnBnClickedButtonStopListen1();
204 afx_msg void OnBnClickedButtonStartPlayout1();
205 afx_msg void OnBnClickedButtonStopPlayout1();
206 afx_msg void OnBnClickedButtonStartSend1();
207 afx_msg void OnBnClickedButtonStopSend1();
208 afx_msg void OnCbnSelchangeComboIp2();
209 afx_msg void OnCbnSelchangeComboIp1();
210 afx_msg void OnCbnSelchangeComboCodec2();
211 afx_msg void OnBnClickedButtonStartListen2();
212 afx_msg void OnBnClickedButtonStopListen2();
213 afx_msg void OnBnClickedButtonStartPlayout2();
214 afx_msg void OnBnClickedButtonStopPlayout2();
215 afx_msg void OnBnClickedButtonStartSend2();
216 afx_msg void OnBnClickedButtonStopSend2();
217 afx_msg void OnBnClickedButtonTest11();
218 afx_msg void OnBnClickedCheckExtTrans1();
219 afx_msg void OnBnClickedCheckPlayFileIn1();
220 afx_msg void OnBnClickedCheckPlayFileOut1();
221 afx_msg void OnBnClickedCheckExtTrans2();
222 afx_msg void OnBnClickedCheckPlayFileIn2();
223 afx_msg void OnBnClickedCheckPlayFileOut2();
224 afx_msg void OnBnClickedCheckPlayFileIn();
225 afx_msg void OnBnClickedCheckPlayFileOut();
226 afx_msg void OnCbnSelchangeComboRecDevice();
227 afx_msg void OnCbnSelchangeComboPlayDevice();
228 afx_msg void OnBnClickedCheckExtMediaIn1();
229 afx_msg void OnBnClickedCheckExtMediaOut1();
230 afx_msg void OnNMReleasedcaptureSliderInputVolume(NMHDR *pNMHDR, LRESULT *pResult);
231 afx_msg void OnNMReleasedcaptureSliderOutputVolume(NMHDR *pNMHDR, LRESULT *pResult);
232 afx_msg void OnTimer(UINT_PTR nIDEvent);
233 afx_msg void OnBnClickedCheckAgc();
234 CString _strComboIp1;
235 CString _strComboIp2;
236 afx_msg void OnBnClickedCheckNs();
237 afx_msg void OnBnClickedCheckEc();
238 afx_msg void OnBnClickedCheckVad1();
239 afx_msg void OnBnClickedCheckVad2();
240 afx_msg void OnBnClickedCheckExtMediaIn2();
241 afx_msg void OnBnClickedCheckExtMediaOut2();
242 afx_msg void OnBnClickedCheckMuteIn();
243 afx_msg void OnBnClickedCheckMuteIn1();
244 afx_msg void OnBnClickedCheckMuteIn2();
245 afx_msg void OnBnClickedCheckSrtpTx1();
246 afx_msg void OnBnClickedCheckSrtpRx1();
247 afx_msg void OnBnClickedCheckSrtpTx2();
248 afx_msg void OnBnClickedCheckSrtpRx2();
249 afx_msg void OnBnClickedButtonDtmf1();
250 afx_msg void OnBnClickedCheckRecMic();
251 afx_msg void OnBnClickedButtonDtmf2();
252 afx_msg void OnBnClickedButtonTest1();
253 afx_msg void OnBnClickedCheckConference1();
254 afx_msg void OnBnClickedCheckConference2();
255 afx_msg void OnBnClickedCheckOnHold1();
256 afx_msg void OnBnClickedCheckOnHold2();
257 afx_msg void OnBnClickedCheckExtMediaIn();
258 afx_msg void OnBnClickedCheckExtMediaOut();
259 afx_msg void OnLbnSelchangeListCodec1();
260 afx_msg void OnNMReleasedcaptureSliderPanLeft(NMHDR *pNMHDR, LRESULT *pResult);
261 afx_msg void OnNMReleasedcaptureSliderPanRight(NMHDR *pNMHDR, LRESULT *pResult);
262 afx_msg void OnBnClickedButtonVersion();
263 afx_msg void OnBnClickedCheckDelayEstimate1();
264 afx_msg void OnBnClickedCheckRxvad();
265 afx_msg void OnBnClickedCheckAgc1();
266 afx_msg void OnBnClickedCheckNs1();
267 afx_msg void OnBnClickedCheckRecCall();
268 afx_msg void OnBnClickedCheckTypingDetection();
269 afx_msg void OnBnClickedCheckRED();
270 afx_msg void OnBnClickedButtonClearErrorCallback();
271 afx_msg void OnBnClickedCheckBwe1();
274 #endif // WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_WINTESTDLG_H_