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_TIMING_H_ | |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_TIMING_H_ | |
13 | |
14 #include <memory> | |
15 #include <string> | |
16 #include <vector> | |
17 | |
18 #include "webrtc/base/array_view.h" | |
19 | |
20 namespace webrtc { | |
21 namespace test { | |
22 namespace conversational_speech { | |
23 | |
24 class Timing { | |
25 public: | |
26 struct Turn{ | |
27 Turn(std::string new_speaker_name, std::string new_audiotrack_file_name, | |
28 int new_offset) | |
29 : speaker_name(new_speaker_name), | |
30 audiotrack_file_name(new_audiotrack_file_name), | |
31 offset(new_offset) {} | |
32 bool operator ==(const Turn &b) const; | |
kwiberg-webrtc
2017/03/21 22:35:15
No space before ==
AleBzk
2017/03/22 10:07:22
Done.
| |
33 std::string speaker_name; | |
34 std::string audiotrack_file_name; | |
35 int offset; | |
36 }; | |
37 | |
38 Timing(); | |
39 Timing(std::initializer_list<Turn> il); | |
AleBzk
2017/03/20 14:25:28
I added this to familiarize with initializer list.
| |
40 ~Timing(); | |
41 | |
42 // Removes all the existing turn entries. | |
43 void Clear(); | |
44 | |
45 // Appends the next turn. | |
46 void AppendTurn(Timing::Turn turn); | |
47 | |
48 // Loads the turns from a file. | |
49 void Load(const std::string& timing_filepath); | |
kwiberg-webrtc
2017/03/21 22:35:15
Would it make sense to turn this into a constructo
AleBzk
2017/03/22 10:07:22
Right. I'll go for the constructor way.
| |
50 | |
51 // Writes the turns into a file. | |
52 void Save(const std::string& timing_filepath) const; | |
53 | |
54 rtc::ArrayView<const Timing::Turn> turns() const; | |
55 | |
56 private: | |
57 std::vector<Turn> turns_; | |
58 }; | |
kwiberg-webrtc
2017/03/21 22:35:15
Hmm. Now that you no longer use unique_ptr, Timing
AleBzk
2017/03/22 10:07:22
Done.
| |
59 | |
60 } // namespace conversational_speech | |
61 } // namespace test | |
62 } // namespace webrtc | |
63 | |
64 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_TIMING_H_ | |
OLD | NEW |