Chromium Code Reviews| 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 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_SETTINGS_H_ | |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_SETTINGS_H_ | |
| 13 | |
| 14 #include <ostream> | |
| 15 #include <string> | |
| 16 | |
| 17 namespace webrtc { | |
| 18 namespace test { | |
| 19 namespace convspeechgen { | |
|
hlundin-webrtc
2017/03/13 12:28:19
I think you can drop this namespace, and maybe giv
AleBzk
2017/03/13 14:14:41
Done.
| |
| 20 | |
| 21 class Settings { | |
|
hlundin-webrtc
2017/03/13 12:28:19
If all of the error handling can be done by gflags
AleBzk
2017/03/13 14:14:41
Done.
| |
| 22 public: | |
| 23 Settings(std::string audiotracks_path, std::string timing_filepath, | |
|
hlundin-webrtc
2017/03/13 12:28:19
Make the input parameters const references instead
AleBzk
2017/03/13 14:14:41
Done.
| |
| 24 std::string output_path) | |
| 25 : audiotracks_path_(audiotracks_path), timing_filepath_( | |
| 26 timing_filepath), output_path_(output_path) {} | |
| 27 | |
| 28 // Getters. | |
|
hlundin-webrtc
2017/03/13 12:28:19
Superfluous comment.
AleBzk
2017/03/13 14:14:41
Done.
| |
| 29 const std::string AudiotracksPath(void); | |
|
hlundin-webrtc
2017/03/13 12:28:19
const std::string makes little sense. Either drop
hlundin-webrtc
2017/03/13 12:28:19
Don't add the void parameter.
AleBzk
2017/03/13 14:14:41
Acknowledged.
AleBzk
2017/03/13 14:14:41
Acknowledged.
| |
| 30 const std::string TimingFilePath(void); | |
| 31 const std::string OutputPath(void); | |
| 32 | |
| 33 // Checks all the settings and report all the errors that are found. | |
| 34 bool ValidateAndReport(void); | |
|
hlundin-webrtc
2017/03/13 12:28:19
Drop void.
hlundin-webrtc
2017/03/13 12:28:19
const method?
AleBzk
2017/03/13 14:14:41
Acknowledged.
| |
| 35 | |
| 36 private: | |
| 37 std::string audiotracks_path_; | |
|
hlundin-webrtc
2017/03/13 12:28:19
Declare methods before member variables.
https://g
hlundin-webrtc
2017/03/13 12:28:19
You can make these variables const.
const std::str
AleBzk
2017/03/13 14:14:41
Done.
| |
| 38 std::string timing_filepath_; | |
| 39 std::string output_path_; | |
| 40 | |
| 41 // Checks if a path to a file exists. | |
| 42 static bool ValidateFilePath(std::string* path); | |
|
hlundin-webrtc
2017/03/13 12:28:19
You can use FileExists in webrtc/test/testsupport/
AleBzk
2017/03/13 14:14:42
Done.
| |
| 43 | |
| 44 // Checks if a path to a directory exists. | |
| 45 static bool ValidateDirectoryPath(std::string* path); | |
|
hlundin-webrtc
2017/03/13 12:28:19
Consider extending webrtc/test/testsupport/fileuti
AleBzk
2017/03/13 14:14:41
Done.
| |
| 46 | |
| 47 // If condition is true, prints a message into the standard error. | |
| 48 void ReportConditionalError(bool condition, std::string message); | |
| 49 }; | |
| 50 | |
| 51 } // namespace convspeechgen | |
| 52 } // namespace test | |
| 53 } // namespace webrtc | |
| 54 | |
| 55 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_SETTINGS_H _ | |
| OLD | NEW |