NDEVR
API Documentation
SubtitleFileWriter

Class which can be used to write a subtitle in real time to a file, which can be played back alongside a video being recorded concurrently. More...

Collaboration diagram for SubtitleFileWriter:
[legend]

Public Member Functions

 SubtitleFileWriter (const File &file)
 Constructs a SubtitleFileWriter that writes to the given file.
void addSubtitle (const String &text)
 Adds a subtitle entry with the given text at the current time.
void finish (File file)
 Finishes writing and finalizes the subtitle file.
void setCurrentTime (Time span)
 Sets the current playback time for timestamping subtitles.
void setStartTime (Time time)
 Sets the start time offset for the subtitle file.
void writeText ()
 Writes any pending subtitle text to the file.

Protected Attributes

Time m_current_time
 The current playback time.
File m_file
 The output subtitle file.
Time m_last_subtitle_start
 The start time of the most recent subtitle.
String m_last_text
 The most recently added subtitle text.
Time m_start_time
 The start time offset for the file.
uint04 m_text_index = 0
 The sequential index of the next subtitle entry.

Detailed Description

Class which can be used to write a subtitle in real time to a file, which can be played back alongside a video being recorded concurrently.


Definition at line 11 of file SubtitleFile.h.

Constructor & Destructor Documentation

◆ SubtitleFileWriter()

SubtitleFileWriter::SubtitleFileWriter ( const File & file)

Constructs a SubtitleFileWriter that writes to the given file.

Parameters
[in]fileThe output subtitle file.

Member Function Documentation

◆ addSubtitle()

void SubtitleFileWriter::addSubtitle ( const String & text)

Adds a subtitle entry with the given text at the current time.

Parameters
[in]textThe subtitle text to add.

◆ finish()

void SubtitleFileWriter::finish ( File file)

Finishes writing and finalizes the subtitle file.

Parameters
[in]fileThe file to finalize.

◆ setCurrentTime()

void SubtitleFileWriter::setCurrentTime ( Time span)

Sets the current playback time for timestamping subtitles.

Parameters
[in]spanThe current time.

◆ setStartTime()

void SubtitleFileWriter::setStartTime ( Time time)

Sets the start time offset for the subtitle file.

Parameters
[in]timeThe start time.

The documentation for this class was generated from the following file: