subtitle.cpp
2.19 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/***************************************************************************
* Universidade Federal da Paraíba *
* Copyright (C) 2013 by Laboratório de Aplicações de Vídeo Digital *
* *
* Centro de Informática - UFPB - Campus I *
* João Pessoa - PB - Brasil *
* *
* Author: Leonardo de Araújo Domingues (leonardo.araujo@lavid.ufpb.br) *
* Date: Qui Out 24 22:31:50 BRT 2013 *
* *
**************************************************************************/
#include "subtitle.h"
namespace sndesc {
Subtitle::Subtitle() {
//TODO: default parameters!
}
Subtitle::Subtitle (int _id, string _sub_text,
int64_t _timein, int64_t _timeout) {
int id = _id;
subtitle_text = _sub_text;
time_in = _timein;
time_out = _timeout;
}
Subtitle::~Subtitle() {
//TODO: delete objects and free memory
}
void Subtitle::setID(int _id) {
id = _id;
}
int Subtitle::getID() {
return id;
}
void Subtitle::setSubtitleText(string _subtext) {
subtitle_text = _subtext;
}
void Subtitle::setTimeIn(int64_t _timein) {
time_in = _timein;
}
void Subtitle::setTimeOut(int64_t _timeout) {
time_out = _timeout;
}
std::string Subtitle::getSubtitleText() {
return subtitle_text;
}
int64_t Subtitle::getTimeIn() {
return time_in;
}
int64_t Subtitle::getTimeOut() {
return time_out;
}
string Subtitle::toString() {
string subtitle_str;
char buffer [MAX_FIELD];
sprintf(buffer, "%d", id);
subtitle_str.append("\n{id: ").append((string)buffer);
sprintf(buffer, "%ld", time_in);
subtitle_str.append(", time_in: ").append((string)buffer);
sprintf(buffer, "%ld", time_out);
subtitle_str.append(", time_out: ").append((string)buffer);
subtitle_str.append(", text: ").append(subtitle_text).append("}\n");
return subtitle_str;
}
}