3#include <NDEVR/TimeSpan.h>
4#include <NDEVR/BufferedScanner.h>
The equivelent of std::vector but with a bit more control.
Implentation of Scanner, however all data is cached.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
String currentText(const TimeSpan ¤t) const
Returns the subtitle text that should be displayed at the given time.
TimeSpan convertFromString(const StringView &string)
Converts a timestamp string from the subtitle file into a TimeSpan.
SubtitleFileReader(const File &file)
Constructs a SubtitleFileReader that reads from the given file.
void readText()
Parses and loads all subtitle entries from the file.
Buffer< std::pair< Vector< 2, TimeSpan >, String > > m_subtitles
Parsed subtitle entries with start/end times and text.
BufferedScanner m_scanner
Buffered file scanner for reading the subtitle file.
String m_last_text
The most recently added subtitle text.
void addSubtitle(const String &text)
Adds a subtitle entry with the given text at the current time.
Time m_last_subtitle_start
The start time of the most recent subtitle.
void writeText()
Writes any pending subtitle text to the file.
void setStartTime(Time time)
Sets the start time offset for the subtitle file.
SubtitleFileWriter(const File &file)
Constructs a SubtitleFileWriter that writes to the given file.
uint04 m_text_index
The sequential index of the next subtitle entry.
void setCurrentTime(Time span)
Sets the current playback time for timestamping subtitles.
File m_file
The output subtitle file.
Time m_start_time
The start time offset for the file.
Time m_current_time
The current playback time.
void finish(File file)
Finishes writing and finalizes the subtitle file.
Stores a time span, or difference between two times, with an optional start time.
Represents a timestamp with utilities for manipulation and conversion.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...