QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlSubStationAlphaFrame Class Reference

Description of a frame of Sub Station Alpha (SSA/ASS) subtitles. More...

Public Member Functions

 QtlSubStationAlphaFrame (const QString &definition=QString(), const QStringList &format=QStringList(), const QtlSubStationAlphaStyleMap &styles=QtlSubStationAlphaStyleMap())
 Constructor. More...
 
QString getInfo (const QString &name, const QString &defaultValue=QString()) const
 Get one field of the dialog. More...
 
quint64 hideTimestamp () const
 Hide frame at this timestamp (in ms from start of stream). More...
 
quint64 showTimestamp () const
 Show frame at this timestamp (in ms from start of stream). More...
 
QString text () const
 The text of this subtitle frame in SSA/ASS format. More...
 
QStringList toSubRip (bool useHtmlTags=true) const
 Convert the text of this subtitle frame in SubRip format. More...
 

Static Private Member Functions

static QString rgbToSubRip (quint32 color)
 Convert a color code in RGB format into a SubRip color specification. More...
 
static quint64 toTimestamp (const QString &value)
 Convert an SSA/ASS timestamp specification to a value in milliseconds. More...
 

Private Attributes

quint64 _end
 Hide frame at this timestamp (in ms from start of stream). More...
 
QMap< QString, QString > _info
 Map of info, using normalized names as keys. More...
 
quint64 _start
 Show frame at this timestamp (in ms from start of stream). More...
 
QtlSubStationAlphaStylePtr _style
 Style to apply to _text. More...
 
QString _text
 Subtitle text, in SSA/ASS format. More...
 

Detailed Description

Description of a frame of Sub Station Alpha (SSA/ASS) subtitles.

Constructor & Destructor Documentation

◆ QtlSubStationAlphaFrame()

QtlSubStationAlphaFrame::QtlSubStationAlphaFrame ( const QString &  definition = QString(),
const QStringList &  format = QStringList(),
const QtlSubStationAlphaStyleMap styles = QtlSubStationAlphaStyleMap() 
)

Constructor.

Parameters
[in]definitionDefinition the frame as in a "Dialogue:" line in a SSA/ASS file.
[in]formatList of style fields, as in a "Format:" line, with normalized names.
[in]stylesMap of style definitions, using normalized names as key.

Member Function Documentation

◆ getInfo()

QString QtlSubStationAlphaFrame::getInfo ( const QString &  name,
const QString &  defaultValue = QString() 
) const

Get one field of the dialog.

Parameters
[in]nameField name, as specified in the "Format:" line.
[in]defaultValueDefault value if the field is not found.
Returns
The field value as a string.

◆ showTimestamp()

quint64 QtlSubStationAlphaFrame::showTimestamp ( ) const
inline

Show frame at this timestamp (in ms from start of stream).

Returns
The start time in milliseconds.

◆ hideTimestamp()

quint64 QtlSubStationAlphaFrame::hideTimestamp ( ) const
inline

Hide frame at this timestamp (in ms from start of stream).

Returns
The end time in milliseconds.

◆ text()

QString QtlSubStationAlphaFrame::text ( ) const
inline

The text of this subtitle frame in SSA/ASS format.

Returns
The text of this subtitle frame in SSA/ASS format.

◆ toSubRip()

QStringList QtlSubStationAlphaFrame::toSubRip ( bool  useHtmlTags = true) const

Convert the text of this subtitle frame in SubRip format.

Parameters
[in]useHtmlTagsIf true, add the HTML SubRip extensions.
Returns
The text of this subtitle frame in SubRip format. Never empty, there is at least one string.

◆ toTimestamp()

quint64 QtlSubStationAlphaFrame::toTimestamp ( const QString &  value)
staticprivate

Convert an SSA/ASS timestamp specification to a value in milliseconds.

Parameters
[in]valueSSA/ASS timestamp specification.
Returns
Value in milliseconds or 0 if incorrect.

◆ rgbToSubRip()

QString QtlSubStationAlphaFrame::rgbToSubRip ( quint32  color)
staticprivate

Convert a color code in RGB format into a SubRip color specification.

Parameters
[in]colorColor code in RGB format.
Returns
Corresponding SubRip color specification.

Member Data Documentation

◆ _text

QString QtlSubStationAlphaFrame::_text
private

Subtitle text, in SSA/ASS format.

◆ _style

QtlSubStationAlphaStylePtr QtlSubStationAlphaFrame::_style
private

Style to apply to _text.

◆ _start

quint64 QtlSubStationAlphaFrame::_start
private

Show frame at this timestamp (in ms from start of stream).

◆ _end

quint64 QtlSubStationAlphaFrame::_end
private

Hide frame at this timestamp (in ms from start of stream).

◆ _info

QMap<QString,QString> QtlSubStationAlphaFrame::_info
private

Map of info, using normalized names as keys.


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