Index: webrtc/modules/audio_processing/test/conversational_speech/settings.cc |
diff --git a/webrtc/modules/audio_processing/test/conversational_speech/settings.cc b/webrtc/modules/audio_processing/test/conversational_speech/settings.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9c11502573a9b2ef1da2aaf021e8e93167fa5f66 |
--- /dev/null |
+++ b/webrtc/modules/audio_processing/test/conversational_speech/settings.cc |
@@ -0,0 +1,62 @@ |
+/* |
+ * Copyright (c) 2017 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/modules/audio_processing/test/conversational_speech/settings.h" |
+ |
+namespace webrtc { |
+namespace test { |
+namespace convspeechgen { |
+ |
+const std::string Settings::AudiotracksPath(void) { |
+ return audiotracks_path_; |
+} |
+ |
+const std::string Settings::TimingFilePath(void) { |
+ return timing_filepath_; |
+} |
+ |
+const std::string Settings::OutputPath(void) { |
+ return output_path_; |
+} |
+ |
+bool Settings::ValidateAndReport(void) { |
+ bool bln_valid_audiotracks_path = ValidateDirectoryPath(&audiotracks_path_); |
hlundin-webrtc
2017/03/13 12:28:19
We typically don't add bln_ to qualify the variabl
AleBzk
2017/03/13 14:14:41
Acknowledged.
|
+ ReportConditionalError( |
+ !bln_valid_audiotracks_path, "invalid audio tracks path"); |
+ |
+ bool bln_valid_timing_filepath = ValidateDirectoryPath(&timing_filepath_); |
+ ReportConditionalError( |
+ !bln_valid_timing_filepath, "invalid timing file path"); |
+ |
+ bool bln_valid_output_path = ValidateDirectoryPath(&output_path_); |
+ ReportConditionalError(!bln_valid_output_path, "invalid output path"); |
+ |
+ return bln_valid_audiotracks_path && bln_valid_timing_filepath && |
+ (bln_valid_output_path); |
+} |
+ |
+bool Settings::ValidateFilePath(std::string* path) { |
+ // TODO(alessiob): check that the file exists. |
+ return true; |
+} |
+ |
+bool Settings::ValidateDirectoryPath(std::string* path) { |
+ // TODO(alessiob): check that the directory exists. |
+ return true; |
+} |
+ |
+void Settings::ReportConditionalError(bool condition, std::string message) { |
+ if (condition) |
+ std::cerr << message << std::endl; |
+} |
+ |
+} // namespace convspeechgen |
+} // namespace test |
+} // namespace webrtc |