serviceWindowGenerationFromText.h
2.92 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
* \file serviceWindowGenerationFromTXT.h
*/
#ifndef SERVICEWINDOWGENERATIONFROMTEXT_H
#define SERVICEWINDOWGENERATIONFROMTEXT_H
#include "listenerTXT.h"
#include "extratorFactory.h"
#include "serviceWindowGeneration.h"
#define MAX_TEXT_SIZE 2048 //FIXME: está restrito a 2K bytes de texto
/** \brief Classe que implementa o serviço de extração de texto.
*
* \headerfile servico/src/include/serviceWindowGenerationFromTXT.h
*/
class ServiceWindowGenerationFromText : public ServiceWindowGeneration, public ListenerTXT, public ListenerTradutor, public ListenerRenderer, public Thread {
private:
ExtratorFactory* extrator_factory;
ExtratorTXT* extratorTXT;
/** Seta o número de linhas.
*
* \param A quantidade de linhas.
* \exception ServiceException Se houver algum erro durante a execução.
*/
void setSizeOfSubtitles(int sub_size);
/** Define o path do vídeo de LIBRAS. */
void setPathLibras();
/** Define o path dos arquivos de saída.
*
* \exception RuntimeException Se houver algum erro durante a execução.
*/
void setPathContents();
/** Indica se o serviço está sendo executado.
*
* \return O status do serviço.
*/
bool isRunning();
public:
/** Construtor.
*
* \param pathFile Path do arquivo de texto de entrada.
* \param sublanguage Linguagem das legendas do arquivo.
* \param transparency Transparência do plano de fundo do vídeo.
* \param id Identificação do cliente.
* \param mode Modo de execução.
*/
ServiceWindowGenerationFromText(char* pathFile, int sublanguage, int transparency, char* id, int mode);
/** Destrutor */
~ServiceWindowGenerationFromText();
/** Notifica novas linhas extraídas.
*
* \param line A linha extraída.
*/
void notifyLine(unsigned char* line);
/** Recebe a notificação do fim da renderização do vídeo */
void notifyEndOfRenderization();
/** Recebe a notificação do fim da tradução do texto.
*
* \param glosa O texto traduzido.
*/
void notifyTranslation(char* glosa);
/** Envia para a tradução a linha obtida.
*
* \param text A linha obtida.
*/
void notifyTranslator(unsigned char* text);
/** Envia a glosa para o renderizador.
*
* \param glosa A glosa obtida.
* \exception ServiceException Se houver algum erro durante a execução.
*/
void notifyRenderer(string glosa);
/** Notifica o fim da extração do texto.
*
* \param line_size O número de linhas extraídas.
*/
void notifyEnd(int line_size);
/** Inicia o serviço de extração de texto.
*
* \exception ServiceException Se houver algum erro durante a execução.
*/
void initialize();
/** Indica o fim do processo do serviço.
*
* \return O status do processo.
*/
bool isFinished();
/** Este método é chamado quando a Thread for iniciada. */
void Run();
};
#endif /* SERVICEWINDOWGENERATIONFROMTEXT_H */