diff --git a/talk/media/webrtc/fakewebrtcvoiceengine.h b/talk/media/webrtc/fakewebrtcvoiceengine.h
index 910889f..673e3e0 100644
--- a/talk/media/webrtc/fakewebrtcvoiceengine.h
+++ b/talk/media/webrtc/fakewebrtcvoiceengine.h
@@ -512,8 +512,6 @@
   }
   WEBRTC_STUB(GetVersion, (char version[1024]));
   WEBRTC_STUB(LastError, ());
-  WEBRTC_STUB(SetOnHoldStatus, (int, bool, webrtc::OnHoldModes));
-  WEBRTC_STUB(GetOnHoldStatus, (int, bool&, webrtc::OnHoldModes&));
   WEBRTC_FUNC(AssociateSendChannel, (int channel,
                                      int accociate_send_channel)) {
     WEBRTC_CHECK_CHANNEL(channel);
@@ -577,14 +575,6 @@
     }
     return -1;
   }
-  WEBRTC_STUB(SetAMREncFormat, (int channel, webrtc::AmrMode mode));
-  WEBRTC_STUB(SetAMRDecFormat, (int channel, webrtc::AmrMode mode));
-  WEBRTC_STUB(SetAMRWbEncFormat, (int channel, webrtc::AmrMode mode));
-  WEBRTC_STUB(SetAMRWbDecFormat, (int channel, webrtc::AmrMode mode));
-  WEBRTC_STUB(SetISACInitTargetRate, (int channel, int rateBps,
-                                      bool useFixedFrameSize));
-  WEBRTC_STUB(SetISACMaxRate, (int channel, int rateBps));
-  WEBRTC_STUB(SetISACMaxPayloadSize, (int channel, int sizeBytes));
   WEBRTC_FUNC(SetRecPayloadType, (int channel,
                                   const webrtc::CodecInst& codec)) {
     WEBRTC_CHECK_CHANNEL(channel);
@@ -722,9 +712,6 @@
     dtmf_info_.dtmf_length_ms = length_ms;
     return 0;
   }
-  WEBRTC_STUB(StartPlayingDtmfTone,
-      (int eventCode, int attenuationDb = 10));
-  WEBRTC_STUB(StopPlayingDtmfTone, ());
 
   // webrtc::VoEFile
   WEBRTC_FUNC(StartPlayingFileLocally, (int channel, const char* fileNameUTF8,
@@ -752,7 +739,6 @@
     WEBRTC_CHECK_CHANNEL(channel);
     return (channels_[channel]->file) ? 1 : 0;
   }
-  WEBRTC_STUB(ScaleLocalFilePlayout, (int channel, float scale));
   WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel,
                                              const char* fileNameUTF8,
                                              bool loop,
@@ -766,7 +752,6 @@
                                              float volumeScaling));
   WEBRTC_STUB(StopPlayingFileAsMicrophone, (int channel));
   WEBRTC_STUB(IsPlayingFileAsMicrophone, (int channel));
-  WEBRTC_STUB(ScaleFileAsMicrophonePlayout, (int channel, float scale));
   WEBRTC_STUB(StartRecordingPlayout, (int channel, const char* fileNameUTF8,
                                       webrtc::CodecInst* compression,
                                       int maxSizeBytes));
@@ -797,30 +782,8 @@
     recording_microphone_ = false;
     return 0;
   }
-  WEBRTC_STUB(ConvertPCMToWAV, (const char* fileNameInUTF8,
-                                const char* fileNameOutUTF8));
-  WEBRTC_STUB(ConvertPCMToWAV, (webrtc::InStream* streamIn,
-                                webrtc::OutStream* streamOut));
-  WEBRTC_STUB(ConvertWAVToPCM, (const char* fileNameInUTF8,
-                                const char* fileNameOutUTF8));
-  WEBRTC_STUB(ConvertWAVToPCM, (webrtc::InStream* streamIn,
-                                webrtc::OutStream* streamOut));
-  WEBRTC_STUB(ConvertPCMToCompressed, (const char* fileNameInUTF8,
-                                       const char* fileNameOutUTF8,
-                                       webrtc::CodecInst* compression));
-  WEBRTC_STUB(ConvertPCMToCompressed, (webrtc::InStream* streamIn,
-                                       webrtc::OutStream* streamOut,
-                                       webrtc::CodecInst* compression));
-  WEBRTC_STUB(ConvertCompressedToPCM, (const char* fileNameInUTF8,
-                                     const char* fileNameOutUTF8));
-  WEBRTC_STUB(ConvertCompressedToPCM, (webrtc::InStream* streamIn,
-                                       webrtc::OutStream* streamOut));
-  WEBRTC_STUB(GetFileDuration, (const char* fileNameUTF8, int& durationMs,
-                                webrtc::FileFormats format));
-  WEBRTC_STUB(GetPlaybackPosition, (int channel, int& positionMs));
 
   // webrtc::VoEHardware
-  WEBRTC_STUB(GetCPULoad, (int&));
   WEBRTC_FUNC(GetNumOfRecordingDevices, (int& num)) {
     return GetNumDevices(num);
   }
@@ -837,12 +800,6 @@
   WEBRTC_STUB(SetPlayoutDevice, (int));
   WEBRTC_STUB(SetAudioDeviceLayer, (webrtc::AudioLayers));
   WEBRTC_STUB(GetAudioDeviceLayer, (webrtc::AudioLayers&));
-  WEBRTC_STUB(GetPlayoutDeviceStatus, (bool&));
-  WEBRTC_STUB(GetRecordingDeviceStatus, (bool&));
-  WEBRTC_STUB(ResetAudioDevice, ());
-  WEBRTC_STUB(AudioDeviceControl, (unsigned int, unsigned int, unsigned int));
-  WEBRTC_STUB(SetLoudspeakerStatus, (bool enable));
-  WEBRTC_STUB(GetLoudspeakerStatus, (bool& enabled));
   WEBRTC_FUNC(SetRecordingSampleRate, (unsigned int samples_per_sec)) {
     recording_sample_rate_ = samples_per_sec;
     return 0;
@@ -860,7 +817,6 @@
     return 0;
   }
   WEBRTC_STUB(EnableBuiltInAEC, (bool enable));
-  virtual bool BuiltInAECIsEnabled() const { return true; }
   virtual bool BuiltInAECIsAvailable() const { return false; }
 
   // webrtc::VoENetEqStats
@@ -912,9 +868,6 @@
                                    size_t length));
 
   // webrtc::VoERTP_RTCP
-  WEBRTC_STUB(RegisterRTPObserver, (int channel,
-                                    webrtc::VoERTPObserver& observer));
-  WEBRTC_STUB(DeRegisterRTPObserver, (int channel));
   WEBRTC_FUNC(SetLocalSSRC, (int channel, unsigned int ssrc)) {
     WEBRTC_CHECK_CHANNEL(channel);
     channels_[channel]->send_ssrc = ssrc;
@@ -955,7 +908,6 @@
     return 0;
   }
 
-  WEBRTC_STUB(GetRemoteCSRCs, (int channel, unsigned int arrCSRC[15]));
   WEBRTC_STUB(SetRTCPStatus, (int channel, bool enable));
   WEBRTC_STUB(GetRTCPStatus, (int channel, bool& enabled));
   WEBRTC_STUB(SetRTCP_CNAME, (int channel, const char cname[256]));
@@ -967,8 +919,6 @@
                                   unsigned int& playoutTimestamp,
                                   unsigned int* jitter,
                                   unsigned short* fractionLost));
-  WEBRTC_STUB(GetRemoteRTCPSenderInfo, (int channel,
-                                        webrtc::SenderInfo* sender_info));
   WEBRTC_FUNC(GetRemoteRTCPReportBlocks,
               (int channel, std::vector<webrtc::ReportBlock>* receive_blocks)) {
     WEBRTC_CHECK_CHANNEL(channel);
@@ -986,11 +936,6 @@
     }
     return 0;
   }
-  WEBRTC_STUB(SendApplicationDefinedRTCPPacket, (int channel,
-                                                 unsigned char subType,
-                                                 unsigned int name,
-                                                 const char* data,
-                                                 unsigned short dataLength));
   WEBRTC_STUB(GetRTPStatistics, (int channel, unsigned int& averageJitterMs,
                                  unsigned int& maxJitterMs,
                                  unsigned int& discardedPackets));
@@ -1035,11 +980,6 @@
     channels_[channel]->nack_max_packets = maxNoPackets;
     return 0;
   }
-  WEBRTC_STUB(InsertExtraRTPPacket, (int channel, unsigned char payloadType,
-                                     bool markerBit, const char* payloadData,
-                                     unsigned short payloadSize));
-  WEBRTC_STUB(GetLastRemoteTimeStamp, (int channel,
-                                       uint32_t* lastRemoteTimeStamp));
 
   // webrtc::VoEVideoSync
   WEBRTC_STUB(GetPlayoutBufferSize, (int& bufferMs));
@@ -1056,14 +996,10 @@
   // webrtc::VoEVolumeControl
   WEBRTC_STUB(SetSpeakerVolume, (unsigned int));
   WEBRTC_STUB(GetSpeakerVolume, (unsigned int&));
-  WEBRTC_STUB(SetSystemOutputMute, (bool));
-  WEBRTC_STUB(GetSystemOutputMute, (bool&));
   WEBRTC_STUB(SetMicVolume, (unsigned int));
   WEBRTC_STUB(GetMicVolume, (unsigned int&));
   WEBRTC_STUB(SetInputMute, (int, bool));
   WEBRTC_STUB(GetInputMute, (int, bool&));
-  WEBRTC_STUB(SetSystemInputMute, (bool));
-  WEBRTC_STUB(GetSystemInputMute, (bool&));
   WEBRTC_STUB(GetSpeechInputLevel, (unsigned int&));
   WEBRTC_STUB(GetSpeechOutputLevel, (int, unsigned int&));
   WEBRTC_STUB(GetSpeechInputLevelFullRange, (unsigned int&));
@@ -1249,14 +1185,6 @@
     media_processor_ = NULL;
     return 0;
   }
-  WEBRTC_STUB(SetExternalRecordingStatus, (bool enable));
-  WEBRTC_STUB(SetExternalPlayoutStatus, (bool enable));
-  WEBRTC_STUB(ExternalRecordingInsertData,
-              (const int16_t speechData10ms[], int lengthSamples,
-               int samplingFreqHz, int current_delay_ms));
-  WEBRTC_STUB(ExternalPlayoutGetData,
-              (int16_t speechData10ms[], int samplingFreqHz,
-               int current_delay_ms, int& lengthSamples));
   WEBRTC_STUB(GetAudioFrame, (int channel, int desired_sample_rate_hz,
                               webrtc::AudioFrame* frame));
   WEBRTC_STUB(SetExternalMixing, (int channel, bool enable));
diff --git a/webrtc/examples/android/media_demo/jni/voice_engine_jni.cc b/webrtc/examples/android/media_demo/jni/voice_engine_jni.cc
index bb5eeed..79d6cbc 100644
--- a/webrtc/examples/android/media_demo/jni/voice_engine_jni.cc
+++ b/webrtc/examples/android/media_demo/jni/voice_engine_jni.cc
@@ -273,12 +273,6 @@
   return voe_data->volume->SetSpeakerVolume(level);
 }
 
-JOWW(jint, VoiceEngine_setLoudspeakerStatus)(JNIEnv* jni, jobject j_voe,
-                                             jboolean enable) {
-  VoiceEngineData* voe_data = GetVoiceEngineData(jni, j_voe);
-  return voe_data->hardware->SetLoudspeakerStatus(enable);
-}
-
 JOWW(jint, VoiceEngine_startPlayingFileLocally)(JNIEnv* jni, jobject j_voe,
                                                 jint channel,
                                                 jstring j_filename,
diff --git a/webrtc/voice_engine/include/voe_base.h b/webrtc/voice_engine/include/voe_base.h
index 1d8c7f4..c82ad3d 100644
--- a/webrtc/voice_engine/include/voe_base.h
+++ b/webrtc/voice_engine/include/voe_base.h
@@ -181,18 +181,7 @@
   // Used for obtaining RTT for a receive-only channel.
   // One should be careful not to crate a circular association, e.g.,
   // 1 <- 2 <- 1.
-  virtual int AssociateSendChannel(int channel, int accociate_send_channel) =
-      0;
-
-  // To be removed. Don't use.
-  virtual int SetOnHoldStatus(int channel,
-                              bool enable,
-                              OnHoldModes mode = kHoldSendAndPlay) {
-    return -1;
-  }
-  virtual int GetOnHoldStatus(int channel, bool& enabled, OnHoldModes& mode) {
-    return -1;
-  }
+  virtual int AssociateSendChannel(int channel, int accociate_send_channel) = 0;
 
  protected:
   VoEBase() {}
diff --git a/webrtc/voice_engine/include/voe_codec.h b/webrtc/voice_engine/include/voe_codec.h
index dc3b88c..5d94ac2 100644
--- a/webrtc/voice_engine/include/voe_codec.h
+++ b/webrtc/voice_engine/include/voe_codec.h
@@ -131,19 +131,6 @@
   // success, and -1 if failed.
   virtual int SetOpusDtx(int channel, bool enable_dtx) = 0;
 
-  // Don't use. To be removed.
-  virtual int SetAMREncFormat(int channel, AmrMode mode) { return -1; }
-  virtual int SetAMRDecFormat(int channel, AmrMode mode) { return -1; }
-  virtual int SetAMRWbEncFormat(int channel, AmrMode mode) { return -1; }
-  virtual int SetAMRWbDecFormat(int channel, AmrMode mode) { return -1; }
-  virtual int SetISACInitTargetRate(int channel,
-                                    int rateBps,
-                                    bool useFixedFrameSize = false) {
-    return -1;
-  }
-  virtual int SetISACMaxRate(int channel, int rateBps) { return -1; }
-  virtual int SetISACMaxPayloadSize(int channel, int sizeBytes) { return -1; }
-
  protected:
   VoECodec() {}
   virtual ~VoECodec() {}
diff --git a/webrtc/voice_engine/include/voe_dtmf.h b/webrtc/voice_engine/include/voe_dtmf.h
index 64d758d..c8ef5d0 100644
--- a/webrtc/voice_engine/include/voe_dtmf.h
+++ b/webrtc/voice_engine/include/voe_dtmf.h
@@ -82,12 +82,6 @@
                            int lengthMs = 200,
                            int attenuationDb = 10) = 0;
 
-  // To be removed. Don't use.
-  virtual int StartPlayingDtmfTone(int eventCode, int attenuationDb = 10) {
-    return -1;
-  }
-  virtual int StopPlayingDtmfTone() { return -1; }
-
  protected:
   VoEDtmf() {}
   virtual ~VoEDtmf() {}
diff --git a/webrtc/voice_engine/include/voe_external_media.h b/webrtc/voice_engine/include/voe_external_media.h
index 48c564b..6185540 100644
--- a/webrtc/voice_engine/include/voe_external_media.h
+++ b/webrtc/voice_engine/include/voe_external_media.h
@@ -75,22 +75,6 @@
   // Sets the state of external mixing. Cannot be changed during playback.
   virtual int SetExternalMixing(int channel, bool enable) = 0;
 
-  // Don't use. To be removed.
-  virtual int SetExternalRecordingStatus(bool enable) { return -1; }
-  virtual int SetExternalPlayoutStatus(bool enable) { return -1; }
-  virtual int ExternalRecordingInsertData(const int16_t speechData10ms[],
-                                          int lengthSamples,
-                                          int samplingFreqHz,
-                                          int current_delay_ms) {
-    return -1;
-  }
-  virtual int ExternalPlayoutGetData(int16_t speechData10ms[],
-                                     int samplingFreqHz,
-                                     int current_delay_ms,
-                                     int& lengthSamples) {
-    return -1;
-  }
-
  protected:
   VoEExternalMedia() {}
   virtual ~VoEExternalMedia() {}
diff --git a/webrtc/voice_engine/include/voe_file.h b/webrtc/voice_engine/include/voe_file.h
index e48a535..f3a3a1f 100644
--- a/webrtc/voice_engine/include/voe_file.h
+++ b/webrtc/voice_engine/include/voe_file.h
@@ -134,49 +134,6 @@
   // Stops recording the microphone signal.
   virtual int StopRecordingMicrophone() = 0;
 
-  // Don't use. To be removed.
-  virtual int ScaleLocalFilePlayout(int channel, float scale) { return -1; }
-  virtual int ScaleFileAsMicrophonePlayout(int channel, float scale) {
-    return -1;
-  }
-  virtual int GetFileDuration(const char* fileNameUTF8,
-                              int& durationMs,
-                              FileFormats format = kFileFormatPcm16kHzFile) {
-    return -1;
-  }
-  virtual int GetPlaybackPosition(int channel, int& positionMs) { return -1; }
-  virtual int ConvertPCMToWAV(const char* fileNameInUTF8,
-                              const char* fileNameOutUTF8) {
-    return -1;
-  }
-  virtual int ConvertPCMToWAV(InStream* streamIn, OutStream* streamOut) {
-    return -1;
-  }
-  virtual int ConvertWAVToPCM(const char* fileNameInUTF8,
-                              const char* fileNameOutUTF8) {
-    return -1;
-  }
-  virtual int ConvertWAVToPCM(InStream* streamIn, OutStream* streamOut) {
-    return -1;
-  }
-  virtual int ConvertPCMToCompressed(const char* fileNameInUTF8,
-                                     const char* fileNameOutUTF8,
-                                     CodecInst* compression) {
-    return -1;
-  }
-  virtual int ConvertPCMToCompressed(InStream* streamIn,
-                                     OutStream* streamOut,
-                                     CodecInst* compression) {
-    return -1;
-  }
-  virtual int ConvertCompressedToPCM(const char* fileNameInUTF8,
-                                     const char* fileNameOutUTF8) {
-    return -1;
-  }
-  virtual int ConvertCompressedToPCM(InStream* streamIn, OutStream* streamOut) {
-    return -1;
-  }
-
  protected:
   VoEFile() {}
   virtual ~VoEFile() {}
diff --git a/webrtc/voice_engine/include/voe_hardware.h b/webrtc/voice_engine/include/voe_hardware.h
index 1c6b7fc..a75230c 100644
--- a/webrtc/voice_engine/include/voe_hardware.h
+++ b/webrtc/voice_engine/include/voe_hardware.h
@@ -94,20 +94,6 @@
   virtual bool BuiltInAECIsAvailable() const = 0;
   virtual int EnableBuiltInAEC(bool enable) = 0;
 
-  // To be removed. Don't use.
-  virtual bool BuiltInAECIsEnabled() const { return false; }
-  virtual int GetRecordingDeviceStatus(bool& isAvailable) { return -1; }
-  virtual int GetPlayoutDeviceStatus(bool& isAvailable) { return -1; }
-  virtual int ResetAudioDevice() { return -1; }
-  virtual int AudioDeviceControl(unsigned int par1,
-                                 unsigned int par2,
-                                 unsigned int par3) {
-    return -1;
-  }
-  virtual int SetLoudspeakerStatus(bool enable) { return -1; }
-  virtual int GetLoudspeakerStatus(bool& enabled) { return -1; }
-  virtual int GetCPULoad(int& loadPercent) { return -1; }
-
  protected:
   VoEHardware() {}
   virtual ~VoEHardware() {}
diff --git a/webrtc/voice_engine/include/voe_rtp_rtcp.h b/webrtc/voice_engine/include/voe_rtp_rtcp.h
index ce96581..6d17501 100644
--- a/webrtc/voice_engine/include/voe_rtp_rtcp.h
+++ b/webrtc/voice_engine/include/voe_rtp_rtcp.h
@@ -221,37 +221,6 @@
   // If using NACK, NACK should be enabled on both endpoints in a call.
   virtual int SetNACKStatus(int channel, bool enable, int maxNoPackets) = 0;
 
-  // Will be removed. Don't use.
-  virtual int RegisterRTPObserver(int channel, VoERTPObserver& observer) {
-    return -1;
-  };
-  virtual int DeRegisterRTPObserver(int channel) { return -1; };
-  virtual int GetRemoteCSRCs(int channel, unsigned int arrCSRC[15]) {
-    return -1;
-  };
-  virtual int InsertExtraRTPPacket(int channel,
-                                   unsigned char payloadType,
-                                   bool markerBit,
-                                   const char* payloadData,
-                                   unsigned short payloadSize) {
-    return -1;
-  };
-  virtual int GetRemoteRTCPSenderInfo(int channel, SenderInfo* sender_info) {
-    return -1;
-  };
-  virtual int SendApplicationDefinedRTCPPacket(
-      int channel,
-      unsigned char subType,
-      unsigned int name,
-      const char* data,
-      unsigned short dataLengthInBytes) {
-    return -1;
-  };
-  virtual int GetLastRemoteTimeStamp(int channel,
-                                     uint32_t* lastRemoteTimeStamp) {
-    return -1;
-  };
-
  protected:
   VoERTP_RTCP() {}
   virtual ~VoERTP_RTCP() {}
diff --git a/webrtc/voice_engine/include/voe_volume_control.h b/webrtc/voice_engine/include/voe_volume_control.h
index 6c0bc0a..240ab93 100644
--- a/webrtc/voice_engine/include/voe_volume_control.h
+++ b/webrtc/voice_engine/include/voe_volume_control.h
@@ -104,12 +104,6 @@
   // Gets the current left and right scaling factors.
   virtual int GetOutputVolumePan(int channel, float& left, float& right) = 0;
 
-  // Don't use. Will be removed.
-  virtual int SetSystemOutputMute(bool enable) { return -1; }
-  virtual int GetSystemOutputMute(bool& enabled) { return -1; }
-  virtual int SetSystemInputMute(bool enable) { return -1; }
-  virtual int GetSystemInputMute(bool& enabled) { return -1; }
-
  protected:
   VoEVolumeControl(){};
   virtual ~VoEVolumeControl(){};
diff --git a/webrtc/voice_engine/mock/fake_voe_external_media.h b/webrtc/voice_engine/mock/fake_voe_external_media.h
index ab7f59a..66554ae 100644
--- a/webrtc/voice_engine/mock/fake_voe_external_media.h
+++ b/webrtc/voice_engine/mock/fake_voe_external_media.h
@@ -35,14 +35,6 @@
     callback_map_.erase(type);
     return 0;
   }
-  WEBRTC_STUB(SetExternalRecordingStatus, (bool enable));
-  WEBRTC_STUB(SetExternalPlayoutStatus, (bool enable));
-  WEBRTC_STUB(ExternalRecordingInsertData,
-      (const int16_t speechData10ms[], int lengthSamples,
-       int samplingFreqHz, int current_delay_ms));
-  WEBRTC_STUB(ExternalPlayoutGetData,
-      (int16_t speechData10ms[], int samplingFreqHz,
-       int current_delay_ms, int& lengthSamples));
   WEBRTC_STUB(GetAudioFrame, (int channel, int desired_sample_rate_hz,
                               AudioFrame* frame));
   WEBRTC_STUB(SetExternalMixing, (int channel, bool enable));
diff --git a/webrtc/voice_engine/mock/mock_voe_volume_control.h b/webrtc/voice_engine/mock/mock_voe_volume_control.h
index 20b0969..3511b2f 100644
--- a/webrtc/voice_engine/mock/mock_voe_volume_control.h
+++ b/webrtc/voice_engine/mock/mock_voe_volume_control.h
@@ -23,14 +23,10 @@
   MOCK_METHOD0(Release, int());
   MOCK_METHOD1(SetSpeakerVolume, int(unsigned int volume));
   MOCK_METHOD1(GetSpeakerVolume, int(unsigned int& volume));
-  MOCK_METHOD1(SetSystemOutputMute, int(bool enable));
-  MOCK_METHOD1(GetSystemOutputMute, int(bool &enabled));
   MOCK_METHOD1(SetMicVolume, int(unsigned int volume));
   MOCK_METHOD1(GetMicVolume, int(unsigned int& volume));
   MOCK_METHOD2(SetInputMute, int(int channel, bool enable));
   MOCK_METHOD2(GetInputMute, int(int channel, bool& enabled));
-  MOCK_METHOD1(SetSystemInputMute, int(bool enable));
-  MOCK_METHOD1(GetSystemInputMute, int(bool& enabled));
   MOCK_METHOD1(GetSpeechInputLevel, int(unsigned int& level));
   MOCK_METHOD2(GetSpeechOutputLevel, int(int channel, unsigned int& level));
   MOCK_METHOD1(GetSpeechInputLevelFullRange, int(unsigned int& level));
diff --git a/webrtc/voice_engine/test/android/android_test/jni/android_test.cc b/webrtc/voice_engine/test/android/android_test/jni/android_test.cc
index b0a26e0..ef52439 100644
--- a/webrtc/voice_engine/test/android/android_test/jni/android_test.cc
+++ b/webrtc/voice_engine/test/android/android_test/jni/android_test.cc
@@ -221,7 +221,6 @@
         __android_log_write(ANDROID_LOG_ERROR, WEBRTC_LOG_TAG,
                 "set local receiver 2 failed");
     }
-    veData2.hardware->SetLoudspeakerStatus(false);
     veData2.volume->SetSpeakerVolume(204);
     veData2.base->StartReceive(0);
     if(veData2.base->StartPlayout(0) < 0)
@@ -1115,43 +1114,6 @@
     return 0;
 }
 
-/////////////////////////////////////////////
-// [Hardware] Set loudspeaker status
-//
-JNIEXPORT jint JNICALL
-Java_org_webrtc_voiceengine_test_AndroidTest_SetLoudspeakerStatus(
-        JNIEnv *,
-        jobject,
-        jboolean enable)
-{
-    VALIDATE_HARDWARE_POINTER;
-    if (veData1.hardware->SetLoudspeakerStatus(enable) != 0)
-    {
-        return -1;
-    }
-
-    /*VALIDATE_RTP_RTCP_POINTER;
-
-     if (veData1.rtp_rtcp->SetREDStatus(0, enable, -1) != 0)
-     {
-     __android_log_write(ANDROID_LOG_ERROR, WEBRTC_LOG_TAG,
-         "Could not set RED");
-     return -1;
-     }
-     else if(enable)
-     {
-     __android_log_write(ANDROID_LOG_ERROR, WEBRTC_LOG_TAG,
-         "Could enable RED");
-     }
-     else
-     {
-     __android_log_write(ANDROID_LOG_ERROR, WEBRTC_LOG_TAG,
-         "Could disable RED");
-     }*/
-
-    return 0;
-}
-
 //////////////////////////////////////////////////////////////////
 // "Local" functions (i.e. not Java accessible)
 //////////////////////////////////////////////////////////////////
diff --git a/webrtc/voice_engine/test/android/android_test/jni/org_webrtc_voiceengine_test_AndroidTest.h b/webrtc/voice_engine/test/android/android_test/jni/org_webrtc_voiceengine_test_AndroidTest.h
index 60fe839..34d408a 100644
--- a/webrtc/voice_engine/test/android/android_test/jni/org_webrtc_voiceengine_test_AndroidTest.h
+++ b/webrtc/voice_engine/test/android/android_test/jni/org_webrtc_voiceengine_test_AndroidTest.h
@@ -239,14 +239,6 @@
 JNIEXPORT jint JNICALL Java_org_webrtc_voiceengine_test_AndroidTest_SetSpeakerVolume
   (JNIEnv *, jobject, jint);
 
-/*
- * Class:     org_webrtc_voiceengine_test_AndroidTest
- * Method:    SetLoudspeakerStatus
- * Signature: (Z)I
- */
-JNIEXPORT jint JNICALL Java_org_webrtc_voiceengine_test_AndroidTest_SetLoudspeakerStatus
-  (JNIEnv *, jobject, jboolean);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.cc b/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.cc
index c54d289..efdf633 100644
--- a/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.cc
+++ b/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.cc
@@ -28,11 +28,6 @@
   webrtc::AudioProcessing* audioproc = webrtc::AudioProcessing::Create(config);
 
   EXPECT_EQ(0, voe_base_->Init(NULL, audioproc));
-
-#if defined(WEBRTC_ANDROID)
-  EXPECT_EQ(0, voe_hardware_->SetLoudspeakerStatus(false));
-#endif
-
   EXPECT_EQ(0, voe_base_->RegisterVoiceEngineObserver(*error_observer_));
 }
 
diff --git a/webrtc/voice_engine/test/auto_test/standard/hardware_before_streaming_test.cc b/webrtc/voice_engine/test/auto_test/standard/hardware_before_streaming_test.cc
index 26c949d..a5c13b4 100644
--- a/webrtc/voice_engine/test/auto_test/standard/hardware_before_streaming_test.cc
+++ b/webrtc/voice_engine/test/auto_test/standard/hardware_before_streaming_test.cc
@@ -25,14 +25,6 @@
   EXPECT_EQ(VE_ALREADY_INITED, voe_base_->LastError());
 }
 
-// Tests that only apply to mobile:
-
-#ifdef WEBRTC_IOS
-TEST_F(HardwareBeforeStreamingTest, ResetsAudioDeviceOnIphone) {
-  EXPECT_EQ(0, voe_hardware_->ResetAudioDevice());
-}
-#endif
-
 // Tests that only apply to desktop:
 #if !defined(WEBRTC_IOS) & !defined(WEBRTC_ANDROID)
 
diff --git a/webrtc/voice_engine/test/win_test/Resource.h b/webrtc/voice_engine/test/win_test/Resource.h
deleted file mode 100644
index cd5f55a..0000000
--- a/webrtc/voice_engine/test/win_test/Resource.h
+++ /dev/null
@@ -1,241 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by WinTest.rc
-//
-#define IDM_ABOUTBOX                    0x0010
-#define IDD_ABOUTBOX                    100
-#define IDS_ABOUTBOX                    101
-#define IDD_WINTEST_DIALOG              102
-#define IDR_MAINFRAME                   128
-#define IDD_DTMF_DIALOG                 129
-#define IDC_BUTTON_CREATE_1             1000
-#define IDC_BUTTON_DELETE_1             1001
-#define IDC_EDIT_1                      1002
-#define IDC_BUTTON_CREATE_2             1003
-#define IDC_BUTTON_DELETE_2             1004
-#define IDC_EDIT_2                      1005
-#define IDC_EDIT_MESSAGE                1006
-#define IDC_BUTTON_START_LISTEN_1       1007
-#define IDC_COMBO_IP_1                  1008
-#define IDC_EDIT_TX_PORT_1              1009
-#define IDC_EDIT_RX_PORT_1              1010
-#define IDC_COMBO_CODEC_1               1011
-#define IDC_BUTTON_STOP_LISTEN_1        1012
-#define IDC_STATIC_LISTEN               1013
-#define IDC_BUTTON_START_PLAYOUT_1      1014
-#define IDC_BUTTON_STOP_PLAYOUT_1       1015
-#define IDC_STATIC_PLAY                 1016
-#define IDC_BUTTON_START_SEND_1         1017
-#define IDC_BUTTON_STOP_SEND_1          1018
-#define IDC_STATIC_SEND                 1019
-#define IDC_COMBO_IP_2                  1020
-#define IDC_STATIC_IP                   1021
-#define IDC_STATIC_PORTS                1022
-#define IDC_STATIC_CODEC                1023
-#define IDC_STATIC_CHANNEL              1024
-#define IDC_STATIC_ID                   1025
-#define IDC_EDIT_TX_PORT_2              1026
-#define IDC_EDIT_RX_PORT_2              1027
-#define IDC_COMBO_CODEC_2               1028
-#define IDC_BUTTON_START_LISTEN_2       1029
-#define IDC_BUTTON_STOP_LISTEN_2        1030
-#define IDC_BUTTON_START_PLAYOUT_2      1031
-#define IDC_BUTTON_STOP_PLAYOUT_2       1032
-#define IDC_BUTTON_START_SEND_2         1033
-#define IDC_BUTTON_STOP_SEND_2          1034
-#define IDC_BUTTON_START_SEND_3         1035
-#define IDC_BUTTON_TEST_1_1             1035
-#define IDC_BUTTON_TEST_1               1035
-#define IDC_EDIT_RESULT                 1036
-#define IDC_EDIT_N_FAILS                1037
-#define IDC_STATIC_ERROR                1038
-#define IDC_EDIT_LAST_ERROR             1039
-#define IDC_STATIC_LAST_ERROR           1040
-#define IDC_STATIC_PLAY_FILE            1041
-#define IDC_STATIC_EXTERNAL             1042
-#define IDC_CHECK_EXT_TRANS_1           1043
-#define IDC_CHECK2                      1044
-#define IDC_CHECK_PLAY_FILE_IN_1        1044
-#define IDC_CHECK_PLAY_FILE_OUT_1       1045
-#define IDC_CHECK_PLAY_FILE_IN_2        1046
-#define IDC_CHECK_PLAY_FILE_OUT_2       1047
-#define IDC_CHECK_EXT_TRANS_2           1048
-#define IDC_STATIC_ALL_CHANNELS         1049
-#define IDC_CHECK_PLAY_FILE_IN          1050
-#define IDC_CHECK_PLAY_FILE_OUT         1051
-#define IDC_CHECK_EXT_MEDIA_IN_1        1051
-#define IDC_COMBO_REC_DEVICE            1052
-#define IDC_STATIC_REC_DEVICE           1053
-#define IDC_COMBO_PLAY_DEVICE2          1054
-#define IDC_COMBO_PLAY_DEVICE           1054
-#define IDC_STATIC_PLAY_DEVICE          1055
-#define IDC_CHECK_EXT_MEDIA_PLAY_1      1056
-#define IDC_CHECK_EXT_MEDIA_OUT_1       1056
-#define IDC_STATIC_PLAY_FILE2           1057
-#define IDC_SLIDER_INPUT_VOLUME         1058
-#define IDC_STATIC_MIC_VOLUME           1059
-#define IDC_SLIDER_OUTPUT_VOLUME        1060
-#define IDC_STATIC_SPK_VOLUME2          1061
-#define IDC_STATIC_SPK_VOLUME           1061
-#define IDC_CHECK_PLAY_FILE_IN2         1062
-#define IDC_CHECK_AGC                   1062
-#define IDC_STATIC_MIC_VOLUME2          1063
-#define IDC_STATIC_AUDIO_LEVEL_IN       1063
-#define IDC_PROGRESS_AUDIO_LEVEL_IN     1064
-#define IDC_CHECK_AGC2                  1065
-#define IDC_CHECK_NS                    1065
-#define IDC_BUTTON_1                    1065
-#define IDC_CHECK_VAD                   1066
-#define IDC_CHECK_EXT_MEDIA_IN_2        1066
-#define IDC_BUTTON_2                    1066
-#define IDC_CHECK_VAD2                  1067
-#define IDC_CHECK_EC                    1067
-#define IDC_BUTTON_3                    1067
-#define IDC_CHECK_VAD_1                 1068
-#define IDC_BUTTON_4                    1068
-#define IDC_CHECK_VAD_2                 1069
-#define IDC_CHECK_EXT_MEDIA_OUT_2       1069
-#define IDC_BUTTON_5                    1069
-#define IDC_CHECK_VAD_3                 1070
-#define IDC_BUTTON_6                    1070
-#define IDC_CHECK_MUTE_IN               1071
-#define IDC_BUTTON_7                    1071
-#define IDC_CHECK_MUTE_IN_1             1072
-#define IDC_BUTTON_8                    1072
-#define IDC_CHECK_MUTE_IN_2             1073
-#define IDC_BUTTON_9                    1073
-#define IDC_CHECK_SRTP_TX_1             1074
-#define IDC_BUTTON_10                   1074
-#define IDC_CHECK_SRTP_RX_1             1075
-#define IDC_BUTTON_11                   1075
-#define IDC_STATIC_PLAY_FILE3           1076
-#define IDC_STATIC_SRTP                 1076
-#define IDC_BUTTON_12                   1076
-#define IDC_CHECK_SRTP_TX_2             1077
-#define IDC_BUTTON_13                   1077
-#define IDC_CHECK_SRTP_RX_2             1078
-#define IDC_BUTTON_14                   1078
-#define IDC_CHECK_EXT_ENCRYPTION_1      1079
-#define IDC_BUTTON_15                   1079
-#define IDC_STATIC_PLAY_FILE4           1080
-#define IDC_BUTTON_16                   1080
-#define IDC_CHECK_EXT_ENCRYPTION_2      1081
-#define IDC_BUTTON_17                   1081
-#define IDC_BUTTON_DTMF_1               1082
-#define IDC_BUTTON_18                   1082
-#define IDC_EDIT_DTMF_EVENT             1083
-#define IDC_CHECK_REC_                  1083
-#define IDC_CHECK_REC_MIC               1083
-#define IDC_STATIC_DTMF_EVENT           1084
-#define IDC_BUTTON_DTMF_2               1084
-#define IDC_STATIC_GROUP_DTMF           1085
-#define IDC_CHECK_CONFERENCE_1          1085
-#define IDC_BUTTON_19                   1086
-#define IDC_CHECK_CONFERENCE_2          1086
-#define IDC_BUTTON_20                   1087
-#define IDC_CHECK_ON_HOLD_1             1087
-#define IDC_BUTTON_21                   1088
-#define IDC_CHECK_ON_HOLD_2             1088
-#define IDC_BUTTON_22                   1089
-#define IDC_CHECK_DTMF_PLAYOUT_RX       1089
-#define IDC_CHECK_EXT_MEDIA_IN          1089
-#define IDC_STATIC_PLAYOUT_RX           1090
-#define IDC_EDIT_GET_OUTPUT             1090
-#define IDC_CHECK_DTMF_PLAY_TONE        1091
-#define IDC_STATIC_LAST_ERROR2          1091
-#define IDC_STATIC_GET                  1091
-#define IDC_STATIC_PLAY_TONE            1092
-#define IDC_CHECK_EXT_MEDIA_OUT         1092
-#define IDC_CHECK_START_STOP_MODE       1093
-#define IDC_BUTTON_SET_TX_TELEPHONE_PT  1093
-#define IDC_PROGRESS_AUDIO_LEVEL_IN2    1093
-#define IDC_PROGRESS_AUDIO_LEVEL_OUT    1093
-#define IDC_EDIT_EVENT_LENGTH           1094
-#define IDC_EDIT_RX_PORT_3              1094
-#define IDC_EDIT_DELAY_ESTIMATE_1       1094
-#define IDC_STATIC_EVENT_LENGTH         1095
-#define IDC_EDIT_PLAYOUT_BUFFER_SIZE    1095
-#define IDC_STATIC_START_STOP_MODE      1096
-#define IDC_EDIT_EVENT_RX_PT            1096
-#define IDC_CHECK_DELAY_ESTIMATE_1      1096
-#define IDC_EDIT_EVENT_ATTENUATION      1097
-#define IDC_CHECK_AGC_1                 1097
-#define IDC_CHECK_EVENT_INBAND          1098
-#define IDC_CHECK_NS_1                  1098
-#define IDC_STATIC_EVENT_ATTENUATION    1099
-#define IDC_STATIC_SRTP2                1099
-#define IDC_STATIC_RX_VQE               1099
-#define IDC_EDIT_EVENT_TX_PT            1100
-#define IDC_CHECK_REC_MIC2              1100
-#define IDC_CHECK_REC_CALL              1100
-#define IDC_CHECK_DTMF_FEEDBACK         1101
-#define IDC_CHECK_REC_CALL2             1101
-#define IDC_CHECK_TYPING_DETECTION      1101
-#define IDC_CHECK_START_STOP_MODE2      1102
-#define IDC_CHECK_DIRECT_FEEDBACK       1102
-#define IDC_CHECK_RED                   1102
-#define IDC_BUTTON_SET_RX_TELEPHONE_PT_TYPE 1103
-#define IDC_BUTTON_SET_RX_TELEPHONE_PT  1103
-#define IDC_BUTTON_CLEAR_ERROR_CALLBACK 1103
-#define IDC_EDIT_EVENT_CODE             1104
-#define IDC_STATIC_DIRECT_FEEDBACK      1105
-#define IDC_RADIO_SINGLE                1106
-#define IDC_RADIO_MULTI                 1107
-#define IDC_RADIO_START_STOP            1108
-#define IDC_STATIC_MODE                 1109
-#define IDC_STATIC_EVENT_RX_PT          1110
-#define IDC_STATIC_EVENT_TX_PT          1111
-#define IDC_STATIC_PT                   1112
-#define IDC_BUTTON_SEND_TELEPHONE_EVENT 1113
-#define IDC_STATIC_EVENT_CODE           1114
-#define IDC_CHECK_EVENT_DETECTION       1115
-#define IDC_CHECK_DETECT_INBAND         1116
-#define IDC_CHECK_DETECT_OUT_OF_BAND    1117
-#define IDC_STATIC_INBAND_DETECTION     1118
-#define IDC_STATIC_OUT_OF_BAND_DETECTION 1119
-#define IDC_STATIC_EVENT_DETECTION      1120
-#define IDC_STATIC_TELEPHONE_EVENTS     1121
-#define IDC_EDIT_EVENT_CODE2            1122
-#define IDC_EDIT_ON_EVENT               1122
-#define IDC_EDIT_ON_EVENT_OUT_OF_BAND   1122
-#define IDC_STATIC_ON_EVENT             1123
-#define IDC_EDIT_ON_EVENT_INBAND        1123
-#define IDC_STATIC_EVEN                 1124
-#define IDC_STATIC_LINE                 1125
-#define IDC_LIST_CODEC_1                1128
-#define IDC_EDIT2                       1129
-#define IDC_EDIT_CODEC_1                1129
-#define IDC_STATIC_PANNING              1131
-#define IDC_SLIDER_PAN_LEFT             1132
-#define IDC_SLIDER_PAN_RIGHT            1133
-#define IDC_STATIC_LEFT                 1134
-#define IDC_STATIC_LEFT2                1135
-#define IDC_STATIC_RIGHT                1135
-#define IDC_BUTTON_VERSION              1136
-#define IDC_STATIC_PLAYOUT_BUFFER       1137
-#define IDC_CHECK_RXVAD                 1138
-#define IDC_EDIT1                       1139
-#define IDC_EDIT_RXVAD                  1139
-#define IDC_STATIC_RX_PORT              1140
-#define IDC_STATIC_RX_PORT2             1141
-#define IDC_EDIT3                       1142
-#define IDC_EDIT_AUDIO_LAYER            1142
-#define IDC_EDIT_AUDIO_LAYER2           1143
-#define IDC_EDIT_CPU_LOAD               1143
-#define IDC_STATIC_ERROR_CALLBACK       1144
-#define IDC_EDIT_ERROR_CALLBACK         1145
-#define IDC_EDIT_RX_CODEC_1             1146
-#define IDC_STATIC_BYTES_SENT_TEXT      1147
-#define IDC_EDIT_RTCP_STAT              1147
-#define IDC_EDIT_RTCP_STAT_1            1147
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        130
-#define _APS_NEXT_COMMAND_VALUE         32771
-#define _APS_NEXT_CONTROL_VALUE         1148
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
diff --git a/webrtc/voice_engine/test/win_test/WinTest.aps b/webrtc/voice_engine/test/win_test/WinTest.aps
deleted file mode 100644
index 499db5f..0000000
--- a/webrtc/voice_engine/test/win_test/WinTest.aps
+++ /dev/null
Binary files differ
diff --git a/webrtc/voice_engine/test/win_test/WinTest.cc b/webrtc/voice_engine/test/win_test/WinTest.cc
deleted file mode 100644
index 6b28ba4..0000000
--- a/webrtc/voice_engine/test/win_test/WinTest.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "webrtc/voice_engine/test/win_test/WinTest.h"
-#include "webrtc/voice_engine/test/win_test/WinTestDlg.h"
-#include "webrtc/voice_engine/test/win_test/stdafx.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-
-// CWinTestApp
-
-BEGIN_MESSAGE_MAP(CWinTestApp, CWinApp)
-	ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
-END_MESSAGE_MAP()
-
-
-// CWinTestApp construction
-
-CWinTestApp::CWinTestApp()
-{
-}
-
-
-// The one and only CWinTestApp object
-
-CWinTestApp theApp;
-
-
-// CWinTestApp initialization
-
-BOOL CWinTestApp::InitInstance()
-{
-	// InitCommonControlsEx() is required on Windows XP if an application
-	// manifest specifies use of ComCtl32.dll version 6 or later to enable
-	// visual styles.  Otherwise, any window creation will fail.
-	INITCOMMONCONTROLSEX InitCtrls;
-	InitCtrls.dwSize = sizeof(InitCtrls);
-	// Set this to include all the common control classes you want to use
-	// in your application.
-	InitCtrls.dwICC = ICC_WIN95_CLASSES;
-	InitCommonControlsEx(&InitCtrls);
-
-	CWinApp::InitInstance();
-
-	// Standard initialization
-	// If you are not using these features and wish to reduce the size
-	// of your final executable, you should remove from the following
-	// the specific initialization routines you do not need
-	// Change the registry key under which our settings are stored
-	SetRegistryKey(_T("Local AppWizard-Generated Applications"));
-
-	CWinTestDlg dlg;
-	m_pMainWnd = &dlg;
-	INT_PTR nResponse = dlg.DoModal();
-	if (nResponse == IDOK)
-	{
-	}
-	else if (nResponse == IDCANCEL)
-	{
-	}
-
-	// Since the dialog has been closed, return FALSE so that we exit the
-	//  application, rather than start the application's message pump.
-	return FALSE;
-}
diff --git a/webrtc/voice_engine/test/win_test/WinTest.h b/webrtc/voice_engine/test/win_test/WinTest.h
deleted file mode 100644
index 7320360..0000000
--- a/webrtc/voice_engine/test/win_test/WinTest.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-#ifndef WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_WINTEST_H_
-#define WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_WINTEST_H_
-
-#ifndef __AFXWIN_H__
-	#error "include 'stdafx.h' before including this file for PCH"
-#endif
-
-#include "resource.h"		// main symbols
-
-
-// CWinTestApp:
-// See WinTest.cpp for the implementation of this class
-//
-
-class CWinTestApp : public CWinApp
-{
-public:
-	CWinTestApp();
-
-// Overrides
-	public:
-	virtual BOOL InitInstance();
-
-// Implementation
-
-	DECLARE_MESSAGE_MAP()
-};
-
-extern CWinTestApp theApp;
-
-#endif  // WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_WINTEST_H_
diff --git a/webrtc/voice_engine/test/win_test/WinTest.rc b/webrtc/voice_engine/test/win_test/WinTest.rc
deleted file mode 100644
index 240036c..0000000
--- a/webrtc/voice_engine/test/win_test/WinTest.rc
+++ /dev/null
@@ -1,394 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Swedish resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
-#ifdef _WIN32
-LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE 
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE 
-BEGIN
-    "#include ""afxres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE 
-BEGIN
-    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
-    "#define _AFX_NO_OLE_RESOURCES\r\n"
-    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
-    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
-    "\r\n"
-    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)\r\n"
-    "LANGUAGE 29, 1\r\n"
-    "#pragma code_page(1252)\r\n"
-    "#include ""res\\WinTest.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
-    "#include ""afxres.rc""     // Standard components\r\n"
-    "#endif\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDR_MAINFRAME           ICON                    "res\\WinTest.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "About WinTest"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
-    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,20,20
-    LTEXT           "WinTest Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX
-    LTEXT           "Copyright (C) 2010",IDC_STATIC,40,25,119,8
-    DEFPUSHBUTTON   "OK",IDOK,178,7,50,16,WS_GROUP
-END
-
-IDD_WINTEST_DIALOG DIALOGEX 0, 0, 796, 278
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_APPWINDOW
-CAPTION "WinTest"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
-    PUSHBUTTON      "Create",IDC_BUTTON_CREATE_1,28,24,32,14
-    PUSHBUTTON      "Delete",IDC_BUTTON_DELETE_1,28,40,32,14
-    EDITTEXT        IDC_EDIT_1,6,32,18,14,ES_AUTOHSCROLL | ES_READONLY
-    PUSHBUTTON      "Create",IDC_BUTTON_CREATE_2,28,72,32,14
-    PUSHBUTTON      "Delete",IDC_BUTTON_DELETE_2,28,88,32,14
-    EDITTEXT        IDC_EDIT_2,6,82,18,14,ES_AUTOHSCROLL | ES_READONLY
-    EDITTEXT        IDC_EDIT_MESSAGE,28,244,764,12,ES_AUTOHSCROLL
-    COMBOBOX        IDC_COMBO_IP_1,64,24,76,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
-    EDITTEXT        IDC_EDIT_TX_PORT_1,144,24,28,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_RX_PORT_1,144,40,28,14,ES_AUTOHSCROLL
-    COMBOBOX        IDC_COMBO_CODEC_1,176,24,76,156,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
-    PUSHBUTTON      "Start",IDC_BUTTON_START_LISTEN_1,256,24,32,14
-    PUSHBUTTON      "Stop",IDC_BUTTON_STOP_LISTEN_1,256,40,32,14
-    LTEXT           "Receive",IDC_STATIC_LISTEN,262,8,26,8
-    PUSHBUTTON      "Start",IDC_BUTTON_START_PLAYOUT_1,292,24,32,14
-    PUSHBUTTON      "Stop",IDC_BUTTON_STOP_PLAYOUT_1,292,40,32,14
-    LTEXT           "Playout",IDC_STATIC_PLAY,295,8,25,8
-    PUSHBUTTON      "Start",IDC_BUTTON_START_SEND_1,328,24,32,14
-    PUSHBUTTON      "Stop",IDC_BUTTON_STOP_SEND_1,328,40,32,14
-    LTEXT           "Send",IDC_STATIC_SEND,335,8,17,8
-    COMBOBOX        IDC_COMBO_IP_2,64,72,76,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
-    LTEXT           "Destination IP address",IDC_STATIC_IP,64,8,73,8
-    LTEXT           "Ports",IDC_STATIC_PORTS,145,8,18,8
-    LTEXT           "Codec",IDC_STATIC_CODEC,177,8,21,8
-    LTEXT           "Channel",IDC_STATIC_CHANNEL,30,8,27,8
-    LTEXT           "ID",IDC_STATIC_ID,12,8,8,8
-    EDITTEXT        IDC_EDIT_TX_PORT_2,144,72,28,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_RX_PORT_2,144,88,28,14,ES_AUTOHSCROLL
-    COMBOBOX        IDC_COMBO_CODEC_2,176,72,76,156,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
-    PUSHBUTTON      "Start",IDC_BUTTON_START_LISTEN_2,256,72,32,14
-    PUSHBUTTON      "Stop",IDC_BUTTON_STOP_LISTEN_2,256,88,32,14
-    PUSHBUTTON      "Start",IDC_BUTTON_START_PLAYOUT_2,292,72,32,14
-    PUSHBUTTON      "Stop",IDC_BUTTON_STOP_PLAYOUT_2,292,88,32,14
-    PUSHBUTTON      "Start",IDC_BUTTON_START_SEND_2,328,72,32,14
-    PUSHBUTTON      "Stop",IDC_BUTTON_STOP_SEND_2,328,88,32,14
-    PUSHBUTTON      "TEST 1",IDC_BUTTON_TEST_1,756,224,36,14
-    LTEXT           "API",IDC_STATIC,4,247,12,8
-    EDITTEXT        IDC_EDIT_RESULT,28,260,96,12,ES_AUTOHSCROLL
-    LTEXT           "Result",IDC_STATIC,3,263,21,8
-    EDITTEXT        IDC_EDIT_N_FAILS,156,260,30,12,ES_AUTOHSCROLL
-    LTEXT           "#Fails",IDC_STATIC_ERROR,132,263,20,8
-    EDITTEXT        IDC_EDIT_LAST_ERROR,228,260,36,12,ES_AUTOHSCROLL
-    LTEXT           "Last Error",IDC_STATIC_LAST_ERROR,192,262,32,8
-    LTEXT           "Ext. Trans.",IDC_STATIC_EXTERNAL,361,8,37,8
-    CONTROL         "",IDC_CHECK_EXT_TRANS_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,371,33,16,10
-    CONTROL         "In",IDC_CHECK_PLAY_FILE_IN_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,396,24,36,14,WS_EX_DLGMODALFRAME
-    LTEXT           "Play File",IDC_STATIC_PLAY_FILE,401,8,27,8
-    CONTROL         "Out",IDC_CHECK_PLAY_FILE_OUT_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,396,40,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "In",IDC_CHECK_PLAY_FILE_IN_2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,396,72,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Out",IDC_CHECK_PLAY_FILE_OUT_2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,396,88,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "",IDC_CHECK_EXT_TRANS_2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,371,82,16,10
-    GROUPBOX        "",IDC_STATIC_ALL_CHANNELS,6,107,662,113
-    CONTROL         "PlayFileAsMic",IDC_CHECK_PLAY_FILE_IN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,396,122,60,14,WS_EX_DLGMODALFRAME
-    COMBOBOX        IDC_COMBO_REC_DEVICE,12,132,184,80,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
-    LTEXT           "Recording device",IDC_STATIC_REC_DEVICE,12,120,56,8
-    COMBOBOX        IDC_COMBO_PLAY_DEVICE,12,180,184,80,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
-    LTEXT           "Playout device",IDC_STATIC_PLAY_DEVICE,12,167,56,8
-    CONTROL         "In",IDC_CHECK_EXT_MEDIA_IN_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,436,24,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Out",IDC_CHECK_EXT_MEDIA_OUT_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,436,40,36,14,WS_EX_DLGMODALFRAME
-    LTEXT           "Ext. Media",IDC_STATIC_PLAY_FILE2,437,8,35,8
-    CONTROL         "",IDC_SLIDER_INPUT_VOLUME,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,196,130,72,15
-    LTEXT           "Microphone Volume",IDC_STATIC_MIC_VOLUME,202,120,62,8
-    CONTROL         "",IDC_SLIDER_OUTPUT_VOLUME,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,196,179,72,15
-    LTEXT           "Speaker Volume",IDC_STATIC_SPK_VOLUME,202,167,52,8
-    CONTROL         "AGC",IDC_CHECK_AGC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,316,122,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "",IDC_PROGRESS_AUDIO_LEVEL_IN,"msctls_progress32",WS_BORDER,268,135,42,6
-    LTEXT           "Audio Level",IDC_STATIC_AUDIO_LEVEL_IN,271,120,38,8,NOT WS_GROUP
-    CONTROL         "NS",IDC_CHECK_NS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,316,142,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "EC",IDC_CHECK_EC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,356,122,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "VAD",IDC_CHECK_VAD_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,476,24,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "In",IDC_CHECK_EXT_MEDIA_IN_2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,436,72,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Out",IDC_CHECK_EXT_MEDIA_OUT_2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,436,88,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "VAD",IDC_CHECK_VAD_3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,476,72,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Mute",IDC_CHECK_MUTE_IN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,356,142,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Mute",IDC_CHECK_MUTE_IN_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,476,40,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Mute",IDC_CHECK_MUTE_IN_2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,476,88,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "TX",IDC_CHECK_SRTP_TX_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,516,24,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "RX",IDC_CHECK_SRTP_RX_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,516,40,36,14,WS_EX_DLGMODALFRAME
-    LTEXT           "SRTP",IDC_STATIC_SRTP,525,8,18,8
-    CONTROL         "TX",IDC_CHECK_SRTP_TX_2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,516,72,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "RX",IDC_CHECK_SRTP_RX_2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,516,88,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "",IDC_CHECK_EXT_ENCRYPTION_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,564,33,16,10
-    LTEXT           "Encrypt",IDC_STATIC_PLAY_FILE4,556,8,26,8
-    CONTROL         "",IDC_CHECK_EXT_ENCRYPTION_2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,564,82,16,10
-    PUSHBUTTON      "DTMF>>",IDC_BUTTON_DTMF_1,584,24,36,14
-    CONTROL         "RecMicToFile",IDC_CHECK_REC_MIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,396,142,60,14,WS_EX_DLGMODALFRAME
-    PUSHBUTTON      "DTMF>>",IDC_BUTTON_DTMF_2,584,72,36,14
-    CONTROL         "Conf",IDC_CHECK_CONFERENCE_1,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,584,40,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Conf",IDC_CHECK_CONFERENCE_2,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,584,88,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Hold",IDC_CHECK_ON_HOLD_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,708,24,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Hold",IDC_CHECK_ON_HOLD_2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,708,72,36,14,WS_EX_DLGMODALFRAME
-    EDITTEXT        IDC_EDIT_GET_OUTPUT,292,260,500,12,ES_AUTOHSCROLL
-    LTEXT           "Get",IDC_STATIC_GET,276,262,12,8
-    CONTROL         "Ext. Media",IDC_CHECK_EXT_MEDIA_IN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,460,122,52,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Ext. Media",IDC_CHECK_EXT_MEDIA_OUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,460,180,52,14,WS_EX_DLGMODALFRAME
-    LISTBOX         IDC_LIST_CODEC_1,208,40,44,28,LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_CLIENTEDGE
-    EDITTEXT        IDC_EDIT_CODEC_1,176,40,28,14,ES_AUTOHSCROLL
-    CONTROL         "",IDC_PROGRESS_AUDIO_LEVEL_OUT,"msctls_progress32",WS_BORDER,268,184,42,6
-    LTEXT           "Panning",IDC_STATIC_PANNING,328,167,26,8
-    CONTROL         "",IDC_SLIDER_PAN_LEFT,"msctls_trackbar32",TBS_VERT | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,328,175,12,28
-    CONTROL         "",IDC_SLIDER_PAN_RIGHT,"msctls_trackbar32",TBS_VERT | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,344,175,12,28
-    LTEXT           "L",IDC_STATIC_LEFT,332,200,8,8
-    LTEXT           "R",IDC_STATIC_RIGHT,347,201,8,8
-    PUSHBUTTON      "Version",IDC_BUTTON_VERSION,624,200,36,14
-    EDITTEXT        IDC_EDIT_PLAYOUT_BUFFER_SIZE,363,181,28,12,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP
-    LTEXT           "Buffer Size",IDC_STATIC_PLAYOUT_BUFFER,361,167,36,8
-    CONTROL         "Delay",IDC_CHECK_DELAY_ESTIMATE_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,624,24,36,14,WS_EX_DLGMODALFRAME
-    EDITTEXT        IDC_EDIT_DELAY_ESTIMATE_1,631,40,24,14,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP
-    CONTROL         "RxVAD",IDC_CHECK_RXVAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,664,24,40,14,WS_EX_DLGMODALFRAME
-    EDITTEXT        IDC_EDIT_RXVAD,671,40,24,14,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY
-    CONTROL         "AGC",IDC_CHECK_AGC_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,748,24,36,14,WS_EX_DLGMODALFRAME
-    CONTROL         "NS",IDC_CHECK_NS_1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,748,40,36,14,WS_EX_DLGMODALFRAME
-    LTEXT           "RX VQE",IDC_STATIC_RX_VQE,753,8,25,8
-    CONTROL         "RecordCall",IDC_CHECK_REC_CALL,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,517,156,52,14,WS_EX_DLGMODALFRAME
-    LTEXT           "RX",IDC_STATIC_RX_PORT,133,42,10,8
-    LTEXT           "RX",IDC_STATIC_RX_PORT2,133,91,10,8
-    CONTROL         "TypingDetect",IDC_CHECK_TYPING_DETECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,572,156,60,14,WS_EX_DLGMODALFRAME
-    EDITTEXT        IDC_EDIT_AUDIO_LAYER,28,224,116,14,ES_AUTOHSCROLL | ES_READONLY
-    EDITTEXT        IDC_EDIT_CPU_LOAD,152,224,116,14,ES_AUTOHSCROLL | ES_READONLY
-    CONTROL         "RED",IDC_CHECK_RED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,176,55,28,14,WS_EX_DLGMODALFRAME
-    LTEXT           "=> Callbacks",IDC_STATIC_ERROR_CALLBACK,283,226,43,8
-    EDITTEXT        IDC_EDIT_ERROR_CALLBACK,328,224,312,14,ES_AUTOHSCROLL
-    PUSHBUTTON      "Clear",IDC_BUTTON_CLEAR_ERROR_CALLBACK,644,224,24,14
-    EDITTEXT        IDC_EDIT_RX_CODEC_1,256,56,216,12,ES_AUTOHSCROLL | ES_READONLY
-    EDITTEXT        IDC_EDIT_RTCP_STAT_1,476,56,316,12,ES_AUTOHSCROLL | ES_READONLY
-END
-
-IDD_DTMF_DIALOG DIALOGEX 0, 0, 316, 212
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Telehone Events"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,260,192,50,14
-    PUSHBUTTON      "1",IDC_BUTTON_1,16,20,16,14
-    PUSHBUTTON      "2",IDC_BUTTON_2,36,20,16,14
-    PUSHBUTTON      "3",IDC_BUTTON_3,56,20,16,14
-    PUSHBUTTON      "4",IDC_BUTTON_4,16,36,16,14
-    PUSHBUTTON      "5",IDC_BUTTON_5,36,36,16,14
-    PUSHBUTTON      "6",IDC_BUTTON_6,56,36,16,14
-    PUSHBUTTON      "7",IDC_BUTTON_7,16,52,16,14
-    PUSHBUTTON      "8",IDC_BUTTON_8,36,52,16,14
-    PUSHBUTTON      "9",IDC_BUTTON_9,56,52,16,14
-    PUSHBUTTON      "*",IDC_BUTTON_10,16,68,16,14
-    PUSHBUTTON      "0",IDC_BUTTON_11,36,68,16,14
-    PUSHBUTTON      "#",IDC_BUTTON_12,56,68,16,14
-    PUSHBUTTON      "A",IDC_BUTTON_13,76,20,16,14
-    PUSHBUTTON      "B",IDC_BUTTON_14,76,36,16,14
-    PUSHBUTTON      "C",IDC_BUTTON_15,76,52,16,14
-    PUSHBUTTON      "D",IDC_BUTTON_16,76,68,16,14
-    EDITTEXT        IDC_EDIT_DTMF_EVENT,56,90,16,12,ES_AUTOHSCROLL | ES_READONLY
-    LTEXT           "Event code",IDC_STATIC_DTMF_EVENT,17,91,37,8
-    PUSHBUTTON      "1",IDC_BUTTON_17,16,20,16,14
-    PUSHBUTTON      "2",IDC_BUTTON_18,36,20,16,14
-    PUSHBUTTON      "3",IDC_BUTTON_19,56,20,16,14
-    PUSHBUTTON      "4",IDC_BUTTON_20,16,36,16,14
-    PUSHBUTTON      "A",IDC_BUTTON_21,76,20,16,14
-    GROUPBOX        "DTMF Events",IDC_STATIC_GROUP_DTMF,4,4,188,132
-    CONTROL         "",IDC_CHECK_DTMF_PLAYOUT_RX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,160,21,12,14
-    LTEXT           "Play out-band RX",IDC_STATIC_PLAYOUT_RX,101,24,56,8
-    CONTROL         "",IDC_CHECK_DTMF_PLAY_TONE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,160,39,12,14
-    LTEXT           "Play tone locally",IDC_STATIC_PLAY_TONE,101,41,52,8
-    EDITTEXT        IDC_EDIT_EVENT_LENGTH,44,163,28,14,ES_AUTOHSCROLL
-    LTEXT           "Duration",IDC_STATIC_EVENT_LENGTH,12,165,28,8
-    EDITTEXT        IDC_EDIT_EVENT_ATTENUATION,44,183,28,14,ES_AUTOHSCROLL
-    LTEXT           "Volume",IDC_STATIC_EVENT_ATTENUATION,12,186,24,8
-    CONTROL         "Inband",IDC_CHECK_EVENT_INBAND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,163,40,14,WS_EX_DLGMODALFRAME
-    CONTROL         "Feedback",IDC_CHECK_DTMF_FEEDBACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,112,48,14,WS_EX_DLGMODALFRAME
-    CONTROL         "",IDC_CHECK_DIRECT_FEEDBACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,96,112,12,14
-    LTEXT           "Direct",IDC_STATIC_DIRECT_FEEDBACK,72,115,20,8
-    CONTROL         "Single",IDC_RADIO_SINGLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,112,68,35,10
-    CONTROL         "Sequence",IDC_RADIO_MULTI,"Button",BS_AUTORADIOBUTTON,112,80,47,10
-    CONTROL         "Start/Stop",IDC_RADIO_START_STOP,"Button",BS_AUTORADIOBUTTON,112,92,49,10
-    GROUPBOX        "Mode",IDC_STATIC_MODE,100,56,68,52
-    EDITTEXT        IDC_EDIT_EVENT_RX_PT,220,20,24,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_EVENT_TX_PT,220,41,24,14,ES_AUTOHSCROLL
-    LTEXT           "RX",IDC_STATIC_EVENT_RX_PT,208,22,10,8
-    LTEXT           "TX",IDC_STATIC_EVENT_TX_PT,208,42,9,8
-    PUSHBUTTON      "Set",IDC_BUTTON_SET_TX_TELEPHONE_PT,248,41,24,14
-    PUSHBUTTON      "Set",IDC_BUTTON_SET_RX_TELEPHONE_PT,248,20,24,14
-    GROUPBOX        "Payload Type",IDC_STATIC_PT,200,4,80,56
-    EDITTEXT        IDC_EDIT_EVENT_CODE,128,163,28,14,ES_AUTOHSCROLL
-    LTEXT           "Event code",IDC_STATIC_EVENT_CODE,125,152,37,8
-    PUSHBUTTON      "Send",IDC_BUTTON_SEND_TELEPHONE_EVENT,160,163,24,14
-    CONTROL         "On/Off",IDC_CHECK_EVENT_DETECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,208,80,40,14,WS_EX_DLGMODALFRAME
-    CONTROL         "",IDC_CHECK_DETECT_INBAND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,208,100,12,14
-    CONTROL         "",IDC_CHECK_DETECT_OUT_OF_BAND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,208,116,12,14
-    LTEXT           "Inband",IDC_STATIC_INBAND_DETECTION,220,103,24,8
-    LTEXT           "Outband",IDC_STATIC_OUT_OF_BAND_DETECTION,220,120,29,8
-    GROUPBOX        "Event Detection",IDC_STATIC_EVENT_DETECTION,200,68,108,68
-    GROUPBOX        "Telephone Events",IDC_STATIC_TELEPHONE_EVENTS,4,140,188,64
-    EDITTEXT        IDC_EDIT_ON_EVENT_OUT_OF_BAND,252,117,48,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_EDIT_ON_EVENT_INBAND,252,101,48,14,ES_AUTOHSCROLL
-    LTEXT           "=> Detections",IDC_STATIC_EVEN,253,90,48,8
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,0
- PRODUCTVERSION 1,0,0,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904e4"
-        BEGIN
-            VALUE "FileDescription", "WebRTC VoiceEngine Test"
-            VALUE "FileVersion", "1.0.0.0"
-            VALUE "InternalName", "WinTest.exe"
-            VALUE "LegalCopyright", "Copyright (c) 2011 The WebRTC project authors. All Rights Reserved."
-            VALUE "OriginalFilename", "WinTest.exe"
-            VALUE "ProductName", "WebRTC VoiceEngine"
-            VALUE "ProductVersion", "1.0.0.0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1252
-    END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO 
-BEGIN
-    IDD_ABOUTBOX, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 228
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 48
-    END
-
-    IDD_WINTEST_DIALOG, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 789
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 271
-    END
-
-    IDD_DTMF_DIALOG, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 309
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 205
-    END
-END
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE 
-BEGIN
-    IDS_ABOUTBOX            "&About WinTest..."
-END
-
-#endif    // Swedish resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-#define _AFX_NO_SPLITTER_RESOURCES
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
-LANGUAGE 29, 1
-#pragma code_page(1252)
-#include "res\WinTest.rc2"  // non-Microsoft Visual C++ edited resources
-#include "afxres.rc"     // Standard components
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
diff --git a/webrtc/voice_engine/test/win_test/WinTestDlg.cc b/webrtc/voice_engine/test/win_test/WinTestDlg.cc
deleted file mode 100644
index 4436a86..0000000
--- a/webrtc/voice_engine/test/win_test/WinTestDlg.cc
+++ /dev/null
@@ -1,3367 +0,0 @@
-/*
- *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#include <math.h>
-#include "webrtc/test/testsupport/fileutils.h"
-#include "webrtc/voice_engine/test/win_test/WinTest.h"
-#include "webrtc/voice_engine/test/win_test/WinTestDlg.h"
-#include "webrtc/voice_engine/test/win_test/stdafx.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-using namespace webrtc;
-
-unsigned char key[30] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-
-// Hack to convert char to TCHAR, using two buffers to be able to
-// call twice in the same statement
-TCHAR convertTemp1[256] = {0};
-TCHAR convertTemp2[256] = {0};
-bool convertBufferSwitch(false);
-TCHAR* CharToTchar(const char* str, int len)
-{
-#ifdef _UNICODE
-  TCHAR* temp = convertBufferSwitch ? convertTemp1 : convertTemp2;
-  convertBufferSwitch = !convertBufferSwitch;
-  memset(temp, 0, sizeof(convertTemp1));
-  MultiByteToWideChar(CP_UTF8, 0, str, len, temp, 256);
-  return temp;
-#else
-  return str;
-#endif
-}
-
-// Hack to convert TCHAR to char
-char convertTemp3[256] = {0};
-char* TcharToChar(TCHAR* str, int len)
-{
-#ifdef _UNICODE
-  memset(convertTemp3, 0, sizeof(convertTemp3));
-  WideCharToMultiByte(CP_UTF8, 0, str, len, convertTemp3, 256, 0, 0);
-  return convertTemp3;
-#else
-  return str;
-#endif
-}
-
-// ----------------------------------------------------------------------------
-//    VoiceEngineObserver
-// ----------------------------------------------------------------------------
-
-void CWinTestDlg::CallbackOnError(int channel, int errCode)
-{
-    _nErrorCallbacks++;
-
-    CString str;
-    str.Format(_T("[#%d] CallbackOnError(channel=%d) => errCode = %d"), _nErrorCallbacks, channel, errCode);
-    if (errCode == VE_RECEIVE_PACKET_TIMEOUT)
-    {
-        str += _T(" <=> VE_RECEIVE_PACKET_TIMEOUT");
-    }
-    else if (errCode == VE_PACKET_RECEIPT_RESTARTED)
-    {
-        str += _T(" <=> VE_PACKET_RECEIPT_RESTARTED");
-    }
-    else if (errCode == VE_RUNTIME_PLAY_WARNING)
-    {
-        str += _T(" <=> VE_RUNTIME_PLAY_WARNING");
-    }
-    else if (errCode == VE_RUNTIME_REC_WARNING)
-    {
-        str += _T(" <=> VE_RUNTIME_REC_WARNING");
-    }
-    else if (errCode == VE_RUNTIME_PLAY_ERROR)
-    {
-        str += _T(" <=> VE_RUNTIME_PLAY_ERROR");
-    }
-    else if (errCode == VE_RUNTIME_REC_ERROR)
-    {
-        str += _T(" <=> VE_RUNTIME_REC_ERROR");
-    }
-    else if (errCode == VE_SATURATION_WARNING)
-    {
-        str += _T(" <=> VE_SATURATION_WARNING");
-    }
-    else if (errCode == VE_TYPING_NOISE_WARNING)
-    {
-        str += _T(" <=> VE_TYPING_NOISE_WARNING");
-    }
-    else if (errCode == VE_REC_DEVICE_REMOVED)
-    {
-        str += _T(" <=> VE_REC_DEVICE_REMOVED");
-    }
-    // AfxMessageBox((LPCTSTR)str, MB_OK);
-    SetDlgItemText(IDC_EDIT_ERROR_CALLBACK, (LPCTSTR)str);
-}
-
-// ----------------------------------------------------------------------------
-//    VoERTPObserver
-// ----------------------------------------------------------------------------
-
-void CWinTestDlg::OnIncomingCSRCChanged(int channel, unsigned int CSRC, bool added)
-{
-    CString str;
-    str.Format(_T("OnIncomingCSRCChanged(channel=%d) => CSRC=%u, added=%d"), channel, CSRC, added);
-    SetDlgItemText(IDC_EDIT_ERROR_CALLBACK, (LPCTSTR)str);
-}
-
-void CWinTestDlg::OnIncomingSSRCChanged(int channel, unsigned int SSRC)
-{
-    CString str;
-    str.Format(_T("OnIncomingSSRCChanged(channel=%d) => SSRC=%u"), channel, SSRC);
-    SetDlgItemText(IDC_EDIT_ERROR_CALLBACK, (LPCTSTR)str);
-}
-
-// ----------------------------------------------------------------------------
-//    Transport
-// ----------------------------------------------------------------------------
-
-class MyTransport : public Transport
-{
-public:
-    MyTransport(VoENetwork* veNetwork);
-    int SendPacket(int channel, const void* data, size_t len) override;
-    int SendRTCPPacket(int channel, const void* data, size_t len) override;
-
-private:
-    VoENetwork* _veNetworkPtr;
-};
-
-MyTransport::MyTransport(VoENetwork* veNetwork) :
-    _veNetworkPtr(veNetwork)
-{
-}
-
-int
-MyTransport::SendPacket(int channel, const void *data, size_t len)
-{
-    _veNetworkPtr->ReceivedRTPPacket(channel, data, len);
-    return len;
-}
-
-int
-MyTransport::SendRTCPPacket(int channel, const void *data, size_t len)
-{
-    _veNetworkPtr->ReceivedRTCPPacket(channel, data, len);
-    return len;
-}
-
-// ----------------------------------------------------------------------------
-//    VoEMediaProcess
-// ----------------------------------------------------------------------------
-
-class MediaProcessImpl : public VoEMediaProcess
-{
-public:
-    MediaProcessImpl();
-    virtual void Process(int channel,
-                         ProcessingTypes type,
-                         int16_t audio_10ms[],
-                         int length,
-                         int samplingFreqHz,
-                         bool stereo);
-};
-
-MediaProcessImpl::MediaProcessImpl()
-{
-}
-
-void MediaProcessImpl::Process(int channel,
-                               ProcessingTypes type,
-                               int16_t audio_10ms[],
-                               int length,
-                               int samplingFreqHz,
-                               bool stereo)
-{
-    int x = rand() % 100;
-
-    for (int i = 0; i < length; i++)
-    {
-        if (channel == -1)
-        {
-            if (type == kPlaybackAllChannelsMixed)
-            {
-                // playout: scale up
-                if (!stereo)
-                {
-                    audio_10ms[i] = (audio_10ms[i] << 2);
-                }
-                else
-                {
-                    audio_10ms[2*i] = (audio_10ms[2*i] << 2);
-                    audio_10ms[2*i+1] = (audio_10ms[2*i+1] << 2);
-                }
-            }
-            else
-            {
-                // recording: emulate packet loss by "dropping" 10% of the packets
-                if (x >= 0 && x < 10)
-                {
-                    if (!stereo)
-                    {
-                        audio_10ms[i] = 0;
-                    }
-                    else
-                    {
-                        audio_10ms[2*i] = 0;
-                        audio_10ms[2*i+1] = 0;
-                    }
-                }
-            }
-        }
-        else
-        {
-            if (type == kPlaybackPerChannel)
-            {
-                // playout: mute
-                if (!stereo)
-                {
-                    audio_10ms[i] = 0;
-                }
-                else
-                {
-                    audio_10ms[2*i] = 0;
-                    audio_10ms[2*i+1] = 0;
-                }
-            }
-            else
-            {
-                // recording: emulate packet loss by "dropping" 50% of the packets
-                if (x >= 0 && x < 50)
-                {
-                    if (!stereo)
-                    {
-                        audio_10ms[i] = 0;
-                    }
-                    else
-                    {
-                        audio_10ms[2*i] = 0;
-                        audio_10ms[2*i+1] = 0;
-                    }
-                }
-            }
-        }
-    }
-}
-
-// ----------------------------------------------------------------------------
-//    TelephoneEventObserver
-// ----------------------------------------------------------------------------
-
-class TelephoneEventObserver: public VoETelephoneEventObserver
-{
-public:
-    TelephoneEventObserver(CWnd* editControlOut, CWnd* editControlIn);
-    virtual void OnReceivedTelephoneEventInband(int channel, int eventCode,
-                                                bool endOfEvent);
-    virtual void OnReceivedTelephoneEventOutOfBand(int channel, int eventCode,
-                                                   bool endOfEvent);
-private:
-    CWnd* _editControlOutPtr;
-    CWnd* _editControlInPtr;
-};
-
-TelephoneEventObserver::TelephoneEventObserver(CWnd* editControlOut, CWnd* editControlIn) :
-    _editControlOutPtr(editControlOut),
-    _editControlInPtr(editControlIn)
-{
-}
-
-void TelephoneEventObserver::OnReceivedTelephoneEventInband(int channel,
-                                                            int eventCode,
-                                                            bool endOfEvent)
-{
-    CString msg;
-    if (endOfEvent)
-    {
-        msg.AppendFormat(_T("%d [END]"), eventCode);
-        _editControlInPtr->SetWindowText((LPCTSTR)msg);
-    }
-    else
-    {
-        msg.AppendFormat(_T("%d [START]"), eventCode);
-        _editControlInPtr->SetWindowText((LPCTSTR)msg);
-    }
-}
-
-void TelephoneEventObserver::OnReceivedTelephoneEventOutOfBand(int channel,
-                                                               int eventCode,
-                                                               bool endOfEvent)
-{
-    CString msg;
-    if (endOfEvent)
-    {
-        msg.AppendFormat(_T("%d [END]"), eventCode);
-        _editControlOutPtr->SetWindowText((LPCTSTR)msg);
-    }
-    else
-    {
-        msg.AppendFormat(_T("%d [START]"), eventCode);
-        _editControlOutPtr->SetWindowText((LPCTSTR)msg);
-    }
-}
-
-// ----------------------------------------------------------------------------
-//    RxVadCallback
-// ----------------------------------------------------------------------------
-
-class RxCallback : public VoERxVadCallback
-{
-public:
-    RxCallback() : vad_decision(-1) {};
-
-    virtual void OnRxVad(int , int vadDecision)
-    {
-        vad_decision = vadDecision;
-    }
-
-    int vad_decision;
-};
-
-// ----------------------------------------------------------------------------
-//                                 CAboutDlg dialog
-// ----------------------------------------------------------------------------
-
-class CAboutDlg : public CDialog
-{
-public:
-    CAboutDlg();
-
-// Dialog Data
-    enum { IDD = IDD_ABOUTBOX };
-
-    protected:
-    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-
-// Implementation
-protected:
-    DECLARE_MESSAGE_MAP()
-};
-
-CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
-{
-}
-
-void CAboutDlg::DoDataExchange(CDataExchange* pDX)
-{
-    CDialog::DoDataExchange(pDX);
-}
-
-BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
-END_MESSAGE_MAP()
-
-// ----------------------------------------------------------------------------
-//                               CTelephonyEvent dialog
-// ----------------------------------------------------------------------------
-
-class CTelephonyEvent : public CDialog
-{
-    DECLARE_DYNAMIC(CTelephonyEvent)
-
-public:
-    CTelephonyEvent(VoiceEngine* voiceEngine, int channel, CDialog* pParentDialog, CWnd* pParent = NULL);   // standard constructor
-    virtual ~CTelephonyEvent();
-
-// Dialog Data
-    enum { IDD = IDD_DTMF_DIALOG };
-
-protected:
-    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-    virtual BOOL OnInitDialog();
-
-    DECLARE_MESSAGE_MAP()
-public:
-    afx_msg void OnBnClickedButton1();
-    afx_msg void OnBnClickedButton2();
-    afx_msg void OnBnClickedButton3();
-    afx_msg void OnBnClickedButton4();
-    afx_msg void OnBnClickedButton5();
-    afx_msg void OnBnClickedButton6();
-    afx_msg void OnBnClickedButton7();
-    afx_msg void OnBnClickedButton8();
-    afx_msg void OnBnClickedButton9();
-    afx_msg void OnBnClickedButton10();
-    afx_msg void OnBnClickedButton11();
-    afx_msg void OnBnClickedButton12();
-    afx_msg void OnBnClickedButtonA();
-    afx_msg void OnBnClickedButtonB();
-    afx_msg void OnBnClickedButtonC();
-    afx_msg void OnBnClickedButtonD();
-    afx_msg void OnBnClickedCheckDtmfPlayoutRx();
-    afx_msg void OnBnClickedCheckDtmfPlayTone();
-    afx_msg void OnBnClickedCheckStartStopMode();
-    afx_msg void OnBnClickedCheckEventInband();
-    afx_msg void OnBnClickedCheckDtmfFeedback();
-    afx_msg void OnBnClickedCheckDirectFeedback();
-    afx_msg void OnBnClickedRadioSingle();
-    afx_msg void OnBnClickedRadioMulti();
-    afx_msg void OnBnClickedRadioStartStop();
-    afx_msg void OnBnClickedButtonSetRxTelephonePt();
-    afx_msg void OnBnClickedButtonSetTxTelephonePt();
-    afx_msg void OnBnClickedButtonSendTelephoneEvent();
-    afx_msg void OnBnClickedCheckDetectInband();
-    afx_msg void OnBnClickedCheckDetectOutOfBand();
-    afx_msg void OnBnClickedCheckEventDetection();
-
-private:
-    void SendTelephoneEvent(unsigned char eventCode);
-
-private:
-    VoiceEngine*                _vePtr;
-    VoEBase*                    _veBasePtr;
-    VoEDtmf*                    _veDTMFPtr;
-    VoECodec*                   _veCodecPtr;
-    int                         _channel;
-    CString                     _strMsg;
-    CDialog*                    _parentDialogPtr;
-    TelephoneEventObserver*     _telephoneEventObserverPtr;
-    bool                        _PlayDtmfToneLocally;
-    bool                        _modeStartStop;
-    bool                        _modeSingle;
-    bool                        _modeSequence;
-    bool                        _playingDTMFTone;
-    bool                        _outOfBandEventDetection;
-    bool                        _inbandEventDetection;
-};
-
-IMPLEMENT_DYNAMIC(CTelephonyEvent, CDialog)
-
-CTelephonyEvent::CTelephonyEvent(VoiceEngine* voiceEngine,
-                                 int channel,
-                                 CDialog* pParentDialog,
-                                 CWnd* pParent /*=NULL*/)
-    : _vePtr(voiceEngine),
-      _channel(channel),
-      _PlayDtmfToneLocally(false),
-      _modeStartStop(false),
-      _modeSingle(true),
-      _modeSequence(false),
-      _playingDTMFTone(false),
-      _outOfBandEventDetection(true),
-      _inbandEventDetection(false),
-      _parentDialogPtr(pParentDialog),
-      _telephoneEventObserverPtr(NULL),
-      CDialog(CTelephonyEvent::IDD, pParent)
-{
-    _veBasePtr = VoEBase::GetInterface(_vePtr);
-    _veDTMFPtr = VoEDtmf::GetInterface(_vePtr);
-    _veCodecPtr = VoECodec::GetInterface(_vePtr);
-}
-
-CTelephonyEvent::~CTelephonyEvent()
-{
-    _veDTMFPtr->Release();
-    _veCodecPtr->Release();
-    _veBasePtr->Release();
-
-    if (_telephoneEventObserverPtr)
-    {
-        _veDTMFPtr->DeRegisterTelephoneEventDetection(_channel);
-        delete _telephoneEventObserverPtr;
-        _telephoneEventObserverPtr = NULL;
-    }
-}
-
-void CTelephonyEvent::DoDataExchange(CDataExchange* pDX)
-{
-    CDialog::DoDataExchange(pDX);
-}
-
-
-BEGIN_MESSAGE_MAP(CTelephonyEvent, CDialog)
-    ON_BN_CLICKED(IDC_BUTTON_1, &CTelephonyEvent::OnBnClickedButton1)
-    ON_BN_CLICKED(IDC_BUTTON_2, &CTelephonyEvent::OnBnClickedButton2)
-    ON_BN_CLICKED(IDC_BUTTON_3, &CTelephonyEvent::OnBnClickedButton3)
-    ON_BN_CLICKED(IDC_BUTTON_4, &CTelephonyEvent::OnBnClickedButton4)
-    ON_BN_CLICKED(IDC_BUTTON_5, &CTelephonyEvent::OnBnClickedButton5)
-    ON_BN_CLICKED(IDC_BUTTON_6, &CTelephonyEvent::OnBnClickedButton6)
-    ON_BN_CLICKED(IDC_BUTTON_7, &CTelephonyEvent::OnBnClickedButton7)
-    ON_BN_CLICKED(IDC_BUTTON_8, &CTelephonyEvent::OnBnClickedButton8)
-    ON_BN_CLICKED(IDC_BUTTON_9, &CTelephonyEvent::OnBnClickedButton9)
-    ON_BN_CLICKED(IDC_BUTTON_10, &CTelephonyEvent::OnBnClickedButton10)
-    ON_BN_CLICKED(IDC_BUTTON_11, &CTelephonyEvent::OnBnClickedButton11)
-    ON_BN_CLICKED(IDC_BUTTON_12, &CTelephonyEvent::OnBnClickedButton12)
-    ON_BN_CLICKED(IDC_BUTTON_13, &CTelephonyEvent::OnBnClickedButtonA)
-    ON_BN_CLICKED(IDC_BUTTON_14, &CTelephonyEvent::OnBnClickedButtonB)
-    ON_BN_CLICKED(IDC_BUTTON_15, &CTelephonyEvent::OnBnClickedButtonC)
-    ON_BN_CLICKED(IDC_BUTTON_16, &CTelephonyEvent::OnBnClickedButtonD)
-    ON_BN_CLICKED(IDC_CHECK_DTMF_PLAYOUT_RX, &CTelephonyEvent::OnBnClickedCheckDtmfPlayoutRx)
-    ON_BN_CLICKED(IDC_CHECK_DTMF_PLAY_TONE, &CTelephonyEvent::OnBnClickedCheckDtmfPlayTone)
-    ON_BN_CLICKED(IDC_CHECK_EVENT_INBAND, &CTelephonyEvent::OnBnClickedCheckEventInband)
-    ON_BN_CLICKED(IDC_CHECK_DTMF_FEEDBACK, &CTelephonyEvent::OnBnClickedCheckDtmfFeedback)
-    ON_BN_CLICKED(IDC_CHECK_DIRECT_FEEDBACK, &CTelephonyEvent::OnBnClickedCheckDirectFeedback)
-    ON_BN_CLICKED(IDC_RADIO_SINGLE, &CTelephonyEvent::OnBnClickedRadioSingle)
-    ON_BN_CLICKED(IDC_RADIO_MULTI, &CTelephonyEvent::OnBnClickedRadioMulti)
-    ON_BN_CLICKED(IDC_RADIO_START_STOP, &CTelephonyEvent::OnBnClickedRadioStartStop)
-    ON_BN_CLICKED(IDC_BUTTON_SET_RX_TELEPHONE_PT, &CTelephonyEvent::OnBnClickedButtonSetRxTelephonePt)
-    ON_BN_CLICKED(IDC_BUTTON_SET_TX_TELEPHONE_PT, &CTelephonyEvent::OnBnClickedButtonSetTxTelephonePt)
-    ON_BN_CLICKED(IDC_BUTTON_SEND_TELEPHONE_EVENT, &CTelephonyEvent::OnBnClickedButtonSendTelephoneEvent)
-    ON_BN_CLICKED(IDC_CHECK_DETECT_INBAND, &CTelephonyEvent::OnBnClickedCheckDetectInband)
-    ON_BN_CLICKED(IDC_CHECK_DETECT_OUT_OF_BAND, &CTelephonyEvent::OnBnClickedCheckDetectOutOfBand)
-    ON_BN_CLICKED(IDC_CHECK_EVENT_DETECTION, &CTelephonyEvent::OnBnClickedCheckEventDetection)
-END_MESSAGE_MAP()
-
-
-// CTelephonyEvent message handlers
-
-BOOL CTelephonyEvent::OnInitDialog()
-{
-    CDialog::OnInitDialog();
-
-    CString str;
-    GetWindowText(str);
-    str.AppendFormat(_T(" [channel = %d]"), _channel);
-    SetWindowText(str);
-
-    // Update dialog with latest playout state
-    bool enabled(false);
-    _veDTMFPtr->GetDtmfPlayoutStatus(_channel, enabled);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_DTMF_PLAYOUT_RX);
-    button->SetCheck(enabled ? BST_CHECKED : BST_UNCHECKED);
-
-    // Update dialog with latest feedback state
-    bool directFeedback(false);
-    _veDTMFPtr->GetDtmfFeedbackStatus(enabled, directFeedback);
-    button = (CButton*)GetDlgItem(IDC_CHECK_DTMF_FEEDBACK);
-    button->SetCheck(enabled ? BST_CHECKED : BST_UNCHECKED);
-    button = (CButton*)GetDlgItem(IDC_CHECK_DIRECT_FEEDBACK);
-    button->SetCheck(directFeedback ? BST_CHECKED : BST_UNCHECKED);
-
-    // Default event length is 160 ms
-    SetDlgItemInt(IDC_EDIT_EVENT_LENGTH, 160);
-
-    // Default event attenuation is 10 (<-> -10dBm0)
-    SetDlgItemInt(IDC_EDIT_EVENT_ATTENUATION, 10);
-
-    // Current event-detection status
-    TelephoneEventDetectionMethods detectionMethod(kOutOfBand);
-    if (_veDTMFPtr->GetTelephoneEventDetectionStatus(_channel, enabled, detectionMethod) == 0)
-    {
-        // DTMF detection is supported
-        if (enabled)
-        {
-            button = (CButton*)GetDlgItem(IDC_CHECK_EVENT_DETECTION);
-            button->SetCheck(BST_CHECKED);
-        }
-        if (detectionMethod == kOutOfBand || detectionMethod == kInAndOutOfBand)
-        {
-            button = (CButton*)GetDlgItem(IDC_CHECK_DETECT_OUT_OF_BAND);
-            button->SetCheck(BST_CHECKED);
-        }
-        if (detectionMethod == kInBand || detectionMethod == kInAndOutOfBand)
-        {
-            button = (CButton*)GetDlgItem(IDC_CHECK_DETECT_INBAND);
-            button->SetCheck(BST_CHECKED);
-        }
-    }
-    else
-    {
-        // DTMF detection is not supported
-        GetDlgItem(IDC_CHECK_EVENT_DETECTION)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_DETECT_OUT_OF_BAND)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_DETECT_INBAND)->EnableWindow(FALSE);
-        GetDlgItem(IDC_EDIT_ON_EVENT_INBAND)->EnableWindow(FALSE);
-        GetDlgItem(IDC_EDIT_ON_EVENT_OUT_OF_BAND)->EnableWindow(FALSE);
-    }
-
-    // Telephone-event PTs
-    unsigned char pt(0);
-    _veDTMFPtr->GetSendTelephoneEventPayloadType(_channel, pt);
-    SetDlgItemInt(IDC_EDIT_EVENT_TX_PT, pt);
-
-    CodecInst codec;
-    strcpy_s(codec.plname, 32, "telephone-event"); codec.channels = 1; codec.plfreq = 8000;
-    _veCodecPtr->GetRecPayloadType(_channel, codec);
-    SetDlgItemInt(IDC_EDIT_EVENT_RX_PT, codec.pltype);
-
-    if (_modeSingle)
-    {
-        ((CButton*)GetDlgItem(IDC_RADIO_SINGLE))->SetCheck(BST_CHECKED);
-    }
-    else if (_modeStartStop)
-    {
-        ((CButton*)GetDlgItem(IDC_RADIO_START_STOP))->SetCheck(BST_CHECKED);
-    }
-    else if (_modeSequence)
-    {
-        ((CButton*)GetDlgItem(IDC_RADIO_MULTI))->SetCheck(BST_CHECKED);
-    }
-
-    return TRUE;  // return TRUE  unless you set the focus to a control
-}
-void CTelephonyEvent::SendTelephoneEvent(unsigned char eventCode)
-{
-    BOOL ret;
-    int lengthMs(0);
-    int attenuationDb(0);
-    bool outBand(false);
-    int res(0);
-
-    // tone length
-    if (!_modeStartStop)
-    {
-        lengthMs = GetDlgItemInt(IDC_EDIT_EVENT_LENGTH, &ret);
-        if (ret == FALSE)
-        {
-            // use default length if edit field is empty
-            lengthMs = 160;
-        }
-    }
-
-    // attenuation
-    attenuationDb = GetDlgItemInt(IDC_EDIT_EVENT_ATTENUATION, &ret);
-    if (ret == FALSE)
-    {
-        // use default length if edit field is empty
-        attenuationDb = 10;
-    }
-
-    // out-band or in-band
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_EVENT_INBAND);
-    int check = button->GetCheck();
-    outBand = (check == BST_UNCHECKED);
-
-    if (eventCode < 16)
-        SetDlgItemInt(IDC_EDIT_DTMF_EVENT, eventCode);
-
-    if (_PlayDtmfToneLocally)
-    {
-        // --- PlayDtmfTone
-
-        if (_modeSingle)
-        {
-            TEST2(_veDTMFPtr->PlayDtmfTone(eventCode, lengthMs, attenuationDb) == 0,
-                _T("PlayDtmfTone(eventCode=%u, lengthMs=%d, attenuationDb=%d)"), eventCode, lengthMs, attenuationDb);
-        }
-        else if (_modeStartStop)
-        {
-            if (!_playingDTMFTone)
-            {
-                TEST2((res = _veDTMFPtr->StartPlayingDtmfTone(eventCode, attenuationDb)) == 0,
-                    _T("StartPlayingDtmfTone(eventCode=%u, attenuationDb=%d)"), eventCode, attenuationDb);
-            }
-            else
-            {
-                TEST2((res = _veDTMFPtr->StopPlayingDtmfTone()) == 0,
-                    _T("StopPlayingDTMFTone()"));
-            }
-            if (res == 0)
-                _playingDTMFTone = !_playingDTMFTone;
-        }
-        else if (_modeSequence)
-        {
-            int nTones(1);
-            int sleepMs(0);
-            int lenMult(1);
-            if (eventCode == 1)
-            {
-                nTones = 2;
-                sleepMs = lengthMs;
-                lenMult = 1;
-            }
-            else if (eventCode == 2)
-            {
-                nTones = 2;
-                sleepMs = lengthMs/2;
-                lenMult = 2;
-            }
-            else if (eventCode == 3)
-            {
-                nTones = 3;
-                sleepMs = 0;
-                lenMult = 1;
-            }
-            for (int i = 0; i < nTones; i++)
-            {
-                TEST2(_veDTMFPtr->PlayDtmfTone(eventCode, lengthMs, attenuationDb) == 0,
-                    _T("PlayDtmfTone(eventCode=%u, outBand=%d, lengthMs=%d, attenuationDb=%d)"), eventCode, lengthMs, attenuationDb);
-                Sleep(sleepMs);
-                lengthMs = lenMult*lengthMs;
-                eventCode++;
-            }
-        }
-    }
-    else
-    {
-        // --- SendTelephoneEvent
-
-        if (_modeSingle)
-        {
-            TEST2(_veDTMFPtr->SendTelephoneEvent(_channel, eventCode, outBand, lengthMs, attenuationDb) == 0,
-                _T("SendTelephoneEvent(channel=%d, eventCode=%u, outBand=%d, lengthMs=%d, attenuationDb=%d)"), _channel, eventCode, outBand, lengthMs, attenuationDb);
-        }
-        else if (_modeStartStop)
-        {
-            TEST2(false, _T("*** NOT IMPLEMENTED ***"));
-        }
-        else if (_modeSequence)
-        {
-            int nTones(1);
-            int sleepMs(0);
-            int lenMult(1);
-            if (eventCode == 1)
-            {
-                nTones = 2;
-                sleepMs = lengthMs;
-                lenMult = 1;
-            }
-            else if (eventCode == 2)
-            {
-                eventCode = 1;
-                nTones = 2;
-                sleepMs = lengthMs/2;
-                lenMult = 2;
-            }
-            else if (eventCode == 3)
-            {
-                eventCode = 1;
-                nTones = 3;
-                sleepMs = 0;
-                lenMult = 1;
-            }
-            for (int i = 0; i < nTones; i++)
-            {
-                TEST2(_veDTMFPtr->SendTelephoneEvent(_channel, eventCode, outBand, lengthMs, attenuationDb) == 0,
-                    _T("SendTelephoneEvent(channel=%d, eventCode=%u, outBand=%d, lengthMs=%d, attenuationDb=%d)"), _channel, eventCode, outBand, lengthMs, attenuationDb);
-                Sleep(sleepMs);
-                lengthMs = lenMult*lengthMs;
-                eventCode++;
-            }
-        }
-    }
-}
-
-void CTelephonyEvent::OnBnClickedButtonSendTelephoneEvent()
-{
-    BOOL ret;
-    unsigned char eventCode(0);
-
-    eventCode = (unsigned char)GetDlgItemInt(IDC_EDIT_EVENT_CODE, &ret);
-    if (ret == FALSE)
-    {
-        return;
-    }
-    SendTelephoneEvent(eventCode);
-}
-
-void CTelephonyEvent::OnBnClickedButton1()
-{
-    SendTelephoneEvent(1);
-}
-
-void CTelephonyEvent::OnBnClickedButton2()
-{
-    SendTelephoneEvent(2);
-}
-
-void CTelephonyEvent::OnBnClickedButton3()
-{
-    SendTelephoneEvent(3);
-}
-
-void CTelephonyEvent::OnBnClickedButton4()
-{
-    SendTelephoneEvent(4);
-}
-
-void CTelephonyEvent::OnBnClickedButton5()
-{
-    SendTelephoneEvent(5);
-}
-
-void CTelephonyEvent::OnBnClickedButton6()
-{
-    SendTelephoneEvent(6);
-}
-
-void CTelephonyEvent::OnBnClickedButton7()
-{
-    SendTelephoneEvent(7);
-}
-
-void CTelephonyEvent::OnBnClickedButton8()
-{
-    SendTelephoneEvent(8);
-}
-
-void CTelephonyEvent::OnBnClickedButton9()
-{
-    SendTelephoneEvent(9);
-}
-
-void CTelephonyEvent::OnBnClickedButton10()
-{
-    // *
-    SendTelephoneEvent(10);
-}
-
-void CTelephonyEvent::OnBnClickedButton11()
-{
-    SendTelephoneEvent(0);
-}
-
-void CTelephonyEvent::OnBnClickedButton12()
-{
-    // #
-    SendTelephoneEvent(11);
-}
-
-void CTelephonyEvent::OnBnClickedButtonA()
-{
-    SendTelephoneEvent(12);
-}
-
-void CTelephonyEvent::OnBnClickedButtonB()
-{
-    SendTelephoneEvent(13);
-}
-
-void CTelephonyEvent::OnBnClickedButtonC()
-{
-    SendTelephoneEvent(14);
-}
-
-void CTelephonyEvent::OnBnClickedButtonD()
-{
-    SendTelephoneEvent(15);
-}
-
-void CTelephonyEvent::OnBnClickedCheckDtmfPlayoutRx()
-{
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_DTMF_PLAYOUT_RX);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    TEST2(_veDTMFPtr->SetDtmfPlayoutStatus(_channel, enable) == 0, _T("SetDtmfPlayoutStatus(channel=%d, enable=%d)"), _channel, enable);
-}
-
-void CTelephonyEvent::OnBnClickedCheckDtmfPlayTone()
-{
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_DTMF_PLAY_TONE);
-    int check = button->GetCheck();
-    _PlayDtmfToneLocally = (check == BST_CHECKED);
-}
-
-void CTelephonyEvent::OnBnClickedRadioSingle()
-{
-    _modeStartStop = false;
-    _modeSingle = true;
-    _modeSequence = false;
-}
-
-void CTelephonyEvent::OnBnClickedRadioMulti()
-{
-    _modeStartStop = false;
-    _modeSingle = false;
-    _modeSequence = true;
-}
-
-void CTelephonyEvent::OnBnClickedRadioStartStop()
-{
-    // CButton* button = (CButton*)GetDlgItem(IDC_RADIO_START_STOP);
-    // int check = button->GetCheck();
-    _modeStartStop = true;
-    _modeSingle = false;
-    _modeSequence = false;
-    // GetDlgItem(IDC_EDIT_EVENT_LENGTH)->EnableWindow();
-}
-
-void CTelephonyEvent::OnBnClickedCheckEventInband()
-{
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_EVENT_INBAND);
-    int check = button->GetCheck();
-    GetDlgItem(IDC_EDIT_EVENT_CODE)->EnableWindow(check?FALSE:TRUE);
-    GetDlgItem(IDC_BUTTON_SEND_TELEPHONE_EVENT)->EnableWindow(check?FALSE:TRUE);
-}
-
-void CTelephonyEvent::OnBnClickedCheckDtmfFeedback()
-{
-    CButton* button(NULL);
-
-    // Retrieve feedback state
-    button = (CButton*)GetDlgItem(IDC_CHECK_DTMF_FEEDBACK);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-
-    // Retrieve direct-feedback setting
-    button = (CButton*)GetDlgItem(IDC_CHECK_DIRECT_FEEDBACK);
-    check = button->GetCheck();
-    const bool directFeedback = (check == BST_CHECKED);
-
-    // GetDlgItem(IDC_CHECK_DIRECT_FEEDBACK)->EnableWindow(enable ? TRUE : FALSE);
-
-    TEST2(_veDTMFPtr->SetDtmfFeedbackStatus(enable, directFeedback) == 0,
-        _T("SetDtmfFeedbackStatus(enable=%d, directFeedback=%d)"), enable, directFeedback);
-}
-
-void CTelephonyEvent::OnBnClickedCheckDirectFeedback()
-{
-    CButton* button(NULL);
-
-    // Retrieve feedback state
-    button = (CButton*)GetDlgItem(IDC_CHECK_DTMF_FEEDBACK);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-
-    // Retrieve new direct-feedback setting
-    button = (CButton*)GetDlgItem(IDC_CHECK_DIRECT_FEEDBACK);
-    check = button->GetCheck();
-    const bool directFeedback = (check == BST_CHECKED);
-
-    TEST2(_veDTMFPtr->SetDtmfFeedbackStatus(enable, directFeedback) == 0,
-        _T("SetDtmfFeedbackStatus(enable=%d, directFeedback=%d)"), enable, directFeedback);
-}
-
-void CTelephonyEvent::OnBnClickedButtonSetRxTelephonePt()
-{
-    BOOL ret;
-    int pt = GetDlgItemInt(IDC_EDIT_EVENT_RX_PT, &ret);
-    if (ret == FALSE || pt < 0 || pt > 127)
-        return;
-    CodecInst codec;
-    strcpy_s(codec.plname, 32, "telephone-event");
-    codec.pltype = pt;
-    codec.channels = 1;
-    codec.plfreq = 8000;
-    TEST2(_veCodecPtr->SetRecPayloadType(_channel, codec) == 0,
-          _T("SetRecPayloadType(channel=%d, codec.pltype=%d)"), _channel,
-          codec.pltype);
-}
-
-void CTelephonyEvent::OnBnClickedButtonSetTxTelephonePt()
-{
-    BOOL ret;
-    int pt = GetDlgItemInt(IDC_EDIT_EVENT_TX_PT, &ret);
-    if (ret == FALSE || pt < 0 || pt > 127)
-        return;
-    TEST2(_veDTMFPtr->SetSendTelephoneEventPayloadType(_channel, pt) == 0,
-          _T("SetSendTelephoneEventPayloadType(channel=%d, type=%d)"), _channel,
-          pt);
-}
-
-void CTelephonyEvent::OnBnClickedCheckDetectInband()
-{
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_DETECT_INBAND);
-    int check = button->GetCheck();
-    _inbandEventDetection = (check == BST_CHECKED);
-
-    bool enabled(false);
-    TelephoneEventDetectionMethods detectionMethod;
-    _veDTMFPtr->GetTelephoneEventDetectionStatus(_channel, enabled, detectionMethod);
-    if (enabled)
-    {
-        // deregister
-        _veDTMFPtr->DeRegisterTelephoneEventDetection(_channel);
-        delete _telephoneEventObserverPtr;
-        _telephoneEventObserverPtr = NULL;
-        SetDlgItemText(IDC_EDIT_ON_EVENT_INBAND,_T(""));
-        SetDlgItemText(IDC_EDIT_ON_EVENT_OUT_OF_BAND,_T(""));
-    }
-    OnBnClickedCheckEventDetection();
-}
-
-void CTelephonyEvent::OnBnClickedCheckDetectOutOfBand()
-{
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_DETECT_OUT_OF_BAND);
-    int check = button->GetCheck();
-    _outOfBandEventDetection = (check == BST_CHECKED);
-
-    bool enabled(false);
-    TelephoneEventDetectionMethods detectionMethod;
-    _veDTMFPtr->GetTelephoneEventDetectionStatus(_channel, enabled, detectionMethod);
-    if (enabled)
-    {
-        // deregister
-        _veDTMFPtr->DeRegisterTelephoneEventDetection(_channel);
-        delete _telephoneEventObserverPtr;
-        _telephoneEventObserverPtr = NULL;
-        SetDlgItemText(IDC_EDIT_ON_EVENT_INBAND,_T(""));
-        SetDlgItemText(IDC_EDIT_ON_EVENT_OUT_OF_BAND,_T(""));
-    }
-    OnBnClickedCheckEventDetection();
-}
-
-void CTelephonyEvent::OnBnClickedCheckEventDetection()
-{
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_EVENT_DETECTION);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-
-    if (enable)
-    {
-        TelephoneEventDetectionMethods method(kInBand);
-        if (_inbandEventDetection && !_outOfBandEventDetection)
-            method = kInBand;
-        else if (!_inbandEventDetection && _outOfBandEventDetection)
-            method = kOutOfBand;
-        else if (_inbandEventDetection && _outOfBandEventDetection)
-            method = kInAndOutOfBand;
-
-        CWnd* wndOut = GetDlgItem(IDC_EDIT_ON_EVENT_OUT_OF_BAND);
-        CWnd* wndIn = GetDlgItem(IDC_EDIT_ON_EVENT_INBAND);
-        _telephoneEventObserverPtr = new TelephoneEventObserver(wndOut, wndIn);
-
-        TEST2(_veDTMFPtr->RegisterTelephoneEventDetection(_channel, method, *_telephoneEventObserverPtr) == 0,
-            _T("RegisterTelephoneEventDetection(channel=%d, detectionMethod=%d)"), _channel, method);
-    }
-    else
-    {
-        TEST2(_veDTMFPtr->DeRegisterTelephoneEventDetection(_channel) == 0,
-            _T("DeRegisterTelephoneEventDetection(channel=%d)"), _channel);
-        delete _telephoneEventObserverPtr;
-        _telephoneEventObserverPtr = NULL;
-        SetDlgItemText(IDC_EDIT_ON_EVENT_INBAND,_T(""));
-        SetDlgItemText(IDC_EDIT_ON_EVENT_OUT_OF_BAND,_T(""));
-    }
-}
-
-// ============================================================================
-//                                 CWinTestDlg dialog
-// ============================================================================
-
-CWinTestDlg::CWinTestDlg(CWnd* pParent /*=NULL*/)
-    : CDialog(CWinTestDlg::IDD, pParent),
-    _failCount(0),
-    _vePtr(NULL),
-    _veBasePtr(NULL),
-    _veCodecPtr(NULL),
-    _veNetworkPtr(NULL),
-    _veFilePtr(NULL),
-    _veHardwarePtr(NULL),
-    _veExternalMediaPtr(NULL),
-    _veApmPtr(NULL),
-    _veRtpRtcpPtr(NULL),
-    _transportPtr(NULL),
-    _externalMediaPtr(NULL),
-    _externalTransport(false),
-    _externalTransportBuild(false),
-    _checkPlayFileIn(0),
-    _checkPlayFileIn1(0),
-    _checkPlayFileIn2(0),
-    _checkPlayFileOut1(0),
-    _checkPlayFileOut2(0),
-    _checkAGC(0),
-    _checkAGC1(0),
-    _checkNS(0),
-    _checkNS1(0),
-    _checkEC(0),
-    _checkVAD1(0),
-    _checkVAD2(0),
-    _checkSrtpTx1(0),
-    _checkSrtpTx2(0),
-    _checkSrtpRx1(0),
-    _checkSrtpRx2(0),
-    _checkConference1(0),
-    _checkConference2(0),
-    _checkOnHold1(0),
-    _checkOnHold2(0),
-    _strComboIp1(_T("")),
-    _strComboIp2(_T("")),
-    _delayEstimate1(false),
-    _delayEstimate2(false),
-    _rxVad(false),
-    _nErrorCallbacks(0),
-    _timerTicks(0)
-{
-    m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
-
-    _vePtr = VoiceEngine::Create();
-
-    VoiceEngine::SetTraceFilter(kTraceNone);
-    // VoiceEngine::SetTraceFilter(kTraceAll);
-    // VoiceEngine::SetTraceFilter(kTraceStream | kTraceStateInfo | kTraceWarning | kTraceError | kTraceCritical | kTraceApiCall | kTraceModuleCall | kTraceMemory | kTraceDebug | kTraceInfo);
-    // VoiceEngine::SetTraceFilter(kTraceStateInfo | kTraceWarning | kTraceError | kTraceCritical | kTraceApiCall | kTraceModuleCall | kTraceMemory | kTraceInfo);
-
-    VoiceEngine::SetTraceFile("ve_win_test.txt");
-    VoiceEngine::SetTraceCallback(NULL);
-
-    if (_vePtr)
-    {
-        _veExternalMediaPtr = VoEExternalMedia::GetInterface(_vePtr);
-        _veVolumeControlPtr = VoEVolumeControl::GetInterface(_vePtr);
-        _veVideoSyncPtr = VoEVideoSync::GetInterface(_vePtr);
-        _veNetworkPtr = VoENetwork::GetInterface(_vePtr);
-        _veFilePtr = VoEFile::GetInterface(_vePtr);
-        _veApmPtr = VoEAudioProcessing::GetInterface(_vePtr);
-
-        _veBasePtr = VoEBase::GetInterface(_vePtr);
-        _veCodecPtr = VoECodec::GetInterface(_vePtr);
-        _veHardwarePtr = VoEHardware::GetInterface(_vePtr);
-        _veRtpRtcpPtr = VoERTP_RTCP::GetInterface(_vePtr);
-        _transportPtr = new MyTransport(_veNetworkPtr);
-        _externalMediaPtr = new MediaProcessImpl();
-        _rxVadObserverPtr = new RxCallback();
-    }
-
-    _veBasePtr->RegisterVoiceEngineObserver(*this);
-
-    std::string resource_path = webrtc::test::ProjectRootPath();
-    if (resource_path == webrtc::test::kCannotFindProjectRootDir) {
-        _long_audio_file_path = "./";
-    } else {
-        _long_audio_file_path = resource_path + "data\\voice_engine\\";
-    }
-}
-
-CWinTestDlg::~CWinTestDlg()
-{
-    if (_externalMediaPtr) delete _externalMediaPtr;
-    if (_transportPtr) delete _transportPtr;
-    if (_rxVadObserverPtr) delete _rxVadObserverPtr;
-
-    if (_veExternalMediaPtr) _veExternalMediaPtr->Release();
-    if (_veVideoSyncPtr) _veVideoSyncPtr->Release();
-    if (_veVolumeControlPtr) _veVolumeControlPtr->Release();
-
-    if (_veBasePtr) _veBasePtr->Terminate();
-    if (_veBasePtr) _veBasePtr->Release();
-
-    if (_veCodecPtr) _veCodecPtr->Release();
-    if (_veNetworkPtr) _veNetworkPtr->Release();
-    if (_veFilePtr) _veFilePtr->Release();
-    if (_veHardwarePtr) _veHardwarePtr->Release();
-    if (_veApmPtr) _veApmPtr->Release();
-    if (_veRtpRtcpPtr) _veRtpRtcpPtr->Release();
-    if (_vePtr)
-    {
-        VoiceEngine::Delete(_vePtr);
-    }
-    VoiceEngine::SetTraceFilter(kTraceNone);
-}
-
-void CWinTestDlg::DoDataExchange(CDataExchange* pDX)
-{
-    CDialog::DoDataExchange(pDX);
-    DDX_CBString(pDX, IDC_COMBO_IP_1, _strComboIp1);
-    DDX_CBString(pDX, IDC_COMBO_IP_2, _strComboIp2);
-}
-
-BEGIN_MESSAGE_MAP(CWinTestDlg, CDialog)
-    ON_WM_SYSCOMMAND()
-    ON_WM_PAINT()
-    ON_WM_QUERYDRAGICON()
-    ON_WM_TIMER()
-    //}}AFX_MSG_MAP
-    ON_BN_CLICKED(IDC_BUTTON_CREATE_1, &CWinTestDlg::OnBnClickedButtonCreate1)
-    ON_BN_CLICKED(IDC_BUTTON_DELETE_1, &CWinTestDlg::OnBnClickedButtonDelete1)
-    ON_BN_CLICKED(IDC_BUTTON_CREATE_2, &CWinTestDlg::OnBnClickedButtonCreate2)
-    ON_BN_CLICKED(IDC_BUTTON_DELETE_2, &CWinTestDlg::OnBnClickedButtonDelete2)
-    ON_CBN_SELCHANGE(IDC_COMBO_CODEC_1, &CWinTestDlg::OnCbnSelchangeComboCodec1)
-    ON_BN_CLICKED(IDC_BUTTON_START_LISTEN_1, &CWinTestDlg::OnBnClickedButtonStartListen1)
-    ON_BN_CLICKED(IDC_BUTTON_STOP_LISTEN_1, &CWinTestDlg::OnBnClickedButtonStopListen1)
-    ON_BN_CLICKED(IDC_BUTTON_START_PLAYOUT_1, &CWinTestDlg::OnBnClickedButtonStartPlayout1)
-    ON_BN_CLICKED(IDC_BUTTON_STOP_PLAYOUT_1, &CWinTestDlg::OnBnClickedButtonStopPlayout1)
-    ON_BN_CLICKED(IDC_BUTTON_START_SEND_1, &CWinTestDlg::OnBnClickedButtonStartSend1)
-    ON_BN_CLICKED(IDC_BUTTON_STOP_SEND_1, &CWinTestDlg::OnBnClickedButtonStopSend1)
-    ON_CBN_SELCHANGE(IDC_COMBO_IP_2, &CWinTestDlg::OnCbnSelchangeComboIp2)
-    ON_CBN_SELCHANGE(IDC_COMBO_IP_1, &CWinTestDlg::OnCbnSelchangeComboIp1)
-    ON_CBN_SELCHANGE(IDC_COMBO_CODEC_2, &CWinTestDlg::OnCbnSelchangeComboCodec2)
-    ON_BN_CLICKED(IDC_BUTTON_START_LISTEN_2, &CWinTestDlg::OnBnClickedButtonStartListen2)
-    ON_BN_CLICKED(IDC_BUTTON_STOP_LISTEN_2, &CWinTestDlg::OnBnClickedButtonStopListen2)
-    ON_BN_CLICKED(IDC_BUTTON_START_PLAYOUT_2, &CWinTestDlg::OnBnClickedButtonStartPlayout2)
-    ON_BN_CLICKED(IDC_BUTTON_STOP_PLAYOUT_2, &CWinTestDlg::OnBnClickedButtonStopPlayout2)
-    ON_BN_CLICKED(IDC_BUTTON_START_SEND_2, &CWinTestDlg::OnBnClickedButtonStartSend2)
-    ON_BN_CLICKED(IDC_BUTTON_STOP_SEND_2, &CWinTestDlg::OnBnClickedButtonStopSend2)
-    ON_BN_CLICKED(IDC_CHECK_EXT_TRANS_1, &CWinTestDlg::OnBnClickedCheckExtTrans1)
-    ON_BN_CLICKED(IDC_CHECK_PLAY_FILE_IN_1, &CWinTestDlg::OnBnClickedCheckPlayFileIn1)
-    ON_BN_CLICKED(IDC_CHECK_PLAY_FILE_OUT_1, &CWinTestDlg::OnBnClickedCheckPlayFileOut1)
-    ON_BN_CLICKED(IDC_CHECK_EXT_TRANS_2, &CWinTestDlg::OnBnClickedCheckExtTrans2)
-    ON_BN_CLICKED(IDC_CHECK_PLAY_FILE_IN_2, &CWinTestDlg::OnBnClickedCheckPlayFileIn2)
-    ON_BN_CLICKED(IDC_CHECK_PLAY_FILE_OUT_2, &CWinTestDlg::OnBnClickedCheckPlayFileOut2)
-    ON_BN_CLICKED(IDC_CHECK_PLAY_FILE_IN, &CWinTestDlg::OnBnClickedCheckPlayFileIn)
-    ON_CBN_SELCHANGE(IDC_COMBO_REC_DEVICE, &CWinTestDlg::OnCbnSelchangeComboRecDevice)
-    ON_CBN_SELCHANGE(IDC_COMBO_PLAY_DEVICE, &CWinTestDlg::OnCbnSelchangeComboPlayDevice)
-    ON_BN_CLICKED(IDC_CHECK_EXT_MEDIA_IN_1, &CWinTestDlg::OnBnClickedCheckExtMediaIn1)
-    ON_BN_CLICKED(IDC_CHECK_EXT_MEDIA_OUT_1, &CWinTestDlg::OnBnClickedCheckExtMediaOut1)
-    ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_INPUT_VOLUME, &CWinTestDlg::OnNMReleasedcaptureSliderInputVolume)
-    ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_OUTPUT_VOLUME, &CWinTestDlg::OnNMReleasedcaptureSliderOutputVolume)
-    ON_BN_CLICKED(IDC_CHECK_AGC, &CWinTestDlg::OnBnClickedCheckAgc)
-    ON_BN_CLICKED(IDC_CHECK_NS, &CWinTestDlg::OnBnClickedCheckNs)
-    ON_BN_CLICKED(IDC_CHECK_EC, &CWinTestDlg::OnBnClickedCheckEc)
-    ON_BN_CLICKED(IDC_CHECK_VAD_1, &CWinTestDlg::OnBnClickedCheckVad1)
-    ON_BN_CLICKED(IDC_CHECK_VAD_3, &CWinTestDlg::OnBnClickedCheckVad2)
-    ON_BN_CLICKED(IDC_CHECK_EXT_MEDIA_IN_2, &CWinTestDlg::OnBnClickedCheckExtMediaIn2)
-    ON_BN_CLICKED(IDC_CHECK_EXT_MEDIA_OUT_2, &CWinTestDlg::OnBnClickedCheckExtMediaOut2)
-    ON_BN_CLICKED(IDC_CHECK_MUTE_IN, &CWinTestDlg::OnBnClickedCheckMuteIn)
-    ON_BN_CLICKED(IDC_CHECK_MUTE_IN_1, &CWinTestDlg::OnBnClickedCheckMuteIn1)
-    ON_BN_CLICKED(IDC_CHECK_MUTE_IN_2, &CWinTestDlg::OnBnClickedCheckMuteIn2)
-    ON_BN_CLICKED(IDC_CHECK_SRTP_TX_1, &CWinTestDlg::OnBnClickedCheckSrtpTx1)
-    ON_BN_CLICKED(IDC_CHECK_SRTP_RX_1, &CWinTestDlg::OnBnClickedCheckSrtpRx1)
-    ON_BN_CLICKED(IDC_CHECK_SRTP_TX_2, &CWinTestDlg::OnBnClickedCheckSrtpTx2)
-    ON_BN_CLICKED(IDC_CHECK_SRTP_RX_2, &CWinTestDlg::OnBnClickedCheckSrtpRx2)
-    ON_BN_CLICKED(IDC_CHECK_EXT_ENCRYPTION_1, &CWinTestDlg::OnBnClickedCheckExtEncryption1)
-    ON_BN_CLICKED(IDC_CHECK_EXT_ENCRYPTION_2, &CWinTestDlg::OnBnClickedCheckExtEncryption2)
-    ON_BN_CLICKED(IDC_BUTTON_DTMF_1, &CWinTestDlg::OnBnClickedButtonDtmf1)
-    ON_BN_CLICKED(IDC_CHECK_REC_MIC, &CWinTestDlg::OnBnClickedCheckRecMic)
-    ON_BN_CLICKED(IDC_BUTTON_DTMF_2, &CWinTestDlg::OnBnClickedButtonDtmf2)
-    ON_BN_CLICKED(IDC_BUTTON_TEST_1, &CWinTestDlg::OnBnClickedButtonTest1)
-    ON_BN_CLICKED(IDC_CHECK_CONFERENCE_1, &CWinTestDlg::OnBnClickedCheckConference1)
-    ON_BN_CLICKED(IDC_CHECK_CONFERENCE_2, &CWinTestDlg::OnBnClickedCheckConference2)
-    ON_BN_CLICKED(IDC_CHECK_ON_HOLD_1, &CWinTestDlg::OnBnClickedCheckOnHold1)
-    ON_BN_CLICKED(IDC_CHECK_ON_HOLD_2, &CWinTestDlg::OnBnClickedCheckOnHold2)
-    ON_BN_CLICKED(IDC_CHECK_EXT_MEDIA_IN, &CWinTestDlg::OnBnClickedCheckExtMediaIn)
-    ON_BN_CLICKED(IDC_CHECK_EXT_MEDIA_OUT, &CWinTestDlg::OnBnClickedCheckExtMediaOut)
-    ON_LBN_SELCHANGE(IDC_LIST_CODEC_1, &CWinTestDlg::OnLbnSelchangeListCodec1)
-    ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_PAN_LEFT, &CWinTestDlg::OnNMReleasedcaptureSliderPanLeft)
-    ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_PAN_RIGHT, &CWinTestDlg::OnNMReleasedcaptureSliderPanRight)
-    ON_BN_CLICKED(IDC_BUTTON_VERSION, &CWinTestDlg::OnBnClickedButtonVersion)
-    ON_BN_CLICKED(IDC_CHECK_DELAY_ESTIMATE_1, &CWinTestDlg::OnBnClickedCheckDelayEstimate1)
-    ON_BN_CLICKED(IDC_CHECK_RXVAD, &CWinTestDlg::OnBnClickedCheckRxvad)
-    ON_BN_CLICKED(IDC_CHECK_AGC_1, &CWinTestDlg::OnBnClickedCheckAgc1)
-    ON_BN_CLICKED(IDC_CHECK_NS_1, &CWinTestDlg::OnBnClickedCheckNs1)
-    ON_BN_CLICKED(IDC_CHECK_REC_CALL, &CWinTestDlg::OnBnClickedCheckRecCall)
-    ON_BN_CLICKED(IDC_CHECK_TYPING_DETECTION, &CWinTestDlg::OnBnClickedCheckTypingDetection)
-    ON_BN_CLICKED(IDC_CHECK_RED, &CWinTestDlg::OnBnClickedCheckRED)
-    ON_BN_CLICKED(IDC_BUTTON_CLEAR_ERROR_CALLBACK, &CWinTestDlg::OnBnClickedButtonClearErrorCallback)
-END_MESSAGE_MAP()
-
-BOOL CWinTestDlg::UpdateTest(bool failed, const CString& strMsg)
-{
-    if (failed)
-    {
-        SetDlgItemText(IDC_EDIT_MESSAGE, strMsg);
-        _strErr.Format(_T("FAILED (error=%d)"), _veBasePtr->LastError());
-        SetDlgItemText(IDC_EDIT_RESULT, _strErr);
-        _failCount++;
-        SetDlgItemInt(IDC_EDIT_N_FAILS, _failCount);
-        SetDlgItemInt(IDC_EDIT_LAST_ERROR, _veBasePtr->LastError());
-    }
-    else
-    {
-        SetDlgItemText(IDC_EDIT_MESSAGE, strMsg);
-        SetDlgItemText(IDC_EDIT_RESULT, _T("OK"));
-    }
-    return TRUE;
-}
-
-
-// CWinTestDlg message handlers
-
-BOOL CWinTestDlg::OnInitDialog()
-{
-    CDialog::OnInitDialog();
-
-    // Add "About..." menu item to system menu.
-
-    // IDM_ABOUTBOX must be in the system command range.
-    ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
-    ASSERT(IDM_ABOUTBOX < 0xF000);
-
-    CMenu* pSysMenu = GetSystemMenu(FALSE);
-    if (pSysMenu != NULL)
-    {
-        CString strAboutMenu;
-        strAboutMenu.LoadString(IDS_ABOUTBOX);
-        if (!strAboutMenu.IsEmpty())
-        {
-            pSysMenu->AppendMenu(MF_SEPARATOR);
-            pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
-        }
-    }
-
-    // Set the icon for this dialog.  The framework does this automatically
-    //  when the application's main window is not a dialog
-    SetIcon(m_hIcon, TRUE);            // Set big icon
-    SetIcon(m_hIcon, FALSE);        // Set small icon
-
-    // char version[1024];
-    // _veBasePtr->GetVersion(version);
-    // AfxMessageBox(version, MB_OK);
-
-    if (_veBasePtr->Init() != 0)
-    {
-         AfxMessageBox(_T("Init() failed "), MB_OKCANCEL);
-    }
-
-    int ch = _veBasePtr->CreateChannel();
-    if (_veBasePtr->SetSendDestination(ch, 1234, "127.0.0.1") == -1)
-    {
-        if (_veBasePtr->LastError() == VE_EXTERNAL_TRANSPORT_ENABLED)
-        {
-            _strMsg.Format(_T("*** External transport build ***"));
-            SetDlgItemText(IDC_EDIT_MESSAGE, _strMsg);
-            _externalTransportBuild = true;
-        }
-    }
-    _veBasePtr->DeleteChannel(ch);
-
-    // --- Add (preferred) local IPv4 address in title
-
-    if (_veNetworkPtr)
-    {
-        char localIP[64];
-        _veNetworkPtr->GetLocalIP(localIP);
-        CString str;
-        GetWindowText(str);
-        str.AppendFormat(_T("  [Local IPv4 address: %s]"), CharToTchar(localIP, 64));
-        SetWindowText(str);
-    }
-
-    // --- Volume sliders
-
-    if (_veVolumeControlPtr)
-    {
-        unsigned int volume(0);
-        CSliderCtrl* slider(NULL);
-
-        slider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER_INPUT_VOLUME);
-        slider->SetRangeMin(0);
-        slider->SetRangeMax(255);
-        _veVolumeControlPtr->GetMicVolume(volume);
-        slider->SetPos(volume);
-
-        slider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER_OUTPUT_VOLUME);
-        slider->SetRangeMin(0);
-        slider->SetRangeMax(255);
-        _veVolumeControlPtr->GetSpeakerVolume(volume);
-        slider->SetPos(volume);
-    }
-
-    // --- Panning sliders
-
-    if (_veVolumeControlPtr)
-    {
-        float lVol(0.0);
-        float rVol(0.0);
-        int leftVol, rightVol;
-        CSliderCtrl* slider(NULL);
-
-        _veVolumeControlPtr->GetOutputVolumePan(-1, lVol, rVol);
-
-        leftVol = (int)(lVol*10.0f);    // [0,10]
-        rightVol = (int)(rVol*10.0f);    // [0,10]
-
-        slider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER_PAN_LEFT);
-        slider->SetRange(0,10);
-        slider->SetPos(10-leftVol);        // pos 0 <=> max pan 1.0 (top of slider)
-
-        slider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER_PAN_RIGHT);
-        slider->SetRange(0,10);
-        slider->SetPos(10-rightVol);
-    }
-
-    // --- APM settings
-
-    bool enable(false);
-    CButton* button(NULL);
-
-    AgcModes agcMode(kAgcDefault);
-    if (_veApmPtr->GetAgcStatus(enable, agcMode) == 0)
-    {
-        button = (CButton*)GetDlgItem(IDC_CHECK_AGC);
-        enable ? button->SetCheck(BST_CHECKED) : button->SetCheck(BST_UNCHECKED);
-    }
-    else
-    {
-        // AGC is not supported
-        GetDlgItem(IDC_CHECK_AGC)->EnableWindow(FALSE);
-    }
-
-    NsModes nsMode(kNsDefault);
-    if (_veApmPtr->GetNsStatus(enable, nsMode) == 0)
-    {
-        button = (CButton*)GetDlgItem(IDC_CHECK_NS);
-        enable ? button->SetCheck(BST_CHECKED) : button->SetCheck(BST_UNCHECKED);
-    }
-    else
-    {
-        // NS is not supported
-        GetDlgItem(IDC_CHECK_NS)->EnableWindow(FALSE);
-    }
-
-    EcModes ecMode(kEcDefault);
-    if (_veApmPtr->GetEcStatus(enable, ecMode) == 0)
-    {
-        button = (CButton*)GetDlgItem(IDC_CHECK_EC);
-        enable ? button->SetCheck(BST_CHECKED) : button->SetCheck(BST_UNCHECKED);
-    }
-    else
-    {
-        // EC is not supported
-        GetDlgItem(IDC_CHECK_EC)->EnableWindow(FALSE);
-    }
-
-    // --- First channel section
-
-    GetDlgItem(IDC_COMBO_IP_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_EDIT_TX_PORT_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_EDIT_RX_PORT_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_COMBO_CODEC_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_LIST_CODEC_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_EDIT_CODEC_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_DELETE_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_START_LISTEN_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_STOP_LISTEN_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_START_PLAYOUT_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_STOP_PLAYOUT_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_START_SEND_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_STOP_SEND_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_EXT_TRANS_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_PLAY_FILE_IN_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_PLAY_FILE_OUT_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_VAD_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_MUTE_IN_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_SRTP_TX_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_SRTP_RX_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_EXT_ENCRYPTION_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_DTMF_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_CONFERENCE_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_ON_HOLD_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_DELAY_ESTIMATE_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_RXVAD)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_AGC_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_NS_1)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_RED)->EnableWindow(FALSE);
-
-    CComboBox* comboIP(NULL);
-    comboIP = (CComboBox*)GetDlgItem(IDC_COMBO_IP_1);
-    comboIP->AddString(_T("127.0.0.1"));
-    comboIP->SetCurSel(0);
-
-    SetDlgItemInt(IDC_EDIT_TX_PORT_1, 1111);
-    SetDlgItemInt(IDC_EDIT_RX_PORT_1, 1111);
-
-    // --- Add supported codecs to the codec combo box
-
-    CComboBox* comboCodec(NULL);
-    comboCodec = (CComboBox*)GetDlgItem(IDC_COMBO_CODEC_1);
-    comboCodec->ResetContent();
-
-    int numCodecs = _veCodecPtr->NumOfCodecs();
-    for (int idx = 0; idx < numCodecs; idx++)
-    {
-        CodecInst codec;
-        _veCodecPtr->GetCodec(idx, codec);
-        if ((_stricmp(codec.plname, "CNNB") != 0) &&
-            (_stricmp(codec.plname, "CNWB") != 0))
-        {
-            CString strCodec;
-            if (_stricmp(codec.plname, "G7221") == 0)
-                strCodec.Format(_T("%s (%d/%d/%d)"), CharToTchar(codec.plname, 32), codec.pltype, codec.plfreq/1000, codec.rate/1000);
-            else
-                strCodec.Format(_T("%s (%d/%d)"), CharToTchar(codec.plname, 32), codec.pltype, codec.plfreq/1000);
-            comboCodec->AddString(strCodec);
-        }
-        if (idx == 0)
-        {
-            SetDlgItemInt(IDC_EDIT_CODEC_1, codec.pltype);
-        }
-    }
-    comboCodec->SetCurSel(0);
-
-    CListBox* list = (CListBox*)GetDlgItem(IDC_LIST_CODEC_1);
-    list->AddString(_T("pltype"));
-    list->AddString(_T("plfreq"));
-    list->AddString(_T("pacsize"));
-    list->AddString(_T("channels"));
-    list->AddString(_T("rate"));
-    list->SetCurSel(0);
-
-    // --- Add available audio devices to the combo boxes
-
-    CComboBox* comboRecDevice(NULL);
-    CComboBox* comboPlayDevice(NULL);
-    comboRecDevice = (CComboBox*)GetDlgItem(IDC_COMBO_REC_DEVICE);
-    comboPlayDevice = (CComboBox*)GetDlgItem(IDC_COMBO_PLAY_DEVICE);
-    comboRecDevice->ResetContent();
-    comboPlayDevice->ResetContent();
-
-    if (_veHardwarePtr)
-    {
-        int numPlayout(0);
-        int numRecording(0);
-        char nameStr[128];
-        char guidStr[128];
-        CString strDevice;
-        AudioLayers audioLayer;
-
-        _veHardwarePtr->GetAudioDeviceLayer(audioLayer);
-        if (kAudioWindowsWave == audioLayer)
-        {
-            strDevice.FormatMessage(_T("Audio Layer: Windows Wave API"));
-        }
-        else if (kAudioWindowsCore == audioLayer)
-        {
-            strDevice.FormatMessage(_T("Audio Layer: Windows Core API"));
-        }
-        else
-        {
-            strDevice.FormatMessage(_T("Audio Layer: ** UNKNOWN **"));
-        }
-        SetDlgItemText(IDC_EDIT_AUDIO_LAYER, (LPCTSTR)strDevice);
-
-        _veHardwarePtr->GetNumOfRecordingDevices(numRecording);
-
-        for (int idx = 0; idx < numRecording; idx++)
-        {
-            _veHardwarePtr->GetRecordingDeviceName(idx, nameStr, guidStr);
-      strDevice.Format(_T("%s"), CharToTchar(nameStr, 128));
-            comboRecDevice->AddString(strDevice);
-        }
-        // Select default (communication) device in the combo box
-        _veHardwarePtr->GetRecordingDeviceName(-1, nameStr, guidStr);
-    CString tmp = CString(nameStr);
-        int nIndex = comboRecDevice->SelectString(-1, tmp);
-        ASSERT(nIndex != CB_ERR);
-
-        _veHardwarePtr->GetNumOfPlayoutDevices(numPlayout);
-
-        for (int idx = 0; idx < numPlayout; idx++)
-        {
-            _veHardwarePtr->GetPlayoutDeviceName(idx, nameStr, guidStr);
-      strDevice.Format(_T("%s"), CharToTchar(nameStr, 128));
-            comboPlayDevice->AddString(strDevice);
-        }
-        // Select default (communication) device in the combo box
-        _veHardwarePtr->GetPlayoutDeviceName(-1, nameStr, guidStr);
-        nIndex = comboPlayDevice->SelectString(-1, CString(nameStr));
-        ASSERT(nIndex != CB_ERR);
-    }
-
-    // --- Second channel section
-
-    GetDlgItem(IDC_COMBO_IP_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_EDIT_TX_PORT_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_EDIT_RX_PORT_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_COMBO_CODEC_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_DELETE_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_START_LISTEN_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_STOP_LISTEN_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_START_PLAYOUT_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_STOP_PLAYOUT_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_START_SEND_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_STOP_SEND_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_EXT_TRANS_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_PLAY_FILE_IN_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_PLAY_FILE_OUT_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_VAD_3)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_MUTE_IN_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_SRTP_TX_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_SRTP_RX_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_EXT_ENCRYPTION_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_BUTTON_DTMF_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_CONFERENCE_2)->EnableWindow(FALSE);
-    GetDlgItem(IDC_CHECK_ON_HOLD_2)->EnableWindow(FALSE);
-
-    comboIP = (CComboBox*)GetDlgItem(IDC_COMBO_IP_2);
-    comboIP->AddString(_T("127.0.0.1"));
-    comboIP->SetCurSel(0);
-
-    SetDlgItemInt(IDC_EDIT_TX_PORT_2, 2222);
-    SetDlgItemInt(IDC_EDIT_RX_PORT_2, 2222);
-
-    comboCodec = (CComboBox*)GetDlgItem(IDC_COMBO_CODEC_2);
-    comboCodec->ResetContent();
-
-    if (_veCodecPtr)
-    {
-        numCodecs = _veCodecPtr->NumOfCodecs();
-        for (int idx = 0; idx < numCodecs; idx++)
-        {
-            CodecInst codec;
-            _veCodecPtr->GetCodec(idx, codec);
-            CString strCodec;
-            strCodec.Format(_T("%s (%d/%d)"), CharToTchar(codec.plname, 32), codec.pltype, codec.plfreq/1000);
-            comboCodec->AddString(strCodec);
-        }
-        comboCodec->SetCurSel(0);
-    }
-
-    // --- Start windows timer
-
-    SetTimer(0, 1000, NULL);
-
-    return TRUE;  // return TRUE  unless you set the focus to a control
-}
-
-void CWinTestDlg::OnSysCommand(UINT nID, LPARAM lParam)
-{
-    if ((nID & 0xFFF0) == IDM_ABOUTBOX)
-    {
-        CAboutDlg dlgAbout;
-        dlgAbout.DoModal();
-    }
-    else if (nID == SC_CLOSE)
-    {
-        BOOL ret;
-        int channel(0);
-        channel = GetDlgItemInt(IDC_EDIT_1, &ret);
-        if (ret == TRUE)
-        {
-            _veBasePtr->DeleteChannel(channel);
-        }
-        channel = GetDlgItemInt(IDC_EDIT_2, &ret);
-        if (ret == TRUE)
-        {
-            _veBasePtr->DeleteChannel(channel);
-        }
-
-        CDialog::OnSysCommand(nID, lParam);
-    }
-    else
-    {
-        CDialog::OnSysCommand(nID, lParam);
-    }
-
-}
-
-// If you add a minimize button to your dialog, you will need the code below
-//  to draw the icon.  For MFC applications using the document/view model,
-//  this is automatically done for you by the framework.
-
-void CWinTestDlg::OnPaint()
-{
-    if (IsIconic())
-    {
-        CPaintDC dc(this); // device context for painting
-
-        SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
-
-        // Center icon in client rectangle
-        int cxIcon = GetSystemMetrics(SM_CXICON);
-        int cyIcon = GetSystemMetrics(SM_CYICON);
-        CRect rect;
-        GetClientRect(&rect);
-        int x = (rect.Width() - cxIcon + 1) / 2;
-        int y = (rect.Height() - cyIcon + 1) / 2;
-
-        // Draw the icon
-        dc.DrawIcon(x, y, m_hIcon);
-    }
-    else
-    {
-        CDialog::OnPaint();
-    }
-}
-
-// The system calls this function to obtain the cursor to display while the user drags
-//  the minimized window.
-HCURSOR CWinTestDlg::OnQueryDragIcon()
-{
-    return static_cast<HCURSOR>(m_hIcon);
-}
-
-
-void CWinTestDlg::OnBnClickedButtonCreate1()
-{
-    int channel(0);
-    TEST((channel = _veBasePtr->CreateChannel()) >= 0, _T("CreateChannel(channel=%d)"), channel);
-    if (channel >= 0)
-    {
-        _veRtpRtcpPtr->RegisterRTPObserver(channel, *this);
-
-        SetDlgItemInt(IDC_EDIT_1, channel);
-        GetDlgItem(IDC_BUTTON_CREATE_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_DELETE_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_COMBO_IP_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_EDIT_TX_PORT_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_EDIT_RX_PORT_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_COMBO_CODEC_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_LIST_CODEC_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_EDIT_CODEC_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_START_LISTEN_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_START_PLAYOUT_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_START_SEND_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_EXT_TRANS_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_PLAY_FILE_IN_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_PLAY_FILE_OUT_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_VAD_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_MUTE_IN_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_SRTP_TX_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_SRTP_RX_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_EXT_ENCRYPTION_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_DTMF_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_ON_HOLD_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_DELAY_ESTIMATE_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_RXVAD)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_AGC_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_NS_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_RED)->EnableWindow(TRUE);
-
-        // Always set send codec to default codec <=> index 0.
-        CodecInst codec;
-        _veCodecPtr->GetCodec(0, codec);
-        _veCodecPtr->SetSendCodec(channel, codec);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonCreate2()
-{
-    int channel(0);
-    TEST((channel = _veBasePtr->CreateChannel()) >=0 , _T("CreateChannel(%d)"), channel);
-    if (channel >= 0)
-    {
-        _veRtpRtcpPtr->RegisterRTPObserver(channel, *this);
-
-        SetDlgItemInt(IDC_EDIT_2, channel);
-        GetDlgItem(IDC_BUTTON_CREATE_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_DELETE_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_COMBO_IP_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_EDIT_TX_PORT_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_EDIT_RX_PORT_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_COMBO_CODEC_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_START_LISTEN_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_START_PLAYOUT_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_START_SEND_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_EXT_TRANS_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_PLAY_FILE_IN_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_PLAY_FILE_OUT_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_VAD_3)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_MUTE_IN_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_SRTP_TX_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_SRTP_RX_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_EXT_ENCRYPTION_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_DTMF_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_CONFERENCE_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_CHECK_ON_HOLD_2)->EnableWindow(TRUE);
-
-        // Always set send codec to default codec <=> index 0.
-        CodecInst codec;
-        _veCodecPtr->GetCodec(0, codec);
-        _veCodecPtr->SetSendCodec(channel, codec);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonDelete1()
-{
-    BOOL ret;
-    int channel = GetDlgItemInt(IDC_EDIT_1, &ret);
-    if (ret == TRUE)
-    {
-        _delayEstimate1 = false;
-        _rxVad = false;
-        _veRtpRtcpPtr->DeRegisterRTPObserver(channel);
-        TEST(_veBasePtr->DeleteChannel(channel) == 0, _T("DeleteChannel(channel=%d)"), channel);
-        SetDlgItemText(IDC_EDIT_1, _T(""));
-        GetDlgItem(IDC_BUTTON_CREATE_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_DELETE_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_COMBO_IP_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_EDIT_TX_PORT_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_EDIT_RX_PORT_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_COMBO_CODEC_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_LIST_CODEC_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_EDIT_CODEC_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_START_LISTEN_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_START_PLAYOUT_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_START_SEND_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_LISTEN_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_PLAYOUT_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_SEND_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_DTMF_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_EXT_TRANS_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_PLAY_FILE_IN_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_PLAY_FILE_OUT_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_VAD_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_MUTE_IN_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_SRTP_TX_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_SRTP_RX_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_EXT_ENCRYPTION_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_CONFERENCE_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_ON_HOLD_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_DELAY_ESTIMATE_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_AGC_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_NS_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_RXVAD)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_RED)->EnableWindow(FALSE);
-        SetDlgItemText(IDC_EDIT_RXVAD, _T(""));
-        GetDlgItem(IDC_EDIT_RXVAD)->EnableWindow(FALSE);
-        CButton* button = (CButton*)GetDlgItem(IDC_CHECK_EXT_TRANS_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_PLAY_FILE_IN_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_PLAY_FILE_OUT_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_VAD_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_MUTE_IN_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_SRTP_TX_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_SRTP_RX_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_EXT_ENCRYPTION_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_CONFERENCE_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_ON_HOLD_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_DELAY_ESTIMATE_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_AGC_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_NS_1);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_RXVAD);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_RED);
-        button->SetCheck(BST_UNCHECKED);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonDelete2()
-{
-    BOOL ret;
-    int channel = GetDlgItemInt(IDC_EDIT_2, &ret);
-    if (ret == TRUE)
-    {
-        _delayEstimate2 = false;
-        _veRtpRtcpPtr->DeRegisterRTPObserver(channel);
-        TEST(_veBasePtr->DeleteChannel(channel) == 0, _T("DeleteChannel(%d)"), channel);
-        SetDlgItemText(IDC_EDIT_2, _T(""));
-        GetDlgItem(IDC_BUTTON_CREATE_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_DELETE_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_COMBO_IP_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_EDIT_TX_PORT_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_EDIT_RX_PORT_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_COMBO_CODEC_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_START_LISTEN_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_START_PLAYOUT_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_START_SEND_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_LISTEN_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_PLAYOUT_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_SEND_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_EXT_TRANS_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_PLAY_FILE_IN_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_PLAY_FILE_OUT_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_MUTE_IN_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_VAD_3)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_SRTP_TX_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_SRTP_RX_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_EXT_ENCRYPTION_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_CONFERENCE_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_DTMF_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_CHECK_ON_HOLD_2)->EnableWindow(FALSE);
-        CButton* button = (CButton*)GetDlgItem(IDC_CHECK_EXT_TRANS_2);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_PLAY_FILE_IN_2);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_PLAY_FILE_OUT_2);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_2);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_2);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_VAD_3);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_MUTE_IN_2);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_SRTP_TX_2);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_SRTP_RX_2);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_EXT_ENCRYPTION_2);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_CONFERENCE_2);
-        button->SetCheck(BST_UNCHECKED);
-        button = (CButton*)GetDlgItem(IDC_CHECK_ON_HOLD_2);
-        button->SetCheck(BST_UNCHECKED);
-    }
-}
-
-void CWinTestDlg::OnCbnSelchangeComboIp1()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CString str;
-    int port = GetDlgItemInt(IDC_EDIT_TX_PORT_1);
-    CComboBox* comboIP = (CComboBox*)GetDlgItem(IDC_COMBO_IP_1);
-    int n = comboIP->GetLBTextLen(0);
-    comboIP->GetLBText(0, str.GetBuffer(n));
-    TEST(_veBasePtr->SetSendDestination(channel, port, TcharToChar(str.GetBuffer(n), -1)) == 0,
-        _T("SetSendDestination(channel=%d, port=%d, ip=%s)"), channel, port, str.GetBuffer(n));
-    str.ReleaseBuffer();
-}
-
-void CWinTestDlg::OnCbnSelchangeComboIp2()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    CString str;
-    int port = GetDlgItemInt(IDC_EDIT_TX_PORT_2);
-    CComboBox* comboIP = (CComboBox*)GetDlgItem(IDC_COMBO_IP_2);
-    int n = comboIP->GetLBTextLen(0);
-    comboIP->GetLBText(0, str.GetBuffer(n));
-    TEST(_veBasePtr->SetSendDestination(channel, port, TcharToChar(str.GetBuffer(n), -1)) == 0,
-        _T("SetSendDestination(channel=%d, port=%d, ip=%s)"), channel, port, str.GetBuffer(n));
-    str.ReleaseBuffer();
-}
-
-void CWinTestDlg::OnCbnSelchangeComboCodec1()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-
-    CodecInst codec;
-    CComboBox* comboCodec(NULL);
-    comboCodec = (CComboBox*)GetDlgItem(IDC_COMBO_CODEC_1);
-    int index = comboCodec->GetCurSel();
-    _veCodecPtr->GetCodec(index, codec);
-    if (strncmp(codec.plname, "ISAC", 4) == 0)
-    {
-        // Set iSAC to adaptive mode by default.
-        codec.rate = -1;
-    }
-    TEST(_veCodecPtr->SetSendCodec(channel, codec) == 0,
-        _T("SetSendCodec(channel=%d, plname=%s, pltype=%d, plfreq=%d, rate=%d, pacsize=%d, channels=%d)"),
-        channel, CharToTchar(codec.plname, 32), codec.pltype, codec.plfreq, codec.rate, codec.pacsize, codec.channels);
-
-    CListBox* list = (CListBox*)GetDlgItem(IDC_LIST_CODEC_1);
-    list->SetCurSel(0);
-    SetDlgItemInt(IDC_EDIT_CODEC_1, codec.pltype);
-}
-
-void CWinTestDlg::OnLbnSelchangeListCodec1()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-
-    CListBox* list = (CListBox*)GetDlgItem(IDC_LIST_CODEC_1);
-    int listIdx = list->GetCurSel();
-    if (listIdx < 0)
-        return;
-    CString str;
-    list->GetText(listIdx, str);
-
-    CodecInst codec;
-    _veCodecPtr->GetSendCodec(channel, codec);
-
-    int value = GetDlgItemInt(IDC_EDIT_CODEC_1);
-    if (str == _T("pltype"))
-    {
-        codec.pltype = value;
-    }
-    else if (str == _T("plfreq"))
-    {
-        codec.plfreq = value;
-    }
-    else if (str == _T("pacsize"))
-    {
-        codec.pacsize = value;
-    }
-    else if (str == _T("channels"))
-    {
-        codec.channels = value;
-    }
-    else if (str == _T("rate"))
-    {
-        codec.rate = value;
-    }
-    TEST(_veCodecPtr->SetSendCodec(channel, codec) == 0,
-        _T("SetSendCodec(channel=%d, plname=%s, pltype=%d, plfreq=%d, rate=%d, pacsize=%d, channels=%d)"),
-        channel, CharToTchar(codec.plname, 32), codec.pltype, codec.plfreq, codec.rate, codec.pacsize, codec.channels);
-}
-
-void CWinTestDlg::OnCbnSelchangeComboCodec2()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-
-    CodecInst codec;
-    CComboBox* comboCodec(NULL);
-    comboCodec = (CComboBox*)GetDlgItem(IDC_COMBO_CODEC_2);
-    int index = comboCodec->GetCurSel();
-    _veCodecPtr->GetCodec(index, codec);
-    TEST(_veCodecPtr->SetSendCodec(channel, codec) == 0,
-        _T("SetSendCodec(channel=%d, plname=%s, pltype=%d, plfreq=%d, rate=%d, pacsize=%d, channels=%d)"),
-        channel, CharToTchar(codec.plname, 32), codec.pltype, codec.plfreq, codec.rate, codec.pacsize, codec.channels);
-}
-
-void CWinTestDlg::OnBnClickedButtonStartListen1()
-{
-    int ret1(0);
-    int ret2(0);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    int port = GetDlgItemInt(IDC_EDIT_RX_PORT_1);
-    TEST((ret1 = _veBasePtr->SetLocalReceiver(channel, port)) == 0, _T("SetLocalReceiver(channel=%d, port=%d)"), channel, port);
-    TEST((ret2 = _veBasePtr->StartReceive(channel)) == 0, _T("StartReceive(channel=%d)"), channel);
-    if (ret1 == 0 && ret2 == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_LISTEN_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_LISTEN_1)->EnableWindow(TRUE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStartListen2()
-{
-    int ret1(0);
-    int ret2(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    int port = GetDlgItemInt(IDC_EDIT_RX_PORT_2);
-    TEST((ret1 = _veBasePtr->SetLocalReceiver(channel, port)) == 0, _T("SetLocalReceiver(channel=%d, port=%d)"), channel, port);
-    TEST((ret2 = _veBasePtr->StartReceive(channel)) == 0, _T("StartReceive(channel=%d)"), channel);
-    if (ret1 == 0 && ret2 == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_LISTEN_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_LISTEN_2)->EnableWindow(TRUE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStopListen1()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    TEST((ret = _veBasePtr->StopReceive(channel)) == 0, _T("StopListen(channel=%d)"), channel);
-    if (ret == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_LISTEN_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_STOP_LISTEN_1)->EnableWindow(FALSE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStopListen2()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    TEST((ret = _veBasePtr->StopReceive(channel)) == 0, _T("StopListen(channel=%d)"), channel);
-    if (ret == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_LISTEN_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_STOP_LISTEN_2)->EnableWindow(FALSE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStartPlayout1()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    TEST((ret = _veBasePtr->StartPlayout(channel)) == 0, _T("StartPlayout(channel=%d)"), channel);
-    if (ret == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_PLAYOUT_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_PLAYOUT_1)->EnableWindow(TRUE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStartPlayout2()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    TEST((ret = _veBasePtr->StartPlayout(channel)) == 0, _T("StartPlayout(channel=%d)"), channel);
-    if (ret == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_PLAYOUT_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_PLAYOUT_2)->EnableWindow(TRUE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStopPlayout1()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    TEST((ret = _veBasePtr->StopPlayout(channel)) == 0, _T("StopPlayout(channel=%d)"), channel);
-    if (ret == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_PLAYOUT_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_STOP_PLAYOUT_1)->EnableWindow(FALSE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStopPlayout2()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    TEST((ret = _veBasePtr->StopPlayout(channel)) == 0, _T("StopPlayout(channel=%d)"));
-    if (ret == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_PLAYOUT_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_STOP_PLAYOUT_2)->EnableWindow(FALSE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStartSend1()
-{
-    UpdateData(TRUE);  // update IP address
-
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    if (!_externalTransport)
-    {
-        CString str;
-        int port = GetDlgItemInt(IDC_EDIT_TX_PORT_1);
-    TEST(_veBasePtr->SetSendDestination(channel, port, TcharToChar(_strComboIp1.GetBuffer(7), -1)) == 0,
-      _T("SetSendDestination(channel=%d, port=%d, ip=%s)"), channel, port, _strComboIp1.GetBuffer(7));
-        str.ReleaseBuffer();
-    }
-
-	//_veVideoSyncPtr->SetInitTimestamp(0,0);
-    // OnCbnSelchangeComboCodec1();
-
-    TEST((ret = _veBasePtr->StartSend(channel)) == 0, _T("StartSend(channel=%d)"), channel);
-    if (ret == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_SEND_1)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_SEND_1)->EnableWindow(TRUE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStartSend2()
-{
-    UpdateData(TRUE);  // update IP address
-
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    if (!_externalTransport)
-    {
-        CString str;
-        int port = GetDlgItemInt(IDC_EDIT_TX_PORT_2);
-        TEST(_veBasePtr->SetSendDestination(channel, port, TcharToChar(_strComboIp2.GetBuffer(7), -1)) == 0,
-            _T("SetSendDestination(channel=%d, port=%d, ip=%s)"), channel, port, _strComboIp2.GetBuffer(7));
-        str.ReleaseBuffer();
-    }
-
-    // OnCbnSelchangeComboCodec2();
-
-    TEST((ret = _veBasePtr->StartSend(channel)) == 0, _T("StartSend(channel=%d)"), channel);
-    if (ret == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_SEND_2)->EnableWindow(FALSE);
-        GetDlgItem(IDC_BUTTON_STOP_SEND_2)->EnableWindow(TRUE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStopSend1()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    TEST((ret = _veBasePtr->StopSend(channel)) == 0, _T("StopSend(channel=%d)"), channel);
-    if (ret == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_SEND_1)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_STOP_SEND_1)->EnableWindow(FALSE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedButtonStopSend2()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    TEST((ret = _veBasePtr->StopSend(channel)) == 0, _T("StopSend(channel=%d)"), channel);
-    if (ret == 0)
-    {
-        GetDlgItem(IDC_BUTTON_START_SEND_2)->EnableWindow(TRUE);
-        GetDlgItem(IDC_BUTTON_STOP_SEND_2)->EnableWindow(FALSE);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckExtTrans1()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_EXT_TRANS_1);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        TEST((ret = _veNetworkPtr->RegisterExternalTransport(channel, *_transportPtr)) == 0,
-            _T("RegisterExternalTransport(channel=%d, transport=0x%x)"), channel, _transportPtr);
-    }
-    else
-    {
-        TEST((ret = _veNetworkPtr->DeRegisterExternalTransport(channel)) == 0,
-            _T("DeRegisterExternalTransport(channel=%d)"), channel);
-    }
-    if (ret == 0)
-    {
-        _externalTransport = enable;
-    }
-    else
-    {
-        // restore inital state since API call failed
-        button->SetCheck((check == BST_CHECKED) ? BST_UNCHECKED : BST_CHECKED);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckExtTrans2()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_EXT_TRANS_2);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        TEST((ret = _veNetworkPtr->RegisterExternalTransport(channel, *_transportPtr)) == 0,
-            _T("RegisterExternalTransport(channel=%d, transport=0x%x)"), channel, _transportPtr);
-    }
-    else
-    {
-        TEST((ret = _veNetworkPtr->DeRegisterExternalTransport(channel)) == 0,
-            _T("DeRegisterExternalTransport(channel=%d)"), channel);
-    }
-    if (ret == 0)
-    {
-        _externalTransport = enable;
-    }
-    else
-    {
-        // restore inital state since API call failed
-        button->SetCheck((check == BST_CHECKED) ? BST_UNCHECKED : BST_CHECKED);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckPlayFileIn1()
-{
-    std::string micFile = _long_audio_file_path + "audio_short16.pcm";
-
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_PLAY_FILE_IN_1);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        bool mix;
-        const bool loop(true);
-        const FileFormats format = kFileFormatPcm16kHzFile;
-        const float scale(1.0);
-
-        (_checkPlayFileIn1 %2 == 0) ? mix = true : mix = false;
-        TEST((ret = _veFilePtr->StartPlayingFileAsMicrophone(channel,
-            micFile.c_str(), loop, mix, format, scale) == 0),
-            _T("StartPlayingFileAsMicrophone(channel=%d, file=%s, loop=%d, ")
-            _T("mix=%d, format=%d, scale=%2.1f)"),
-            channel, CharToTchar(micFile.c_str(), -1),
-            loop, mix, format, scale);
-        _checkPlayFileIn1++;
-    }
-    else
-    {
-        TEST((ret = _veFilePtr->StopPlayingFileAsMicrophone(channel) == 0),
-            _T("StopPlayingFileAsMicrophone(channel=%d)"), channel);
-    }
-    if (ret == -1)
-    {
-        // restore inital state since API call failed
-        button->SetCheck((check == BST_CHECKED) ? BST_UNCHECKED : BST_CHECKED);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckPlayFileIn2()
-{
-    std::string micFile = _long_audio_file_path + "audio_long16.pcm";
-
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_PLAY_FILE_IN_2);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        bool mix;
-        const bool loop(true);
-        const FileFormats format = kFileFormatPcm16kHzFile;
-        const float scale(1.0);
-
-        (_checkPlayFileIn2 %2 == 0) ? mix = true : mix = false;
-        TEST((ret = _veFilePtr->StartPlayingFileAsMicrophone(channel,
-            micFile.c_str(), loop, mix, format, scale) == 0),
-            _T("StartPlayingFileAsMicrophone(channel=%d, file=%s, loop=%d, ")
-            _T("mix=%d, format=%d, scale=%2.1f)"),
-            channel, CharToTchar(micFile.c_str(), -1),
-            loop, mix, format, scale);
-        _checkPlayFileIn2++;
-    }
-    else
-    {
-        TEST((ret = _veFilePtr->StopPlayingFileAsMicrophone(channel) == 0),
-            _T("StopPlayingFileAsMicrophone(channel=%d)"), channel);
-    }
-    if (ret == -1)
-    {
-        // restore inital state since API call failed
-        button->SetCheck((check == BST_CHECKED) ? BST_UNCHECKED : BST_CHECKED);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckPlayFileOut1()
-{
-    const FileFormats formats[8]  = {{kFileFormatPcm16kHzFile},
-                                          {kFileFormatWavFile},
-                                          {kFileFormatWavFile},
-                                          {kFileFormatWavFile},
-                                          {kFileFormatWavFile},
-                                          {kFileFormatWavFile},
-                                          {kFileFormatWavFile},
-                                          {kFileFormatWavFile}};
-    // File path is relative to the location of 'voice_engine.gyp'.
-    const char spkrFiles[8][64] = {{"audio_short16.pcm"},
-                                   {"audio_tiny8.wav"},
-                                   {"audio_tiny11.wav"},
-                                   {"audio_tiny16.wav"},
-                                   {"audio_tiny22.wav"},
-                                   {"audio_tiny32.wav"},
-                                   {"audio_tiny44.wav"},
-                                   {"audio_tiny48.wav"}};
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_PLAY_FILE_OUT_1);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        const bool loop(true);
-        const float volumeScaling(1.0);
-        const int startPointMs(0);
-        const int stopPointMs(0);
-        const FileFormats format = formats[_checkPlayFileOut1 % 8];
-        std::string spkrFile = _long_audio_file_path +
-                               spkrFiles[_checkPlayFileOut1 % 8];
-
-        CString str;
-        if (_checkPlayFileOut1 % 8 == 0)
-        {
-            str = _T("kFileFormatPcm16kHzFile");
-        }
-        else
-        {
-            str = _T("kFileFormatWavFile");
-        }
-        // (_checkPlayFileOut1 %2 == 0) ? mix = true : mix = false;
-        TEST((ret = _veFilePtr->StartPlayingFileLocally(channel,
-            spkrFile.c_str(), loop, format, volumeScaling,
-            startPointMs,stopPointMs) == 0),
-            _T("StartPlayingFileLocally(channel=%d, file=%s, loop=%d, ")
-            _T("format=%s, scale=%2.1f, start=%d, stop=%d)"),
-            channel, CharToTchar(spkrFile.c_str(), -1),
-            loop, str, volumeScaling, startPointMs, stopPointMs);
-        _checkPlayFileOut1++;
-    }
-    else
-    {
-        TEST((ret = _veFilePtr->StopPlayingFileLocally(channel) == 0),
-            _T("StopPlayingFileLocally(channel=%d)"), channel);
-    }
-    if (ret == -1)
-    {
-        // restore inital state since API call failed
-        button->SetCheck((check == BST_CHECKED) ? BST_UNCHECKED : BST_CHECKED);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckPlayFileOut2()
-{
-    std::string spkrFile = _long_audio_file_path + "audio_long16.pcm";
-
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_PLAY_FILE_OUT_2);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        const bool loop(true);
-        const FileFormats format = kFileFormatPcm16kHzFile;
-        const float volumeScaling(1.0);
-        const int startPointMs(0);
-        const int stopPointMs(0);
-
-        // (_checkPlayFileOut2 %2 == 0) ? mix = true : mix = false;
-        TEST((ret = _veFilePtr->StartPlayingFileLocally(channel,
-            spkrFile.c_str(), loop, format, volumeScaling,
-            startPointMs,stopPointMs) == 0),
-            _T("StartPlayingFileLocally(channel=%d, file=%s, loop=%d, ")
-            _T("format=%d, scale=%2.1f, start=%d, stop=%d)"),
-            channel, CharToTchar(spkrFile.c_str(), -1),
-            loop, format, volumeScaling, startPointMs, stopPointMs);
-        // _checkPlayFileIn2++;
-    }
-    else
-    {
-        TEST((ret = _veFilePtr->StopPlayingFileLocally(channel) == 0),
-            _T("StopPlayingFileLocally(channel=%d)"), channel);
-    }
-    if (ret == -1)
-    {
-        // restore inital state since API call failed
-        button->SetCheck((check == BST_CHECKED) ? BST_UNCHECKED : BST_CHECKED);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckExtMediaIn1()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* buttonExtTrans = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_1);
-    int check = buttonExtTrans->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        TEST(_veExternalMediaPtr->RegisterExternalMediaProcessing(channel, kRecordingPerChannel, *_externalMediaPtr) == 0,
-            _T("RegisterExternalMediaProcessing(channel=%d, kRecordingPerChannel, processObject=0x%x)"), channel, _externalMediaPtr);
-    }
-    else
-    {
-        TEST(_veExternalMediaPtr->DeRegisterExternalMediaProcessing(channel, kRecordingPerChannel) == 0,
-            _T("DeRegisterExternalMediaProcessing(channel=%d, kRecordingPerChannel)"), channel);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckExtMediaIn2()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    CButton* buttonExtTrans = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_2);
-    int check = buttonExtTrans->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        TEST(_veExternalMediaPtr->RegisterExternalMediaProcessing(channel, kRecordingPerChannel, *_externalMediaPtr) == 0,
-            _T("RegisterExternalMediaProcessing(channel=%d, kRecordingPerChannel, processObject=0x%x)"), channel, _externalMediaPtr);
-    }
-    else
-    {
-        TEST(_veExternalMediaPtr->DeRegisterExternalMediaProcessing(channel, kRecordingPerChannel) == 0,
-            _T("DeRegisterExternalMediaProcessing(channel=%d, kRecordingPerChannel)"), channel);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckExtMediaOut1()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* buttonExtTrans = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_1);
-    int check = buttonExtTrans->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        TEST(_veExternalMediaPtr->RegisterExternalMediaProcessing(channel, kPlaybackPerChannel, *_externalMediaPtr) == 0,
-            _T("RegisterExternalMediaProcessing(channel=%d, kPlaybackPerChannel, processObject=0x%x)"), channel, _externalMediaPtr);
-    }
-    else
-    {
-        TEST(_veExternalMediaPtr->DeRegisterExternalMediaProcessing(channel, kPlaybackPerChannel) == 0,
-            _T("DeRegisterExternalMediaProcessing(channel=%d, kPlaybackPerChannel)"), channel);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckExtMediaOut2()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    CButton* buttonExtTrans = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_2);
-    int check = buttonExtTrans->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        TEST(_veExternalMediaPtr->RegisterExternalMediaProcessing(channel, kPlaybackPerChannel, *_externalMediaPtr) == 0,
-            _T("RegisterExternalMediaProcessing(channel=%d, kPlaybackPerChannel, processObject=0x%x)"), channel, _externalMediaPtr);
-    }
-    else
-    {
-        TEST(_veExternalMediaPtr->DeRegisterExternalMediaProcessing(channel, kPlaybackPerChannel) == 0,
-            _T("DeRegisterExternalMediaProcessing(channel=%d, kPlaybackPerChannel)"), channel);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckVad1()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_VAD_1);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        CString str;
-        VadModes mode(kVadConventional);
-        if (_checkVAD1 % 4 == 0)
-        {
-            mode = kVadConventional;
-            str = _T("kVadConventional");
-        }
-        else if (_checkVAD1 % 4 == 1)
-        {
-            mode = kVadAggressiveLow;
-            str = _T("kVadAggressiveLow");
-        }
-        else if (_checkVAD1 % 4 == 2)
-        {
-            mode = kVadAggressiveMid;
-            str = _T("kVadAggressiveMid");
-        }
-        else if (_checkVAD1 % 4 == 3)
-        {
-            mode = kVadAggressiveHigh;
-            str = _T("kVadAggressiveHigh");
-        }
-        const bool disableDTX(false);
-        TEST((ret = _veCodecPtr->SetVADStatus(channel, true, mode, disableDTX) == 0),
-            _T("SetVADStatus(channel=%d, enable=%d, mode=%s, disableDTX=%d)"), channel, enable, str, disableDTX);
-        _checkVAD1++;
-    }
-    else
-    {
-        TEST((ret = _veCodecPtr->SetVADStatus(channel, false)) == 0, _T("SetVADStatus(channel=%d, enable=%d)"), channel, false);
-    }
-    if (ret == -1)
-    {
-        // restore inital state since API call failed
-        button->SetCheck((check == BST_CHECKED) ? BST_UNCHECKED : BST_CHECKED);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckVad2()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_VAD_2);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        CString str;
-        VadModes mode(kVadConventional);
-        if (_checkVAD2 % 4 == 0)
-        {
-            mode = kVadConventional;
-            str = _T("kVadConventional");
-        }
-        else if (_checkVAD2 % 4 == 1)
-        {
-            mode = kVadAggressiveLow;
-            str = _T("kVadAggressiveLow");
-        }
-        else if (_checkVAD2 % 4 == 2)
-        {
-            mode = kVadAggressiveMid;
-            str = _T("kVadAggressiveMid");
-        }
-        else if (_checkVAD2 % 4 == 3)
-        {
-            mode = kVadAggressiveHigh;
-            str = _T("kVadAggressiveHigh");
-        }
-        const bool disableDTX(false);
-        TEST((ret = _veCodecPtr->SetVADStatus(channel, true, mode, disableDTX)) == 0,
-            _T("SetVADStatus(channel=%d, enable=%d, mode=%s, disableDTX=%d)"), channel, enable, str, disableDTX);
-        _checkVAD2++;
-    }
-    else
-    {
-        TEST((ret = _veCodecPtr->SetVADStatus(channel, false) == 0), _T("SetVADStatus(channel=%d, enable=%d)"), channel, false);
-    }
-    if (ret == -1)
-    {
-        // restore inital state since API call failed
-        button->SetCheck((check == BST_CHECKED) ? BST_UNCHECKED : BST_CHECKED);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckMuteIn1()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* buttonMute = (CButton*)GetDlgItem(IDC_CHECK_MUTE_IN_1);
-    int check = buttonMute->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    TEST(_veVolumeControlPtr->SetInputMute(channel, enable) == 0,
-        _T("SetInputMute(channel=%d, enable=%d)"), channel, enable);
-}
-
-void CWinTestDlg::OnBnClickedCheckMuteIn2()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    CButton* buttonMute = (CButton*)GetDlgItem(IDC_CHECK_MUTE_IN_2);
-    int check = buttonMute->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    TEST(_veVolumeControlPtr->SetInputMute(channel, enable) == 0,
-        _T("SetInputMute(channel=%d, enable=%d)"), channel, enable);
-}
-
-void CWinTestDlg::OnBnClickedCheckSrtpTx1()
-{
-    TEST(true, "Built-in SRTP support is deprecated.");
-}
-
-void CWinTestDlg::OnBnClickedCheckSrtpTx2()
-{
-    TEST(true, "Built-in SRTP support is deprecated.");
-}
-
-void CWinTestDlg::OnBnClickedCheckSrtpRx1()
-{
-    TEST(true, "Built-in SRTP support is deprecated.");
-}
-
-void CWinTestDlg::OnBnClickedCheckSrtpRx2()
-{
-    TEST(true, "Built-in SRTP support is deprecated.");
-}
-
-void CWinTestDlg::OnBnClickedCheckExtEncryption1()
-{
-    TEST(true, "External Encryption has been removed from the API!");
-}
-
-void CWinTestDlg::OnBnClickedCheckExtEncryption2()
-{
-    TEST(true, "External Encryption has been removed from the API!");
-}
-
-void CWinTestDlg::OnBnClickedButtonDtmf1()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CTelephonyEvent dlgTelephoneEvent(_vePtr, channel, this);
-    dlgTelephoneEvent.DoModal();
-}
-
-void CWinTestDlg::OnBnClickedButtonDtmf2()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    CTelephonyEvent dlgTelephoneEvent(_vePtr, channel, this);
-    dlgTelephoneEvent.DoModal();
-}
-
-void CWinTestDlg::OnBnClickedCheckConference1()
-{
-    // Not supported yet
-}
-
-void CWinTestDlg::OnBnClickedCheckConference2()
-{
-   // Not supported yet
-}
-
-void CWinTestDlg::OnBnClickedCheckOnHold1()
-{
-    SHORT shiftKeyIsPressed = ::GetAsyncKeyState(VK_SHIFT);
-
-    CString str;
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_ON_HOLD_1);
-    int check = button->GetCheck();
-
-    if (shiftKeyIsPressed)
-    {
-        bool enabled(false);
-        OnHoldModes mode(kHoldSendAndPlay);
-        TEST(_veBasePtr->GetOnHoldStatus(channel, enabled, mode) == 0,
-            _T("GetOnHoldStatus(channel=%d, enabled=?, mode=?)"), channel);
-        button->SetCheck((check == BST_CHECKED) ? BST_UNCHECKED : BST_CHECKED);
-
-        switch (mode)
-        {
-        case kHoldSendAndPlay:
-            str = _T("kHoldSendAndPlay");
-            break;
-        case kHoldSendOnly:
-            str = _T("kHoldSendOnly");
-            break;
-        case kHoldPlayOnly:
-            str = _T("kHoldPlayOnly");
-            break;
-        default:
-            break;
-        }
-        PRINT_GET_RESULT(_T("enabled=%d, mode=%s"), enabled, str);
-        return;
-    }
-
-    int ret(0);
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        OnHoldModes mode(kHoldSendAndPlay);
-        if (_checkOnHold1 % 3 == 0)
-        {
-            mode = kHoldSendAndPlay;
-            str = _T("kHoldSendAndPlay");
-        }
-        else if (_checkOnHold1 % 3 == 1)
-        {
-            mode = kHoldSendOnly;
-            str = _T("kHoldSendOnly");
-        }
-        else if (_checkOnHold1 % 3 == 2)
-        {
-            mode = kHoldPlayOnly;
-            str = _T("kHoldPlayOnly");
-        }
-        TEST((ret = _veBasePtr->SetOnHoldStatus(channel, enable, mode)) == 0,
-            _T("SetOnHoldStatus(channel=%d, enable=%d, mode=%s)"), channel, enable, str);
-        _checkOnHold1++;
-    }
-    else
-    {
-        TEST((ret = _veBasePtr->SetOnHoldStatus(channel, enable)) == 0,
-            _T("SetOnHoldStatus(channel=%d, enable=%d)"), channel, enable);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckOnHold2()
-{
-    int ret(0);
-    int channel = GetDlgItemInt(IDC_EDIT_2);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_ON_HOLD_2);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        CString str;
-        OnHoldModes mode(kHoldSendAndPlay);
-        if (_checkOnHold1 % 3 == 0)
-        {
-            mode = kHoldSendAndPlay;
-            str = _T("kHoldSendAndPlay");
-        }
-        else if (_checkOnHold1 % 3 == 1)
-        {
-            mode = kHoldSendOnly;
-            str = _T("kHoldSendOnly");
-        }
-        else if (_checkOnHold1 % 3 == 2)
-        {
-            mode = kHoldPlayOnly;
-            str = _T("kHoldPlayOnly");
-        }
-        TEST((ret = _veBasePtr->SetOnHoldStatus(channel, enable, mode)) == 0,
-            _T("SetOnHoldStatus(channel=%d, enable=%d, mode=%s)"), channel, enable, str);
-        _checkOnHold1++;
-    }
-    else
-    {
-        TEST((ret = _veBasePtr->SetOnHoldStatus(channel, enable)) == 0,
-            _T("SetOnHoldStatus(channel=%d, enable=%d)"), channel, enable);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckDelayEstimate1()
-{
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_DELAY_ESTIMATE_1);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-
-    if (enable)
-    {
-        _delayEstimate1 = true;
-        SetDlgItemInt(IDC_EDIT_DELAY_ESTIMATE_1, 0);
-    }
-    else
-    {
-        _delayEstimate1 = false;
-        SetDlgItemText(IDC_EDIT_DELAY_ESTIMATE_1, _T(""));
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckRxvad()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_RXVAD);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-
-    if (enable)
-    {
-        _rxVad = true;
-        _veApmPtr->RegisterRxVadObserver(channel, *_rxVadObserverPtr);
-        SetDlgItemInt(IDC_EDIT_RXVAD, 0);
-    }
-    else
-    {
-        _rxVad = false;
-        _veApmPtr->DeRegisterRxVadObserver(channel);
-        SetDlgItemText(IDC_EDIT_RXVAD, _T(""));
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckAgc1()
-{
-    SHORT shiftKeyIsPressed = ::GetAsyncKeyState(VK_SHIFT);
-
-    CString str;
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_AGC_1);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-
-    if (shiftKeyIsPressed)
-    {
-        bool enabled(false);
-        AgcModes mode(kAgcAdaptiveDigital);
-        TEST(_veApmPtr->GetRxAgcStatus(channel, enabled, mode) == 0,
-            _T("GetRxAgcStatus(channel=%d, enabled=?, mode=?)"), channel);
-        button->SetCheck((check == BST_CHECKED) ? BST_UNCHECKED : BST_CHECKED);
-
-        switch (mode)
-        {
-        case kAgcAdaptiveAnalog:
-            str = _T("kAgcAdaptiveAnalog");
-            break;
-        case kAgcAdaptiveDigital:
-            str = _T("kAgcAdaptiveDigital");
-            break;
-        case kAgcFixedDigital:
-            str = _T("kAgcFixedDigital");
-            break;
-        default:
-            break;
-        }
-        PRINT_GET_RESULT(_T("enabled=%d, mode=%s"), enabled, str);
-        return;
-    }
-
-    if (enable)
-    {
-        CString str;
-        AgcModes mode(kAgcDefault);
-        if (_checkAGC1 % 3 == 0)
-        {
-            mode = kAgcDefault;
-            str = _T("kAgcDefault");
-        }
-        else if (_checkAGC1 % 3 == 1)
-        {
-            mode = kAgcAdaptiveDigital;
-            str = _T("kAgcAdaptiveDigital");
-        }
-        else if (_checkAGC1 % 3 == 2)
-        {
-            mode = kAgcFixedDigital;
-            str = _T("kAgcFixedDigital");
-        }
-        TEST(_veApmPtr->SetRxAgcStatus(channel, true, mode) == 0, _T("SetRxAgcStatus(channel=%d, enable=%d, %s)"), channel, enable, str);
-        _checkAGC1++;
-    }
-    else
-    {
-        TEST(_veApmPtr->SetRxAgcStatus(channel, false, kAgcUnchanged) == 0, _T("SetRxAgcStatus(channel=%d, enable=%d)"), channel, enable);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckNs1()
-{
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    CButton* buttonNS = (CButton*)GetDlgItem(IDC_CHECK_NS_1);
-    int check = buttonNS->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        CString str;
-        NsModes mode(kNsDefault);
-        if (_checkNS1 % 6 == 0)
-        {
-            mode = kNsDefault;
-            str = _T("kNsDefault");
-        }
-        else if (_checkNS1 % 6 == 1)
-        {
-            mode = kNsConference;
-            str = _T("kNsConference");
-        }
-        else if (_checkNS1 % 6 == 2)
-        {
-            mode = kNsLowSuppression;
-            str = _T("kNsLowSuppression");
-        }
-        else if (_checkNS1 % 6 == 3)
-        {
-            mode = kNsModerateSuppression;
-            str = _T("kNsModerateSuppression");
-        }
-        else if (_checkNS1 % 6 == 4)
-        {
-            mode = kNsHighSuppression;
-            str = _T("kNsHighSuppression");
-        }
-        else if (_checkNS1 % 6 == 5)
-        {
-            mode = kNsVeryHighSuppression;
-            str = _T("kNsVeryHighSuppression");
-        }
-        TEST(_veApmPtr->SetRxNsStatus(channel, true, mode) == 0, _T("SetRxNsStatus(channel=%d, enable=%d, %s)"), channel, enable, str);
-        _checkNS1++;
-    }
-    else
-    {
-        TEST(_veApmPtr->SetRxNsStatus(channel, false, kNsUnchanged) == 0, _T("SetRxNsStatus(channel=%d, enable=%d)"), enable, channel);
-    }
-}
-
-// ----------------------------------------------------------------------------
-//                         Channel-independent Operations
-// ----------------------------------------------------------------------------
-
-void CWinTestDlg::OnBnClickedCheckPlayFileIn()
-{
-    std::string micFile = _long_audio_file_path + "audio_short16.pcm";
-    // std::string micFile = _long_audio_file_path + "audio_long16noise.pcm";
-
-    int channel(-1);
-    CButton* buttonExtTrans = (CButton*)GetDlgItem(IDC_CHECK_PLAY_FILE_IN);
-    int check = buttonExtTrans->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        bool mix;
-        const bool loop(true);
-        const FileFormats format = kFileFormatPcm16kHzFile;
-        const float scale(1.0);
-
-        (_checkPlayFileIn %2 == 0) ? mix = true : mix = false;
-        TEST(_veFilePtr->StartPlayingFileAsMicrophone(channel,
-            micFile.c_str(), loop, mix, format, scale) == 0,
-            _T("StartPlayingFileAsMicrophone(channel=%d, file=%s, ")
-            _T("loop=%d, mix=%d, format=%d, scale=%2.1f)"),
-            channel, CharToTchar(micFile.c_str(), -1),
-            loop, mix, format, scale);
-        _checkPlayFileIn++;
-    }
-    else
-    {
-        TEST(_veFilePtr->StopPlayingFileAsMicrophone(channel) == 0,
-            _T("StopPlayingFileAsMicrophone(channel=%d)"), channel);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckRecMic()
-{
-    std::string micFile = webrtc::test::OutputPath() +
-                          "rec_mic_mono_16kHz.pcm";
-
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_REC_MIC);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        TEST(_veFilePtr->StartRecordingMicrophone(micFile.c_str(), NULL) == 0,
-            _T("StartRecordingMicrophone(file=%s)"),
-            CharToTchar(micFile.c_str(), -1));
-    }
-    else
-    {
-        TEST(_veFilePtr->StopRecordingMicrophone() == 0,
-            _T("StopRecordingMicrophone()"));
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckAgc()
-{
-    CButton* buttonAGC = (CButton*)GetDlgItem(IDC_CHECK_AGC);
-    int check = buttonAGC->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        CString str;
-        AgcModes mode(kAgcDefault);
-        if (_checkAGC % 4 == 0)
-        {
-            mode = kAgcDefault;
-            str = _T("kAgcDefault");
-        }
-        else if (_checkAGC % 4 == 1)
-        {
-            mode = kAgcAdaptiveAnalog;
-            str = _T("kAgcAdaptiveAnalog");
-        }
-        else if (_checkAGC % 4 == 2)
-        {
-            mode = kAgcAdaptiveDigital;
-            str = _T("kAgcAdaptiveDigital");
-        }
-        else if (_checkAGC % 4 == 3)
-        {
-            mode = kAgcFixedDigital;
-            str = _T("kAgcFixedDigital");
-        }
-        TEST(_veApmPtr->SetAgcStatus(true, mode) == 0, _T("SetAgcStatus(enable=%d, %s)"), enable, str);
-        _checkAGC++;
-    }
-    else
-    {
-        TEST(_veApmPtr->SetAgcStatus(false, kAgcUnchanged) == 0, _T("SetAgcStatus(enable=%d)"), enable);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckNs()
-{
-    CButton* buttonNS = (CButton*)GetDlgItem(IDC_CHECK_NS);
-    int check = buttonNS->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        CString str;
-        NsModes mode(kNsDefault);
-        if (_checkNS % 6 == 0)
-        {
-            mode = kNsDefault;
-            str = _T("kNsDefault");
-        }
-        else if (_checkNS % 6 == 1)
-        {
-            mode = kNsConference;
-            str = _T("kNsConference");
-        }
-        else if (_checkNS % 6 == 2)
-        {
-            mode = kNsLowSuppression;
-            str = _T("kNsLowSuppression");
-        }
-        else if (_checkNS % 6 == 3)
-        {
-            mode = kNsModerateSuppression;
-            str = _T("kNsModerateSuppression");
-        }
-        else if (_checkNS % 6 == 4)
-        {
-            mode = kNsHighSuppression;
-            str = _T("kNsHighSuppression");
-        }
-        else if (_checkNS % 6 == 5)
-        {
-            mode = kNsVeryHighSuppression;
-            str = _T("kNsVeryHighSuppression");
-        }
-        TEST(_veApmPtr->SetNsStatus(true, mode) == 0, _T("SetNsStatus(enable=%d, %s)"), enable, str);
-        _checkNS++;
-    }
-    else
-    {
-        TEST(_veApmPtr->SetNsStatus(false, kNsUnchanged) == 0, _T("SetNsStatus(enable=%d)"), enable);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckEc()
-{
-    CButton* buttonEC = (CButton*)GetDlgItem(IDC_CHECK_EC);
-    int check = buttonEC->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        CString str;
-        EcModes mode(kEcDefault);
-        if (_checkEC % 4 == 0)
-        {
-            mode = kEcDefault;
-            str = _T("kEcDefault");
-        }
-        else if (_checkEC % 4 == 1)
-        {
-            mode = kEcConference;
-            str = _T("kEcConference");
-        }
-        else if (_checkEC % 4 == 2)
-        {
-            mode = kEcAec;
-            str = _T("kEcAec");
-        }
-        else if (_checkEC % 4 == 3)
-        {
-            mode = kEcAecm;
-            str = _T("kEcAecm");
-        }
-        TEST(_veApmPtr->SetEcStatus(true, mode) == 0, _T("SetEcStatus(enable=%d, %s)"), enable, str);
-        _checkEC++;
-    }
-    else
-    {
-        TEST(_veApmPtr->SetEcStatus(false, kEcUnchanged) == 0, _T("SetEcStatus(enable=%d)"), enable);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckMuteIn()
-{
-    CButton* buttonMute = (CButton*)GetDlgItem(IDC_CHECK_MUTE_IN);
-    int check = buttonMute->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    const int channel(-1);
-    TEST(_veVolumeControlPtr->SetInputMute(channel, enable) == 0,
-        _T("SetInputMute(channel=%d, enable=%d)"), channel, enable);
-}
-
-void CWinTestDlg::OnBnClickedCheckExtMediaIn()
-{
-    const int channel(-1);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_IN);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        TEST(_veExternalMediaPtr->RegisterExternalMediaProcessing(channel, kRecordingAllChannelsMixed, *_externalMediaPtr) == 0,
-            _T("RegisterExternalMediaProcessing(channel=%d, kRecordingAllChannelsMixed, processObject=0x%x)"), channel, _externalMediaPtr);
-    }
-    else
-    {
-        TEST(_veExternalMediaPtr->DeRegisterExternalMediaProcessing(channel, kRecordingAllChannelsMixed) == 0,
-            _T("DeRegisterExternalMediaProcessing(channel=%d, kRecordingAllChannelsMixed)"), channel);
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckExtMediaOut()
-{
-    const int channel(-1);
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    if (enable)
-    {
-        TEST(_veExternalMediaPtr->RegisterExternalMediaProcessing(channel, kPlaybackAllChannelsMixed, *_externalMediaPtr) == 0,
-            _T("RegisterExternalMediaProcessing(channel=%d, kPlaybackAllChannelsMixed, processObject=0x%x)"), channel, _externalMediaPtr);
-    }
-    else
-    {
-        TEST(_veExternalMediaPtr->DeRegisterExternalMediaProcessing(channel, kPlaybackAllChannelsMixed) == 0,
-            _T("DeRegisterExternalMediaProcessing(channel=%d, kPlaybackAllChannelsMixed)"), channel);
-    }
-}
-
-void CWinTestDlg::OnCbnSelchangeComboRecDevice()
-{
-    CComboBox* comboCodec(NULL);
-    comboCodec = (CComboBox*)GetDlgItem(IDC_COMBO_REC_DEVICE);
-    int index = comboCodec->GetCurSel();
-    TEST(_veHardwarePtr->SetRecordingDevice(index) == 0,
-        _T("SetRecordingDevice(index=%d)"), index);
-}
-
-void CWinTestDlg::OnCbnSelchangeComboPlayDevice()
-{
-    CComboBox* comboCodec(NULL);
-    comboCodec = (CComboBox*)GetDlgItem(IDC_COMBO_PLAY_DEVICE);
-    int index = comboCodec->GetCurSel();
-    TEST(_veHardwarePtr->SetPlayoutDevice(index) == 0,
-        _T("SetPlayoutDevice(index=%d)"), index);
-}
-
-void CWinTestDlg::OnNMReleasedcaptureSliderInputVolume(NMHDR *pNMHDR, LRESULT *pResult)
-{
-    CSliderCtrl* slider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER_INPUT_VOLUME);
-    slider->SetRangeMin(0);
-    slider->SetRangeMax(255);
-    int pos = slider->GetPos();
-
-    TEST(_veVolumeControlPtr->SetMicVolume(pos) == 0, _T("SetMicVolume(volume=%d)"), pos);
-
-    *pResult = 0;
-}
-
-void CWinTestDlg::OnNMReleasedcaptureSliderOutputVolume(NMHDR *pNMHDR, LRESULT *pResult)
-{
-    CSliderCtrl* slider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER_OUTPUT_VOLUME);
-    slider->SetRangeMin(0);
-    slider->SetRangeMax(255);
-    int pos = slider->GetPos();
-
-    TEST(_veVolumeControlPtr->SetSpeakerVolume(pos) == 0, _T("SetSpeakerVolume(volume=%d)"), pos);
-
-    *pResult = 0;
-}
-
-void CWinTestDlg::OnNMReleasedcaptureSliderPanLeft(NMHDR *pNMHDR, LRESULT *pResult)
-{
-    CSliderCtrl* slider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER_PAN_LEFT);
-    slider->SetRange(0,10);
-    int pos = 10 - slider->GetPos();    // 0 <=> lower end, 10 <=> upper end
-
-    float left(0.0);
-    float right(0.0);
-    const int channel(-1);
-
-    // Only left channel will be modified
-    _veVolumeControlPtr->GetOutputVolumePan(channel, left, right);
-
-    left = (float)((float)pos/10.0f);
-
-    TEST(_veVolumeControlPtr->SetOutputVolumePan(channel, left, right) == 0,
-        _T("SetOutputVolumePan(channel=%d, left=%2.1f, right=%2.1f)"), channel, left, right);
-
-    *pResult = 0;
-}
-
-void CWinTestDlg::OnNMReleasedcaptureSliderPanRight(NMHDR *pNMHDR, LRESULT *pResult)
-{
-    CSliderCtrl* slider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER_PAN_RIGHT);
-    slider->SetRange(0,10);
-    int pos = 10 - slider->GetPos();    // 0 <=> lower end, 10 <=> upper end
-
-    float left(0.0);
-    float right(0.0);
-    const int channel(-1);
-
-    // Only right channel will be modified
-    _veVolumeControlPtr->GetOutputVolumePan(channel, left, right);
-
-    right = (float)((float)pos/10.0f);
-
-    TEST(_veVolumeControlPtr->SetOutputVolumePan(channel, left, right) == 0,
-        _T("SetOutputVolumePan(channel=%d, left=%2.1f, right=%2.1f)"), channel, left, right);
-
-    *pResult = 0;
-}
-
-void CWinTestDlg::OnBnClickedButtonVersion()
-{
-    if (_veBasePtr)
-    {
-        char version[1024];
-        if (_veBasePtr->GetVersion(version) == 0)
-        {
-            AfxMessageBox(CString(version), MB_OK);
-        }
-        else
-        {
-            AfxMessageBox(_T("FAILED!"), MB_OK);
-        }
-    }
-}
-
-void CWinTestDlg::OnBnClickedCheckRecCall()
-{
-    // Not supported
-}
-
-void CWinTestDlg::OnBnClickedCheckTypingDetection()
-{
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_TYPING_DETECTION);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    TEST(_veApmPtr->SetTypingDetectionStatus(enable) == 0, _T("SetTypingDetectionStatus(enable=%d)"), enable);
-}
-
-void CWinTestDlg::OnBnClickedCheckRED()
-{
-    CButton* button = (CButton*)GetDlgItem(IDC_CHECK_RED);
-    int channel = GetDlgItemInt(IDC_EDIT_1);
-    int check = button->GetCheck();
-    const bool enable = (check == BST_CHECKED);
-    TEST(_veRtpRtcpPtr->SetREDStatus(channel, enable) == 0,
-         _T("SetREDStatus(enable=%d)"), enable);
-}
-
-// ----------------------------------------------------------------------------
-//                                   Message Handlers
-// ----------------------------------------------------------------------------
-
-void CWinTestDlg::OnTimer(UINT_PTR nIDEvent)
-{
-    CString str;
-
-    unsigned int svol(0);
-    unsigned int mvol(0);
-
-    _timerTicks++;
-
-    // Get speaker and microphone volumes
-    _veVolumeControlPtr->GetSpeakerVolume(svol);
-    _veVolumeControlPtr->GetMicVolume(mvol);
-
-    // Update speaker volume slider
-    CSliderCtrl* sliderSpkr = (CSliderCtrl*)GetDlgItem(IDC_SLIDER_OUTPUT_VOLUME);
-    sliderSpkr->SetRangeMin(0);
-    sliderSpkr->SetRangeMax(255);
-    sliderSpkr->SetPos(svol);
-
-    // Update microphone volume slider
-    CSliderCtrl* sliderMic = (CSliderCtrl*)GetDlgItem(IDC_SLIDER_INPUT_VOLUME);
-    sliderMic->SetRangeMin(0);
-    sliderMic->SetRangeMax(255);
-    sliderMic->SetPos(mvol);
-
-    unsigned int micLevel;
-    unsigned int combinedOutputLevel;
-
-    // Get audio levels
-    _veVolumeControlPtr->GetSpeechInputLevel(micLevel);
-    _veVolumeControlPtr->GetSpeechOutputLevel(-1, combinedOutputLevel);
-
-    // Update audio level controls
-    CProgressCtrl* progressMic = (CProgressCtrl*)GetDlgItem(IDC_PROGRESS_AUDIO_LEVEL_IN);
-    progressMic->SetRange(0,9);
-    progressMic->SetStep(1);
-    progressMic->SetPos(micLevel);
-    CProgressCtrl* progressOut = (CProgressCtrl*)GetDlgItem(IDC_PROGRESS_AUDIO_LEVEL_OUT);
-    progressOut->SetRange(0,9);
-    progressOut->SetStep(1);
-    progressOut->SetPos(combinedOutputLevel);
-
-    // Update playout delay (buffer size)
-    if (_veVideoSyncPtr)
-    {
-        int bufferMs(0);
-        _veVideoSyncPtr->GetPlayoutBufferSize(bufferMs);
-        SetDlgItemInt(IDC_EDIT_PLAYOUT_BUFFER_SIZE, bufferMs);
-    }
-
-    if (_delayEstimate1 && _veVideoSyncPtr)
-    {
-        const int channel = GetDlgItemInt(IDC_EDIT_1);
-        int delayMs(0);
-        _veVideoSyncPtr->GetDelayEstimate(channel, delayMs);
-        SetDlgItemInt(IDC_EDIT_DELAY_ESTIMATE_1, delayMs);
-    }
-
-    if (_rxVad && _veApmPtr && _rxVadObserverPtr)
-    {
-        SetDlgItemInt(IDC_EDIT_RXVAD, _rxVadObserverPtr->vad_decision);
-    }
-
-    if (_veHardwarePtr)
-    {
-        int load1, load2;
-        _veHardwarePtr->GetSystemCPULoad(load1);
-        _veHardwarePtr->GetCPULoad(load2);
-        str.Format(_T("CPU load (system/VoE): %d/%d [%%]"), load1, load2);
-        SetDlgItemText(IDC_EDIT_CPU_LOAD, (LPCTSTR)str);
-    }
-
-    BOOL ret;
-    int channel = GetDlgItemInt(IDC_EDIT_1, &ret);
-
-    if (_veCodecPtr)
-    {
-        if (ret == TRUE)
-        {
-            CodecInst codec;
-            if (_veCodecPtr->GetRecCodec(channel, codec) == 0)
-            {
-        str.Format(_T("RX codec: %s, freq=%d, pt=%d, rate=%d, size=%d"), CharToTchar(codec.plname, 32), codec.plfreq, codec.pltype, codec.rate, codec.pacsize);
-                SetDlgItemText(IDC_EDIT_RX_CODEC_1, (LPCTSTR)str);
-            }
-        }
-    }
-
-    if (_veRtpRtcpPtr)
-    {
-        if (ret == TRUE)
-        {
-            CallStatistics stats;
-            if (_veRtpRtcpPtr->GetRTCPStatistics(channel, stats) == 0)
-            {
-                str.Format(_T("RTCP | RTP: cum=%u, ext=%d, frac=%u, jitter=%u | TX=%d, RX=%d, RTT=%d"),
-                    stats.cumulativeLost, stats.extendedMax, stats.fractionLost, stats.jitterSamples, stats.packetsSent, stats.packetsReceived, stats.rttMs);
-                SetDlgItemText(IDC_EDIT_RTCP_STAT_1, (LPCTSTR)str);
-            }
-        }
-    }
-
-    SetTimer(0, 1000, NULL);
-    CDialog::OnTimer(nIDEvent);
-}
-
-void CWinTestDlg::OnBnClickedButtonClearErrorCallback()
-{
-    _nErrorCallbacks = 0;
-    SetDlgItemText(IDC_EDIT_ERROR_CALLBACK, _T(""));
-}
-
-// ----------------------------------------------------------------------------
-//                                       TEST
-// ----------------------------------------------------------------------------
-
-void CWinTestDlg::OnBnClickedButtonTest1()
-{
-    // add tests here...
-}
diff --git a/webrtc/voice_engine/test/win_test/WinTestDlg.h b/webrtc/voice_engine/test/win_test/WinTestDlg.h
deleted file mode 100644
index a779880..0000000
--- a/webrtc/voice_engine/test/win_test/WinTestDlg.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-#ifndef WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_WINTESTDLG_H_
-#define WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_WINTESTDLG_H_
-
-#if (_MSC_VER >= 1400)
-#define PRINT_GET_RESULT(...) \
-    { \
-        _strMsg.Format(__VA_ARGS__); \
-        SetDlgItemText(IDC_EDIT_GET_OUTPUT, _strMsg); \
-    } \
-
-#define TEST(x, ...) \
-    if (!(x)) \
-    { \
-        _strMsg.Format(__VA_ARGS__); \
-        SetDlgItemText(IDC_EDIT_MESSAGE, _strMsg); \
-        _strErr.Format(_T("FAILED (error=%d)"), _veBasePtr->LastError()); \
-        SetDlgItemText(IDC_EDIT_RESULT, _strErr); \
-        _failCount++; \
-        SetDlgItemInt(IDC_EDIT_N_FAILS, _failCount); \
-        SetDlgItemInt(IDC_EDIT_LAST_ERROR, _veBasePtr->LastError()); \
-    } \
-    else \
-    { \
-        _strMsg.Format(__VA_ARGS__); \
-        SetDlgItemText(IDC_EDIT_MESSAGE, _strMsg); \
-        SetDlgItemText(IDC_EDIT_RESULT, _T("OK")); \
-    } \
-
-#define TEST2(x, ...) \
-    if (!(x)) \
-    { \
-        _strMsg.Format(__VA_ARGS__); \
-        ((CWinTestDlg*)_parentDialogPtr)->UpdateTest(true, _strMsg); \
-    } \
-    else \
-    { \
-        _strMsg.Format(__VA_ARGS__); \
-        ((CWinTestDlg*)_parentDialogPtr)->UpdateTest(false, _strMsg); \
-    }
-#else
-#define TEST(x, exp) \
-    if (!(x)) \
-    { \
-        _strMsg.Format(exp); \
-        SetDlgItemText(IDC_EDIT_MESSAGE, _strMsg); \
-        _strErr.Format("FAILED (error=%d)", _veBasePtr->LastError()); \
-        SetDlgItemText(IDC_EDIT_RESULT, _strErr); \
-        _failCount++; \
-        SetDlgItemInt(IDC_EDIT_N_FAILS, _failCount); \
-        SetDlgItemInt(IDC_EDIT_LAST_ERROR, _veBasePtr->LastError()); \
-    } \
-    else \
-    { \
-        _strMsg.Format(exp); \
-        SetDlgItemText(IDC_EDIT_MESSAGE, _strMsg); \
-        SetDlgItemText(IDC_EDIT_RESULT, _T("OK")); \
-    } \
-
-#define TEST2(x, exp) \
-    if (!(x)) \
-    { \
-        _strMsg.Format(exp); \
-        ((CWinTestDlg*)_parentDialogPtr)->UpdateTest(true, _strMsg); \
-    } \
-    else \
-    { \
-        _strMsg.Format(exp); \
-        ((CWinTestDlg*)_parentDialogPtr)->UpdateTest(false, _strMsg); \
-    }
-#endif
-
-#include <string>
-
-#include "webrtc/voice_engine/include/voe_base.h"
-#include "webrtc/voice_engine/include/voe_codec.h"
-#include "webrtc/voice_engine/include/voe_dtmf.h"
-#include "webrtc/voice_engine/include/voe_external_media.h"
-#include "webrtc/voice_engine/include/voe_file.h"
-#include "webrtc/voice_engine/include/voe_hardware.h"
-#include "webrtc/voice_engine/include/voe_network.h"
-#include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
-#include "webrtc/voice_engine/include/voe_video_sync.h"
-#include "webrtc/voice_engine/include/voe_volume_control.h"
-
-#include "webrtc/voice_engine/include/voe_audio_processing.h"
-#include "webrtc/voice_engine/include/voe_errors.h"
-#include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
-
-class MediaProcessImpl;
-class RxCallback;
-class MyTransport;
-
-using namespace webrtc;
-
-#define MAX_NUM_OF_CHANNELS    10
-
-// CWinTestDlg dialog
-class CWinTestDlg : public CDialog,
-                    public VoiceEngineObserver,
-                    public VoERTPObserver
-{
-// Construction
-public:
-    CWinTestDlg(CWnd* pParent = NULL);    // standard constructor
-    virtual ~CWinTestDlg();
-
-// Dialog Data
-    enum { IDD = IDD_WINTEST_DIALOG };
-
-    BOOL UpdateTest(bool failed, const CString& strMsg);
-
-protected:
-    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-
-protected:  // VoiceEngineObserver
-    virtual void CallbackOnError(int channel, int errCode);
-
-protected:    // VoERTPObserver
-    virtual void OnIncomingCSRCChanged(
-        int channel, unsigned int CSRC, bool added);
-    virtual void OnIncomingSSRCChanged(
-        int channel, unsigned int SSRC);
-
-// Implementation
-protected:
-    HICON m_hIcon;
-
-    // Generated message map functions
-    virtual BOOL OnInitDialog();
-    afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
-    afx_msg void OnPaint();
-    afx_msg HCURSOR OnQueryDragIcon();
-    DECLARE_MESSAGE_MAP()
-public:
-    afx_msg void OnBnClickedButtonCreate1();
-    afx_msg void OnBnClickedButtonDelete1();
-
-private:
-    VoiceEngine*    _vePtr;
-
-    VoECodec*               _veCodecPtr;
-    VoEExternalMedia*       _veExternalMediaPtr;
-    VoEVolumeControl*       _veVolumeControlPtr;
-    VoEHardware*            _veHardwarePtr;
-    VoEVideoSync*           _veVideoSyncPtr;
-    VoENetwork*             _veNetworkPtr;
-    VoEFile*                _veFilePtr;
-    VoEAudioProcessing*     _veApmPtr;
-    VoEBase*                _veBasePtr;
-    VoERTP_RTCP*            _veRtpRtcpPtr;
-
-    MyTransport*            _transportPtr;
-    MediaProcessImpl*       _externalMediaPtr;
-    RxCallback*             _rxVadObserverPtr;
-
-private:
-    int                     _failCount;
-    CString                 _strMsg;
-    CString                 _strErr;
-    bool                    _externalTransport;
-    bool                    _externalTransportBuild;
-    int                     _checkPlayFileIn;
-    int                     _checkPlayFileIn1;
-    int                     _checkPlayFileIn2;
-    int                     _checkPlayFileOut1;
-    int                     _checkPlayFileOut2;
-    int                     _checkAGC;
-    int                     _checkAGC1;
-    int                     _checkNS;
-    int                     _checkNS1;
-    int                     _checkEC;
-    int                     _checkVAD1;
-    int                     _checkVAD2;
-    int                     _checkSrtpTx1;
-    int                     _checkSrtpTx2;
-    int                     _checkSrtpRx1;
-    int                     _checkSrtpRx2;
-    int                     _checkConference1;
-    int                     _checkConference2;
-    int                     _checkOnHold1;
-    int                     _checkOnHold2;
-    bool                    _delayEstimate1;
-    bool                    _delayEstimate2;
-    bool                    _rxVad;
-    int                     _nErrorCallbacks;
-    int                     _timerTicks;
-    std::string             _long_audio_file_path;
-
-public:
-    afx_msg void OnBnClickedButtonCreate2();
-    afx_msg void OnBnClickedButtonDelete2();
-    afx_msg void OnCbnSelchangeComboCodec1();
-    afx_msg void OnBnClickedButtonStartListen1();
-    afx_msg void OnBnClickedButtonStopListen1();
-    afx_msg void OnBnClickedButtonStartPlayout1();
-    afx_msg void OnBnClickedButtonStopPlayout1();
-    afx_msg void OnBnClickedButtonStartSend1();
-    afx_msg void OnBnClickedButtonStopSend1();
-    afx_msg void OnCbnSelchangeComboIp2();
-    afx_msg void OnCbnSelchangeComboIp1();
-    afx_msg void OnCbnSelchangeComboCodec2();
-    afx_msg void OnBnClickedButtonStartListen2();
-    afx_msg void OnBnClickedButtonStopListen2();
-    afx_msg void OnBnClickedButtonStartPlayout2();
-    afx_msg void OnBnClickedButtonStopPlayout2();
-    afx_msg void OnBnClickedButtonStartSend2();
-    afx_msg void OnBnClickedButtonStopSend2();
-    afx_msg void OnBnClickedButtonTest11();
-    afx_msg void OnBnClickedCheckExtTrans1();
-    afx_msg void OnBnClickedCheckPlayFileIn1();
-    afx_msg void OnBnClickedCheckPlayFileOut1();
-    afx_msg void OnBnClickedCheckExtTrans2();
-    afx_msg void OnBnClickedCheckPlayFileIn2();
-    afx_msg void OnBnClickedCheckPlayFileOut2();
-    afx_msg void OnBnClickedCheckPlayFileIn();
-    afx_msg void OnBnClickedCheckPlayFileOut();
-    afx_msg void OnCbnSelchangeComboRecDevice();
-    afx_msg void OnCbnSelchangeComboPlayDevice();
-    afx_msg void OnBnClickedCheckExtMediaIn1();
-    afx_msg void OnBnClickedCheckExtMediaOut1();
-    afx_msg void OnNMReleasedcaptureSliderInputVolume(NMHDR *pNMHDR, LRESULT *pResult);
-    afx_msg void OnNMReleasedcaptureSliderOutputVolume(NMHDR *pNMHDR, LRESULT *pResult);
-    afx_msg void OnTimer(UINT_PTR nIDEvent);
-    afx_msg void OnBnClickedCheckAgc();
-    CString _strComboIp1;
-    CString _strComboIp2;
-    afx_msg void OnBnClickedCheckNs();
-    afx_msg void OnBnClickedCheckEc();
-    afx_msg void OnBnClickedCheckVad1();
-    afx_msg void OnBnClickedCheckVad2();
-    afx_msg void OnBnClickedCheckExtMediaIn2();
-    afx_msg void OnBnClickedCheckExtMediaOut2();
-    afx_msg void OnBnClickedCheckMuteIn();
-    afx_msg void OnBnClickedCheckMuteIn1();
-    afx_msg void OnBnClickedCheckMuteIn2();
-    afx_msg void OnBnClickedCheckSrtpTx1();
-    afx_msg void OnBnClickedCheckSrtpRx1();
-    afx_msg void OnBnClickedCheckSrtpTx2();
-    afx_msg void OnBnClickedCheckSrtpRx2();
-    afx_msg void OnBnClickedButtonDtmf1();
-    afx_msg void OnBnClickedCheckRecMic();
-    afx_msg void OnBnClickedButtonDtmf2();
-    afx_msg void OnBnClickedButtonTest1();
-    afx_msg void OnBnClickedCheckConference1();
-    afx_msg void OnBnClickedCheckConference2();
-    afx_msg void OnBnClickedCheckOnHold1();
-    afx_msg void OnBnClickedCheckOnHold2();
-    afx_msg void OnBnClickedCheckExtMediaIn();
-    afx_msg void OnBnClickedCheckExtMediaOut();
-    afx_msg void OnLbnSelchangeListCodec1();
-    afx_msg void OnNMReleasedcaptureSliderPanLeft(NMHDR *pNMHDR, LRESULT *pResult);
-    afx_msg void OnNMReleasedcaptureSliderPanRight(NMHDR *pNMHDR, LRESULT *pResult);
-    afx_msg void OnBnClickedButtonVersion();
-    afx_msg void OnBnClickedCheckDelayEstimate1();
-    afx_msg void OnBnClickedCheckRxvad();
-    afx_msg void OnBnClickedCheckAgc1();
-    afx_msg void OnBnClickedCheckNs1();
-    afx_msg void OnBnClickedCheckRecCall();
-    afx_msg void OnBnClickedCheckTypingDetection();
-    afx_msg void OnBnClickedCheckRED();
-    afx_msg void OnBnClickedButtonClearErrorCallback();
-    afx_msg void OnBnClickedCheckBwe1();
-};
-
-#endif  // WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_WINTESTDLG_H_
diff --git a/webrtc/voice_engine/test/win_test/res/WinTest.ico b/webrtc/voice_engine/test/win_test/res/WinTest.ico
deleted file mode 100644
index 8a84ca3..0000000
--- a/webrtc/voice_engine/test/win_test/res/WinTest.ico
+++ /dev/null
Binary files differ
diff --git a/webrtc/voice_engine/test/win_test/res/WinTest.rc2 b/webrtc/voice_engine/test/win_test/res/WinTest.rc2
deleted file mode 100644
index 044bf7e..0000000
--- a/webrtc/voice_engine/test/win_test/res/WinTest.rc2
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// WinTest.RC2 - resources Microsoft Visual C++ does not edit directly
-//
-
-#ifdef APSTUDIO_INVOKED
-#error this file is not editable by Microsoft Visual C++
-#endif //APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Add manually edited resources here...
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/webrtc/voice_engine/test/win_test/stdafx.cc b/webrtc/voice_engine/test/win_test/stdafx.cc
deleted file mode 100644
index e321601..0000000
--- a/webrtc/voice_engine/test/win_test/stdafx.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-// stdafx.cpp : source file that includes just the standard includes
-// WinTest.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "webrtc/voice_engine/test/win_test/stdafx.h"
diff --git a/webrtc/voice_engine/test/win_test/stdafx.h b/webrtc/voice_engine/test/win_test/stdafx.h
deleted file mode 100644
index 17b3c30..0000000
--- a/webrtc/voice_engine/test/win_test/stdafx.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_STDAFX_H_
-#define WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_STDAFX_H_
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently,
-// but are changed infrequently
-
-#ifndef _SECURE_ATL
-#define _SECURE_ATL 1
-#endif
-
-#ifndef VC_EXTRALEAN
-#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
-#endif
-
-// Modify the following defines if you have to target a platform prior to the ones specified below.
-// Refer to MSDN for the latest info on corresponding values for different platforms.
-#ifndef WINVER				// Allow use of features specific to Windows XP or later.
-#define WINVER 0x0501		// Change this to the appropriate value to target other versions of Windows.
-#endif
-
-#ifndef _WIN32_WINNT		// Allow use of features specific to Windows XP or later.                   
-#define _WIN32_WINNT 0x0501	// Change this to the appropriate value to target other versions of Windows.
-#endif						
-
-#ifndef _WIN32_WINDOWS		// Allow use of features specific to Windows 98 or later.
-#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
-#endif
-
-#ifndef _WIN32_IE			// Allow use of features specific to IE 6.0 or later.
-#define _WIN32_IE 0x0600	// Change this to the appropriate value to target other versions of IE.
-#endif
-
-#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit
-
-// turns off MFC's hiding of some common and often safely ignored warning messages
-#define _AFX_ALL_WARNINGS
-
-#include <afxwin.h>         // MFC core and standard components
-#include <afxext.h>         // MFC extensions
-
-#ifndef _AFX_NO_OLE_SUPPORT
-#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
-#endif
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h>			// MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-#ifdef _UNICODE
-#if defined _M_IX86
-#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
-#elif defined _M_IA64
-#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
-#elif defined _M_X64
-#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
-#else
-#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
-#endif
-#endif
-
-#endif  // WEBRTC_VOICE_ENGINE_TEST_WIN_TEST_STDAFX_H_
diff --git a/webrtc/voice_engine/voice_engine.gyp b/webrtc/voice_engine/voice_engine.gyp
index 006df0f..077b193 100644
--- a/webrtc/voice_engine/voice_engine.gyp
+++ b/webrtc/voice_engine/voice_engine.gyp
@@ -228,52 +228,6 @@
         },
       ], # targets
       'conditions': [
-        # TODO(kjellander): Support UseoFMFC on VS2010.
-        # http://code.google.com/p/webrtc/issues/detail?id=709
-        ['OS=="win" and MSVS_VERSION < "2010"', {
-          'targets': [
-            # WinTest - GUI test for Windows
-            {
-              'target_name': 'voe_ui_win_test',
-              'type': 'executable',
-              'dependencies': [
-                'voice_engine',
-                '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
-                '<(webrtc_root)/test/test.gyp:test_support',
-              ],
-              'sources': [
-                'test/win_test/Resource.h',
-                'test/win_test/WinTest.cc',
-                'test/win_test/WinTest.h',
-                'test/win_test/WinTest.rc',
-                'test/win_test/WinTestDlg.cc',
-                'test/win_test/WinTestDlg.h',
-                'test/win_test/res/WinTest.ico',
-                'test/win_test/res/WinTest.rc2',
-                'test/win_test/stdafx.cc',
-                'test/win_test/stdafx.h',
-              ],
-              'configurations': {
-                'Common_Base': {
-                  'msvs_configuration_attributes': {
-                    'conditions': [
-                      ['component=="shared_library"', {
-                        'UseOfMFC': '2',  # Shared DLL
-                      },{
-                        'UseOfMFC': '1',  # Static
-                      }],
-                    ],
-                  },
-                },
-              },
-              'msvs_settings': {
-                'VCLinkerTool': {
-                  'SubSystem': '2',   # Windows
-                },
-              },
-            },
-          ],  # targets
-        }],
         ['OS=="android"', {
           'targets': [
             {
