OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #include "webrtc/modules/audio_processing/test/conversational_speech/settings.h" | |
12 | |
13 namespace webrtc { | |
14 namespace test { | |
15 namespace convspeechgen { | |
16 | |
17 const std::string Settings::AudiotracksPath(void) { | |
18 return audiotracks_path_; | |
19 } | |
20 | |
21 const std::string Settings::TimingFilePath(void) { | |
22 return timing_filepath_; | |
23 } | |
24 | |
25 const std::string Settings::OutputPath(void) { | |
26 return output_path_; | |
27 } | |
28 | |
29 bool Settings::ValidateAndReport(void) { | |
30 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.
| |
31 ReportConditionalError( | |
32 !bln_valid_audiotracks_path, "invalid audio tracks path"); | |
33 | |
34 bool bln_valid_timing_filepath = ValidateDirectoryPath(&timing_filepath_); | |
35 ReportConditionalError( | |
36 !bln_valid_timing_filepath, "invalid timing file path"); | |
37 | |
38 bool bln_valid_output_path = ValidateDirectoryPath(&output_path_); | |
39 ReportConditionalError(!bln_valid_output_path, "invalid output path"); | |
40 | |
41 return bln_valid_audiotracks_path && bln_valid_timing_filepath && | |
42 (bln_valid_output_path); | |
43 } | |
44 | |
45 bool Settings::ValidateFilePath(std::string* path) { | |
46 // TODO(alessiob): check that the file exists. | |
47 return true; | |
48 } | |
49 | |
50 bool Settings::ValidateDirectoryPath(std::string* path) { | |
51 // TODO(alessiob): check that the directory exists. | |
52 return true; | |
53 } | |
54 | |
55 void Settings::ReportConditionalError(bool condition, std::string message) { | |
56 if (condition) | |
57 std::cerr << message << std::endl; | |
58 } | |
59 | |
60 } // namespace convspeechgen | |
61 } // namespace test | |
62 } // namespace webrtc | |
OLD | NEW |