/*************************************************************************** * Universidade Federal da Paraíba * * Copyright (C) 2013 by Laboratório de Aplicações de Vídeo Digital * * * * Centro de Informática - UFPB - Campus I * * João Pessoa - PB - Brasil * * * * Author: Leonardo de Araújo Domingues (leonardo.araujo@lavid.ufpb.br) * * Date: Qui Out 24 22:31:50 BRT 2013 * * * **************************************************************************/ #include "subtitle.h" namespace sndesc { Subtitle::Subtitle() { //TODO: default parameters! } Subtitle::Subtitle (int _id, string _sub_text, int64_t _timein, int64_t _timeout) { int id = _id; subtitle_text = _sub_text; time_in = _timein; time_out = _timeout; } Subtitle::~Subtitle() { //TODO: delete objects and free memory } void Subtitle::setID(int _id) { id = _id; } int Subtitle::getID() { return id; } void Subtitle::setSubtitleText(string _subtext) { subtitle_text = _subtext; } void Subtitle::setTimeIn(int64_t _timein) { time_in = _timein; } void Subtitle::setTimeOut(int64_t _timeout) { time_out = _timeout; } std::string Subtitle::getSubtitleText() { return subtitle_text; } int64_t Subtitle::getTimeIn() { return time_in; } int64_t Subtitle::getTimeOut() { return time_out; } string Subtitle::toString() { string subtitle_str; char buffer [MAX_FIELD]; sprintf(buffer, "%d", id); subtitle_str.append("\n{id: ").append((string)buffer); sprintf(buffer, "%ld", time_in); subtitle_str.append(", time_in: ").append((string)buffer); sprintf(buffer, "%ld", time_out); subtitle_str.append(", time_out: ").append((string)buffer); subtitle_str.append(", text: ").append(subtitle_text).append("}\n"); return subtitle_str; } }