From 421fa204650f33a880e0b7db584b146f1a8902f6 Mon Sep 17 00:00:00 2001 From: Wesnydy Ribeiro Date: Fri, 6 Mar 2015 09:29:57 -0300 Subject: [PATCH] Remoção do arquivo runningoption.xml --- runningoption.xml | 8 -------- servico/src/include/serviceWindowGeneration.h | 20 +++++++++----------- servico/src/serviceWindowGeneration.cpp | 18 +++--------------- servico/src/serviceWindowGenerationFromREC.cpp | 14 -------------- servico/src/serviceWindowGenerationFromSRT.cpp | 17 ----------------- 5 files changed, 12 insertions(+), 65 deletions(-) delete mode 100644 runningoption.xml diff --git a/runningoption.xml b/runningoption.xml deleted file mode 100644 index 29ac6fa..0000000 --- a/runningoption.xml +++ /dev/null @@ -1,8 +0,0 @@ -1 - -## Colocar no início do arquivo a opção de execução desejada. -## Opções: -## 1: Todo o projeto -## 2: Executar sem mixagem -## 3: Executar sem tradutor -## 4 - : Uso futuro diff --git a/servico/src/include/serviceWindowGeneration.h b/servico/src/include/serviceWindowGeneration.h index 0a9a0c7..ad8e6ca 100644 --- a/servico/src/include/serviceWindowGeneration.h +++ b/servico/src/include/serviceWindowGeneration.h @@ -4,22 +4,21 @@ #include #include #include -#include "dprintf.h" -#include "listenerTradutor.h" -#include "tradutorPortGlosa.h" #include #include -//#include "httpstreamer.h" -#include "synchronizer.h" -#include "listenerSynchronizer.h" -#include "Mixer.h" #include -#include "listenerMonitorPCRBase.h" #include -#include "monitor_pcr.h" -#include "inputFile.h" #include #include "dprintf.h" +#include "Mixer.h" +#include "inputFile.h" +#include "listenerTradutor.h" +#include "tradutorPortGlosa.h" +#include "monitor_pcr.h" +#include "listenerMonitorPCRBase.h" +//#include "httpstreamer.h" +#include "synchronizer.h" +#include "listenerSynchronizer.h" #include "serviceException.h" #include @@ -90,7 +89,6 @@ public: TradutorPortGlosa * getTradutor(); void adicionaPTS(int64_t pts); bool isRunning(); - char getRunningOption(); char* getPathLibras(); char* getUserId(); diff --git a/servico/src/serviceWindowGeneration.cpp b/servico/src/serviceWindowGeneration.cpp index cb269b4..2c2dac9 100644 --- a/servico/src/serviceWindowGeneration.cpp +++ b/servico/src/serviceWindowGeneration.cpp @@ -2,9 +2,7 @@ #include "serviceWindowGeneration.h" ServiceWindowGeneration::ServiceWindowGeneration() { - if (getRunningOption() != '3') { - tradutor = new TradutorPortGlosa(); - } + tradutor = new TradutorPortGlosa(); vetor_pts = new vector(); numero_legendas = INT_MAX; legendas_enviadas = 0; @@ -38,7 +36,7 @@ bool ServiceWindowGeneration::isRunning() { /* Quando o sincronizador termina, ele invoca esse método para avisar! */ void ServiceWindowGeneration::notifyEndOfSynchronization() { - if (getRunningOption() != '2' && serviceType == SERVICE_TYPE_REC || serviceType == SERVICE_TYPE_SRT) { + if (serviceType == SERVICE_TYPE_REC || serviceType == SERVICE_TYPE_SRT) { mixer = new Mixer(); mixer->initialize(this->path_input, this->path_libras,this->position,this->size,this->transparency, this->user_id); createThumbnail(); @@ -48,16 +46,6 @@ void ServiceWindowGeneration::notifyEndOfSynchronization() { } -char ServiceWindowGeneration::getRunningOption() { - char option; - if(!option){ - int file_d = open("vlibras_user/vlibras-core/runningoption.xml", O_RDONLY); - int cont = read(file_d, &option, 1); - close(file_d); - } - return option; -} - void ServiceWindowGeneration::setSizeOfSubtitles(int sub_size) { numero_legendas = sub_size; if (legendas_enviadas >= numero_legendas) { @@ -132,7 +120,7 @@ void ServiceWindowGeneration::initialize() { setPathLibras(); this->finish = false; - if (getRunningOption() != '3' && this->sublanguage == 1) { + if (this->sublanguage == 1) { tradutor->addListener(this); } diff --git a/servico/src/serviceWindowGenerationFromREC.cpp b/servico/src/serviceWindowGenerationFromREC.cpp index 04c2b56..4323579 100644 --- a/servico/src/serviceWindowGenerationFromREC.cpp +++ b/servico/src/serviceWindowGenerationFromREC.cpp @@ -68,12 +68,8 @@ void ServiceWindowGenerationFromREC::initialize() { } void ServiceWindowGenerationFromREC::notifyTextRecognized(unsigned char* text, int64_t pts) { - if (getRunningOption() == '3') { - notifySynchWithoutTranslator(text, pts); - } else { adicionaPTS(pts); notifyTranslator(text); - } } void ServiceWindowGenerationFromREC::notifyTranslator(unsigned char *text) { @@ -85,16 +81,6 @@ void ServiceWindowGenerationFromREC::notifyEnd(int sentences_size) { setSizeOfSubtitles(sentences_size); } -void ServiceWindowGenerationFromREC::notifySynchWithoutTranslator(unsigned char *text, int64_t pts) { - char* pch = strtok((char*) text, " "); - while (pch != NULL) { - string pch_string = (string) pch; - sincronizador->recebeglosa(pch_string, pts); - pch = strtok(NULL, " "); - } - free(pch); -} - void ServiceWindowGenerationFromREC::Run() { while (!rec->isFinished()) { diff --git a/servico/src/serviceWindowGenerationFromSRT.cpp b/servico/src/serviceWindowGenerationFromSRT.cpp index 2244efa..fe93c1e 100644 --- a/servico/src/serviceWindowGenerationFromSRT.cpp +++ b/servico/src/serviceWindowGenerationFromSRT.cpp @@ -43,26 +43,9 @@ void ServiceWindowGenerationFromSRT::notifyEnd(int sub_size) { void ServiceWindowGenerationFromSRT::notifySubtitle(unsigned char *legenda, int64_t pts){ - if (getRunningOption() == '3') { - notificaSincronizadorSemTradutor(legenda, pts); - } else { adicionaPTS(pts); notificaTradutor(legenda); - } -} - -void ServiceWindowGenerationFromSRT::notificaSincronizadorSemTradutor(unsigned char * legenda, int64_t pts) { - char* pch = strtok((char*) legenda, " "); - - while (pch != NULL) { - string pch_string = (string) pch; - sincronizador->recebeglosa(pch_string, pts); - printf("%s\n", pch); - pch = strtok(NULL, " "); - } - free(pch); - } void ServiceWindowGenerationFromSRT::notificaTradutor(unsigned char* legenda) { -- libgit2 0.21.2