-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOne_subtitle.h
45 lines (33 loc) · 1.32 KB
/
One_subtitle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Created by shahrooz on 10/27/20.
//
#ifndef ENGLISH_TEACHER_ONE_SUBTITLE_H
#define ENGLISH_TEACHER_ONE_SUBTITLE_H
#include "Util.h"
class Subtitle;
using namespace std;
using namespace std::chrono;
typedef uint32_t uint;
class One_subtitle {
public:
explicit One_subtitle(const string &in, Subtitle *parent);
virtual ~One_subtitle() = default;
uint get_id() const;
const time_point<steady_clock, milliseconds> &get_start_time() const;
const time_point<steady_clock, milliseconds> &get_end_time() const;
const string &get_text() const;
const One_subtitle *get_next() const;
const One_subtitle *get_prev() const;
private:
uint id;
time_point<steady_clock, milliseconds> start_time;
time_point<steady_clock, milliseconds> end_time;
string text;
Subtitle *parent;
static std::vector<std::string> split_subtitle_string(const std::string &in);
static std::chrono::time_point<std::chrono::steady_clock, std::chrono::milliseconds> stotime(const std::string &in);
static int set_start_time_end_time_from_string(const std::string &in,
std::chrono::time_point<steady_clock, milliseconds> &start_time,
std::chrono::time_point<steady_clock, milliseconds> &end_time);
};
#endif //ENGLISH_TEACHER_ONE_SUBTITLE_H