Commit b2bb9e8ac0657dfc36d2261c5b7ea59023b7e83e

Authored by Wesnydy Ribeiro
1 parent e009fab1
Exists in devel

Fixes quotes bug

extrator/src/extratorTXT.cpp
@@ -10,7 +10,6 @@ @@ -10,7 +10,6 @@
10 **************************************************************************/ 10 **************************************************************************/
11 11
12 #include "extratorTXT.h" 12 #include "extratorTXT.h"
13 -#include <iostream>  
14 13
15 ExtratorTXT::ExtratorTXT(){ 14 ExtratorTXT::ExtratorTXT(){
16 listeners = new list<ListenerTXT*>(); 15 listeners = new list<ListenerTXT*>();
@@ -56,6 +55,10 @@ void ExtratorTXT::encodingfiletoUTF8() { @@ -56,6 +55,10 @@ void ExtratorTXT::encodingfiletoUTF8() {
56 system(sedcmd.c_str()); 55 system(sedcmd.c_str());
57 } 56 }
58 57
  58 +void ExtratorTXT::remove_quotes(std::string &str) {
  59 + str.erase(std::remove(str.begin(), str.end(), '\"'), str.end());
  60 +}
  61 +
59 void ExtratorTXT::setFilePath(char* path){ 62 void ExtratorTXT::setFilePath(char* path){
60 this->filePath = path; 63 this->filePath = path;
61 encodingfiletoUTF8(); 64 encodingfiletoUTF8();
@@ -87,6 +90,7 @@ void ExtratorTXT::Run(){ @@ -87,6 +90,7 @@ void ExtratorTXT::Run(){
87 getline(ifs_, current_line, '\n'); 90 getline(ifs_, current_line, '\n');
88 91
89 if (current_line.length() != 0) { 92 if (current_line.length() != 0) {
  93 + remove_quotes(current_line);
90 notifyListeners((unsigned char*) current_line.c_str()); 94 notifyListeners((unsigned char*) current_line.c_str());
91 line_index++; 95 line_index++;
92 } 96 }
extrator/src/include/extratorTXT.h
@@ -75,6 +75,7 @@ public: @@ -75,6 +75,7 @@ public:
75 void Run(); 75 void Run();
76 76
77 private: 77 private:
  78 + void remove_quotes(std::string &str);
78 void encodingfiletoUTF8(); 79 void encodingfiletoUTF8();
79 80
80 list<ListenerTXT*> *listeners; 81 list<ListenerTXT*> *listeners;
renderer/src/renderer.cpp
1 #include "renderer.h" 1 #include "renderer.h"
2 -#include <iostream>  
3 2
4 Renderer::Renderer(char* path_Contents, char* id) { 3 Renderer::Renderer(char* path_Contents, char* id) {
5 this->pathOutVideo = path_Contents; 4 this->pathOutVideo = path_Contents;
@@ -103,7 +102,7 @@ void Renderer::exportGlosa() { @@ -103,7 +102,7 @@ void Renderer::exportGlosa() {
103 strcpy(glosaBff, glosaCpy.c_str()); 102 strcpy(glosaBff, glosaCpy.c_str());
104 try { 103 try {
105 cSocket->write(glosaBff, size); //Envia a glosa formatada p/ o player 104 cSocket->write(glosaBff, size); //Envia a glosa formatada p/ o player
106 - usleep(1500); 105 + usleep(5000);
107 }catch(lavidlib::IOException &ex){ 106 }catch(lavidlib::IOException &ex){
108 throw lavidlib::RuntimeException("Erro ao enviar glosa"); 107 throw lavidlib::RuntimeException("Erro ao enviar glosa");
109 } 108 }