subtitle.h 2.04 KB
/**
 * \file subtitle.h
 *
 * \author Leonardo de Araújo Domingues <leonardo.araujo@lavid.ufpb.br>
 * \date 24/10/2015
 */

 #ifndef SUBTITLE_H
 #define SUBTITLE_H

 #include <string>
 #include <stdint.h>
 #include <stdio.h>

 #define MAX_FIELD 64

 using namespace std;

 namespace sndesc {

	/** \brief Representação abstrata de legendas.
	 * 
	 * Objetos com informações de legendas
	 * são implementados através desta classe.
	 * \headerfile extrator/src/include/subtitle.h
	 */
	class Subtitle {

	public:
		/** Construtor */
		Subtitle();

		/** Construtor.
		*
	 	* \param _id Número da legenda.
	 	* \param _sub_text Texto da legenda.
	 	* \param _timein Tempo de inicio da legenda.
	 	* \param _timeout Tempo de termino da legenda.
	 	*/
	 	Subtitle(int _id, string _sub_text, int64_t _timein, int64_t _timeout);

	 	/** Destrutor */
	 	~Subtitle();

	 	/** Seta o id da legenda.
	 	* 
	 	* \param _id O numero da legenda.
	 	*/
	 	void setID(int _id);

	 	/** Seta o texto da legenda.
	 	* 
	 	* \param _subtext O texto da legenda.
	 	*/
	 	void setSubtitleText(std::string _subtext);

	 	/** Seta o tempo de inicio da legenda.
	 	* 
	 	* \param _timein O tempo de entrada da legenda.
	 	*/
	 	void setTimeIn(int64_t _timein);

	 	/** Seta o tempo de termino da legenda.
	 	* 
	 	* \param _timeout O tempo de saida da legenda.
	 	*/
	 	void setTimeOut(int64_t _timeout);

	 	/** Obtém o texto da legenda.
	 	* 
	 	* \return O texto da legenda.
	 	*/
	 	std::string getSubtitleText();

	 	/** Obtém o tempo de inicio da legenda.
	 	* 
	 	* \return O tempo de inicio.
	 	*/
	 	int64_t getTimeIn();

	 	/** Obtém o tempo de termino da legenda.
	 	* 
	 	* \return O tempo de termino.
	 	*/
	 	int64_t getTimeOut();

	 	/** Obtém o id da legenda.
	 	* 
	 	* \return O numero da legenda.
	 	*/
	 	int getID();

	 	/** Converte os dados de uma legenda em uma string.
	 	* 
	 	* \return Uma string com a representação da legenda.
	 	*/
	 	string toString();

	private:

	 	int id;
	 	int64_t time_in;
	 	int64_t time_out;
	 	string subtitle_text;
	};
}

#endif /* SUBTITLE_H */