Commit 421fa204650f33a880e0b7db584b146f1a8902f6

Authored by Wesnydy Ribeiro
1 parent 4eeb9359
Exists in master and in 1 other branch devel

Remoção do arquivo runningoption.xml

runningoption.xml
... ... @@ -1,8 +0,0 @@
1   -1
2   -
3   -## Colocar no início do arquivo a opção de execução desejada.
4   -## Opções:
5   -## 1: Todo o projeto
6   -## 2: Executar sem mixagem
7   -## 3: Executar sem tradutor
8   -## 4 - : Uso futuro
servico/src/include/serviceWindowGeneration.h
... ... @@ -4,22 +4,21 @@
4 4 #include <stdlib.h>
5 5 #include <locale>
6 6 #include <string>
7   -#include "dprintf.h"
8   -#include "listenerTradutor.h"
9   -#include "tradutorPortGlosa.h"
10 7 #include <iostream>
11 8 #include <vector>
12   -//#include "httpstreamer.h"
13   -#include "synchronizer.h"
14   -#include "listenerSynchronizer.h"
15   -#include "Mixer.h"
16 9 #include <fcntl.h>
17   -#include "listenerMonitorPCRBase.h"
18 10 #include <sys/time.h>
19   -#include "monitor_pcr.h"
20   -#include "inputFile.h"
21 11 #include <limits.h>
22 12 #include "dprintf.h"
  13 +#include "Mixer.h"
  14 +#include "inputFile.h"
  15 +#include "listenerTradutor.h"
  16 +#include "tradutorPortGlosa.h"
  17 +#include "monitor_pcr.h"
  18 +#include "listenerMonitorPCRBase.h"
  19 +//#include "httpstreamer.h"
  20 +#include "synchronizer.h"
  21 +#include "listenerSynchronizer.h"
23 22 #include "serviceException.h"
24 23 #include <lavidlib/base/RuntimeException.h>
25 24  
... ... @@ -90,7 +89,6 @@ public:
90 89 TradutorPortGlosa * getTradutor();
91 90 void adicionaPTS(int64_t pts);
92 91 bool isRunning();
93   - char getRunningOption();
94 92  
95 93 char* getPathLibras();
96 94 char* getUserId();
... ...
servico/src/serviceWindowGeneration.cpp
... ... @@ -2,9 +2,7 @@
2 2 #include "serviceWindowGeneration.h"
3 3  
4 4 ServiceWindowGeneration::ServiceWindowGeneration() {
5   - if (getRunningOption() != '3') {
6   - tradutor = new TradutorPortGlosa();
7   - }
  5 + tradutor = new TradutorPortGlosa();
8 6 vetor_pts = new vector<int64_t >();
9 7 numero_legendas = INT_MAX;
10 8 legendas_enviadas = 0;
... ... @@ -38,7 +36,7 @@ bool ServiceWindowGeneration::isRunning() {
38 36  
39 37 /* Quando o sincronizador termina, ele invoca esse método para avisar! */
40 38 void ServiceWindowGeneration::notifyEndOfSynchronization() {
41   - if (getRunningOption() != '2' && serviceType == SERVICE_TYPE_REC || serviceType == SERVICE_TYPE_SRT) {
  39 + if (serviceType == SERVICE_TYPE_REC || serviceType == SERVICE_TYPE_SRT) {
42 40 mixer = new Mixer();
43 41 mixer->initialize(this->path_input, this->path_libras,this->position,this->size,this->transparency, this->user_id);
44 42 createThumbnail();
... ... @@ -48,16 +46,6 @@ void ServiceWindowGeneration::notifyEndOfSynchronization() {
48 46  
49 47 }
50 48  
51   -char ServiceWindowGeneration::getRunningOption() {
52   - char option;
53   - if(!option){
54   - int file_d = open("vlibras_user/vlibras-core/runningoption.xml", O_RDONLY);
55   - int cont = read(file_d, &option, 1);
56   - close(file_d);
57   - }
58   - return option;
59   -}
60   -
61 49 void ServiceWindowGeneration::setSizeOfSubtitles(int sub_size) {
62 50 numero_legendas = sub_size;
63 51 if (legendas_enviadas >= numero_legendas) {
... ... @@ -132,7 +120,7 @@ void ServiceWindowGeneration::initialize() {
132 120 setPathLibras();
133 121  
134 122 this->finish = false;
135   - if (getRunningOption() != '3' && this->sublanguage == 1) {
  123 + if (this->sublanguage == 1) {
136 124 tradutor->addListener(this);
137 125 }
138 126  
... ...
servico/src/serviceWindowGenerationFromREC.cpp
... ... @@ -68,12 +68,8 @@ void ServiceWindowGenerationFromREC::initialize() {
68 68 }
69 69  
70 70 void ServiceWindowGenerationFromREC::notifyTextRecognized(unsigned char* text, int64_t pts) {
71   - if (getRunningOption() == '3') {
72   - notifySynchWithoutTranslator(text, pts);
73   - } else {
74 71 adicionaPTS(pts);
75 72 notifyTranslator(text);
76   - }
77 73 }
78 74  
79 75 void ServiceWindowGenerationFromREC::notifyTranslator(unsigned char *text) {
... ... @@ -85,16 +81,6 @@ void ServiceWindowGenerationFromREC::notifyEnd(int sentences_size) {
85 81 setSizeOfSubtitles(sentences_size);
86 82 }
87 83  
88   -void ServiceWindowGenerationFromREC::notifySynchWithoutTranslator(unsigned char *text, int64_t pts) {
89   - char* pch = strtok((char*) text, " ");
90   - while (pch != NULL) {
91   - string pch_string = (string) pch;
92   - sincronizador->recebeglosa(pch_string, pts);
93   - pch = strtok(NULL, " ");
94   - }
95   - free(pch);
96   -}
97   -
98 84 void ServiceWindowGenerationFromREC::Run() {
99 85  
100 86 while (!rec->isFinished()) {
... ...
servico/src/serviceWindowGenerationFromSRT.cpp
... ... @@ -43,26 +43,9 @@ void ServiceWindowGenerationFromSRT::notifyEnd(int sub_size) {
43 43  
44 44  
45 45 void ServiceWindowGenerationFromSRT::notifySubtitle(unsigned char *legenda, int64_t pts){
46   - if (getRunningOption() == '3') {
47   - notificaSincronizadorSemTradutor(legenda, pts);
48   - } else {
49 46 adicionaPTS(pts);
50 47 notificaTradutor(legenda);
51   - }
52   -}
53   -
54   -void ServiceWindowGenerationFromSRT::notificaSincronizadorSemTradutor(unsigned char * legenda, int64_t pts) {
55 48  
56   - char* pch = strtok((char*) legenda, " ");
57   -
58   - while (pch != NULL) {
59   - string pch_string = (string) pch;
60   - sincronizador->recebeglosa(pch_string, pts);
61   - printf("%s\n", pch);
62   - pch = strtok(NULL, " ");
63   - }
64   - free(pch);
65   -
66 49 }
67 50  
68 51 void ServiceWindowGenerationFromSRT::notificaTradutor(unsigned char* legenda) {
... ...