serviceWindowGenerationFromSRT.h 1.36 KB
#ifndef SERVICEWINDOWGENERATIONFROMSRT_H
#define SERVICEWINDOWGENERATIONFROMSRT_H

#include "listenerSRT.h"
#include "extratorFactory.h"
#include "serviceWindowGeneration.h"

#define SERVICE_TYPE_SRT 1
#define SERVICE_TYPE_SRT_ONLY 4

class ServiceWindowGenerationFromSRT : public ServiceWindowGeneration, public ListenerSRT, public ListenerTradutor, public Thread {

private:
	ExtratorFactory* extrator_factory;
	ExtratorSRT* extratorSRT;

	char* path_srt;

    void addPTS(int64_t pts);
    void setSizeOfSubtitles(int sub_size);
    void setPathContents();

    void connectToUnity();
    void sendGlosa(string glosa);
    void waitVideoGeneration();

    bool isRunning();
public:
    //construtor de serviço de video e legenda
    ServiceWindowGenerationFromSRT(char* pathVideo, char* pathSRT, int sublanguage, int pos,
    	int size, int transp, char* id, char* client, int serviceType);
    //construtor de serviço de somente legenda
    ServiceWindowGenerationFromSRT(char* pathSRT, int transparency, char* id, char* client, int serviceType);
    ~ServiceWindowGenerationFromSRT();

	void notifySubtitle(unsigned char* subtitle, int64_t pts);
    void notifyTranslation(vector<string>* glosas);
	void notifyTranslator(unsigned char* text);
    void notifyEnd(int sub_size);

    void initialize();
    bool isFinished();
    void Run();
};

#endif /* SERVICEWINDOWGENERATIONFROMSRT_H_ */