extratorSRT.h
1.12 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
/*
* File: extratorSRT.h
* Author: leonardo
*
* Created on 17 de Fevereiro de 2012, 17:51
*/
#ifndef EXTRATORSRT_H
#define EXTRATORSRT_H
#include "listenerSRT.h"
#include "reader_srt.h"
#include "subtitle.h"
#include "listenerMonitorPCRBase.h"
#include "jthread.h"
#include "dprintf.h"
#include "logger.h"
#include <lavidlib/io/FileIO.h>
#include "extratorSRT_exception.h"
using namespace jthread;
using namespace std;
using namespace sndesc;
class ExtratorSRT: public Thread, public ListenerMonitorPCRBase {
public:
ExtratorSRT();
~ExtratorSRT();
void addListener(ListenerSRT* listener);
void notifyListeners(unsigned char* subtitle, int64_t pts);
void notifyEndExtraction(int sub_size);
void setFilePath(char* path);
bool isFinished();
void initialize();
void Run();
void notifyPCRBase(uint64_t pcrbase);
private:
list<ListenerSRT*> *listeners;
char* filepath;
bool finish;
uint64_t pcr_base;
bool hasPCRBase;
ReaderSRT * reader;
Subtitle * subtitle;
uint64_t calcula_pts(double msec);
};
#endif /* EXTRATORSRT_H */