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,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,22 +4,21 @@
4 #include <stdlib.h> 4 #include <stdlib.h>
5 #include <locale> 5 #include <locale>
6 #include <string> 6 #include <string>
7 -#include "dprintf.h"  
8 -#include "listenerTradutor.h"  
9 -#include "tradutorPortGlosa.h"  
10 #include <iostream> 7 #include <iostream>
11 #include <vector> 8 #include <vector>
12 -//#include "httpstreamer.h"  
13 -#include "synchronizer.h"  
14 -#include "listenerSynchronizer.h"  
15 -#include "Mixer.h"  
16 #include <fcntl.h> 9 #include <fcntl.h>
17 -#include "listenerMonitorPCRBase.h"  
18 #include <sys/time.h> 10 #include <sys/time.h>
19 -#include "monitor_pcr.h"  
20 -#include "inputFile.h"  
21 #include <limits.h> 11 #include <limits.h>
22 #include "dprintf.h" 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 #include "serviceException.h" 22 #include "serviceException.h"
24 #include <lavidlib/base/RuntimeException.h> 23 #include <lavidlib/base/RuntimeException.h>
25 24
@@ -90,7 +89,6 @@ public: @@ -90,7 +89,6 @@ public:
90 TradutorPortGlosa * getTradutor(); 89 TradutorPortGlosa * getTradutor();
91 void adicionaPTS(int64_t pts); 90 void adicionaPTS(int64_t pts);
92 bool isRunning(); 91 bool isRunning();
93 - char getRunningOption();  
94 92
95 char* getPathLibras(); 93 char* getPathLibras();
96 char* getUserId(); 94 char* getUserId();
servico/src/serviceWindowGeneration.cpp
@@ -2,9 +2,7 @@ @@ -2,9 +2,7 @@
2 #include "serviceWindowGeneration.h" 2 #include "serviceWindowGeneration.h"
3 3
4 ServiceWindowGeneration::ServiceWindowGeneration() { 4 ServiceWindowGeneration::ServiceWindowGeneration() {
5 - if (getRunningOption() != '3') {  
6 - tradutor = new TradutorPortGlosa();  
7 - } 5 + tradutor = new TradutorPortGlosa();
8 vetor_pts = new vector<int64_t >(); 6 vetor_pts = new vector<int64_t >();
9 numero_legendas = INT_MAX; 7 numero_legendas = INT_MAX;
10 legendas_enviadas = 0; 8 legendas_enviadas = 0;
@@ -38,7 +36,7 @@ bool ServiceWindowGeneration::isRunning() { @@ -38,7 +36,7 @@ bool ServiceWindowGeneration::isRunning() {
38 36
39 /* Quando o sincronizador termina, ele invoca esse método para avisar! */ 37 /* Quando o sincronizador termina, ele invoca esse método para avisar! */
40 void ServiceWindowGeneration::notifyEndOfSynchronization() { 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 mixer = new Mixer(); 40 mixer = new Mixer();
43 mixer->initialize(this->path_input, this->path_libras,this->position,this->size,this->transparency, this->user_id); 41 mixer->initialize(this->path_input, this->path_libras,this->position,this->size,this->transparency, this->user_id);
44 createThumbnail(); 42 createThumbnail();
@@ -48,16 +46,6 @@ void ServiceWindowGeneration::notifyEndOfSynchronization() { @@ -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 void ServiceWindowGeneration::setSizeOfSubtitles(int sub_size) { 49 void ServiceWindowGeneration::setSizeOfSubtitles(int sub_size) {
62 numero_legendas = sub_size; 50 numero_legendas = sub_size;
63 if (legendas_enviadas >= numero_legendas) { 51 if (legendas_enviadas >= numero_legendas) {
@@ -132,7 +120,7 @@ void ServiceWindowGeneration::initialize() { @@ -132,7 +120,7 @@ void ServiceWindowGeneration::initialize() {
132 setPathLibras(); 120 setPathLibras();
133 121
134 this->finish = false; 122 this->finish = false;
135 - if (getRunningOption() != '3' && this->sublanguage == 1) { 123 + if (this->sublanguage == 1) {
136 tradutor->addListener(this); 124 tradutor->addListener(this);
137 } 125 }
138 126
servico/src/serviceWindowGenerationFromREC.cpp
@@ -68,12 +68,8 @@ void ServiceWindowGenerationFromREC::initialize() { @@ -68,12 +68,8 @@ void ServiceWindowGenerationFromREC::initialize() {
68 } 68 }
69 69
70 void ServiceWindowGenerationFromREC::notifyTextRecognized(unsigned char* text, int64_t pts) { 70 void ServiceWindowGenerationFromREC::notifyTextRecognized(unsigned char* text, int64_t pts) {
71 - if (getRunningOption() == '3') {  
72 - notifySynchWithoutTranslator(text, pts);  
73 - } else {  
74 adicionaPTS(pts); 71 adicionaPTS(pts);
75 notifyTranslator(text); 72 notifyTranslator(text);
76 - }  
77 } 73 }
78 74
79 void ServiceWindowGenerationFromREC::notifyTranslator(unsigned char *text) { 75 void ServiceWindowGenerationFromREC::notifyTranslator(unsigned char *text) {
@@ -85,16 +81,6 @@ void ServiceWindowGenerationFromREC::notifyEnd(int sentences_size) { @@ -85,16 +81,6 @@ void ServiceWindowGenerationFromREC::notifyEnd(int sentences_size) {
85 setSizeOfSubtitles(sentences_size); 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 void ServiceWindowGenerationFromREC::Run() { 84 void ServiceWindowGenerationFromREC::Run() {
99 85
100 while (!rec->isFinished()) { 86 while (!rec->isFinished()) {
servico/src/serviceWindowGenerationFromSRT.cpp
@@ -43,26 +43,9 @@ void ServiceWindowGenerationFromSRT::notifyEnd(int sub_size) { @@ -43,26 +43,9 @@ void ServiceWindowGenerationFromSRT::notifyEnd(int sub_size) {
43 43
44 44
45 void ServiceWindowGenerationFromSRT::notifySubtitle(unsigned char *legenda, int64_t pts){ 45 void ServiceWindowGenerationFromSRT::notifySubtitle(unsigned char *legenda, int64_t pts){
46 - if (getRunningOption() == '3') {  
47 - notificaSincronizadorSemTradutor(legenda, pts);  
48 - } else {  
49 adicionaPTS(pts); 46 adicionaPTS(pts);
50 notificaTradutor(legenda); 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 void ServiceWindowGenerationFromSRT::notificaTradutor(unsigned char* legenda) { 51 void ServiceWindowGenerationFromSRT::notificaTradutor(unsigned char* legenda) {