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;
99 class ConnectionObserver;
103 using namespace webrtc;
105 #define MAX_NUM_OF_CHANNELS 10
107 // CWinTestDlg dialog
108 class CWinTestDlg : public CDialog,
109 public VoiceEngineObserver,
110 public VoERTPObserver
114 CWinTestDlg(CWnd* pParent = NULL); // standard constructor
115 virtual ~CWinTestDlg();
118 enum { IDD = IDD_WINTEST_DIALOG };
120 BOOL UpdateTest(bool failed, const CString& strMsg);
123 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
125 protected: // VoiceEngineObserver
126 virtual void CallbackOnError(int channel, int errCode);
128 protected: // VoERTPObserver
129 virtual void OnIncomingCSRCChanged(
130 int channel, unsigned int CSRC, bool added);
131 virtual void OnIncomingSSRCChanged(
132 int channel, unsigned int SSRC);
138 // Generated message map functions
139 virtual BOOL OnInitDialog();
140 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
141 afx_msg void OnPaint();
142 afx_msg HCURSOR OnQueryDragIcon();
143 DECLARE_MESSAGE_MAP()
145 afx_msg void OnBnClickedButtonCreate1();
146 afx_msg void OnBnClickedButtonDelete1();
151 VoECodec* _veCodecPtr;
152 VoEExternalMedia* _veExternalMediaPtr;
153 VoEVolumeControl* _veVolumeControlPtr;
154 VoEHardware* _veHardwarePtr;
155 VoEVideoSync* _veVideoSyncPtr;
156 VoENetwork* _veNetworkPtr;
158 VoEAudioProcessing* _veApmPtr;
160 VoERTP_RTCP* _veRtpRtcpPtr;
162 MyTransport* _transportPtr;
163 MediaProcessImpl* _externalMediaPtr;
164 ConnectionObserver* _connectionObserverPtr;
165 RxCallback* _rxVadObserverPtr;
171 bool _externalTransport;
172 bool _externalTransportBuild;
173 int _checkPlayFileIn;
174 int _checkPlayFileIn1;
175 int _checkPlayFileIn2;
176 int _checkPlayFileOut1;
177 int _checkPlayFileOut2;
189 int _checkConference1;
190 int _checkConference2;
193 bool _delayEstimate1;
194 bool _delayEstimate2;
196 int _nErrorCallbacks;
198 std::string _long_audio_file_path;
201 afx_msg void OnBnClickedButtonCreate2();
202 afx_msg void OnBnClickedButtonDelete2();
203 afx_msg void OnCbnSelchangeComboCodec1();
204 afx_msg void OnBnClickedButtonStartListen1();
205 afx_msg void OnBnClickedButtonStopListen1();
206 afx_msg void OnBnClickedButtonStartPlayout1();
207 afx_msg void OnBnClickedButtonStopPlayout1();
208 afx_msg void OnBnClickedButtonStartSend1();
209 afx_msg void OnBnClickedButtonStopSend1();
210 afx_msg void OnCbnSelchangeComboIp2();
211 afx_msg void OnCbnSelchangeComboIp1();
212 afx_msg void OnCbnSelchangeComboCodec2();
213 afx_msg void OnBnClickedButtonStartListen2();
214 afx_msg void OnBnClickedButtonStopListen2();
215 afx_msg void OnBnClickedButtonStartPlayout2();
216 afx_msg void OnBnClickedButtonStopPlayout2();
217 afx_msg void OnBnClickedButtonStartSend2();
218 afx_msg void OnBnClickedButtonStopSend2();
219 afx_msg void OnBnClickedButtonTest11();
220 afx_msg void OnBnClickedCheckExtTrans1();
221 afx_msg void OnBnClickedCheckPlayFileIn1();
222 afx_msg void OnBnClickedCheckPlayFileOut1();
223 afx_msg void OnBnClickedCheckExtTrans2();
224 afx_msg void OnBnClickedCheckPlayFileIn2();
225 afx_msg void OnBnClickedCheckPlayFileOut2();
226 afx_msg void OnBnClickedCheckPlayFileIn();
227 afx_msg void OnBnClickedCheckPlayFileOut();
228 afx_msg void OnCbnSelchangeComboRecDevice();
229 afx_msg void OnCbnSelchangeComboPlayDevice();
230 afx_msg void OnBnClickedCheckExtMediaIn1();
231 afx_msg void OnBnClickedCheckExtMediaOut1();
232 afx_msg void OnNMReleasedcaptureSliderInputVolume(NMHDR *pNMHDR, LRESULT *pResult);
233 afx_msg void OnNMReleasedcaptureSliderOutputVolume(NMHDR *pNMHDR, LRESULT *pResult);
234 afx_msg void OnTimer(UINT_PTR nIDEvent);
235 afx_msg void OnBnClickedCheckAgc();
236 CString _strComboIp1;
237 CString _strComboIp2;
238 afx_msg void OnBnClickedCheckNs();
239 afx_msg void OnBnClickedCheckEc();
240 afx_msg void OnBnClickedCheckVad1();
241 afx_msg void OnBnClickedCheckVad2();
242 afx_msg void OnBnClickedCheckExtMediaIn2();
243 afx_msg void OnBnClickedCheckExtMediaOut2();
244 afx_msg void OnBnClickedCheckMuteIn();
245 afx_msg void OnBnClickedCheckMuteIn1();
246 afx_msg void OnBnClickedCheckMuteIn2();
247 afx_msg void OnBnClickedCheckSrtpTx1();
248 afx_msg void OnBnClickedCheckSrtpRx1();
249 afx_msg void OnBnClickedCheckSrtpTx2();
250 afx_msg void OnBnClickedCheckSrtpRx2();
251 afx_msg void OnBnClickedButtonDtmf1();
252 afx_msg void OnBnClickedCheckRecMic();
253 afx_msg void OnBnClickedButtonDtmf2();
254 afx_msg void OnBnClickedButtonTest1();
255 afx_msg void OnBnClickedCheckConference1();
256 afx_msg void OnBnClickedCheckConference2();
257 afx_msg void OnBnClickedCheckOnHold1();
258 afx_msg void OnBnClickedCheckOnHold2();
259 afx_msg void OnBnClickedCheckExtMediaIn();
260 afx_msg void OnBnClickedCheckExtMediaOut();
261 afx_msg void OnLbnSelchangeListCodec1();
262 afx_msg void OnNMReleasedcaptureSliderPanLeft(NMHDR *pNMHDR, LRESULT *pResult);
263 afx_msg void OnNMReleasedcaptureSliderPanRight(NMHDR *pNMHDR, LRESULT *pResult);
264 afx_msg void OnBnClickedButtonVersion();
265 afx_msg void OnBnClickedCheckDelayEstimate1();
266 afx_msg void OnBnClickedCheckRxvad();
267 afx_msg void OnBnClickedCheckAgc1();
268 afx_msg void OnBnClickedCheckNs1();
269 afx_msg void OnBnClickedCheckRecCall();
270 afx_msg void OnBnClickedCheckTypingDetection();
271 afx_msg void OnBnClickedCheckFEC();
272 afx_msg void OnBnClickedButtonClearErrorCallback();
273 afx_msg void OnBnClickedCheckBwe1();
276 #endif // WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_WINTESTDLG_H_