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

A class to subtitles files from SSA/ASS to SRT format. More...

Inheritance diagram for QtlMovieConvertSubStationAlpha:
QtlMovieAction QtlLogger

Public Member Functions

 QtlMovieConvertSubStationAlpha (const QString &inputFileName, const QString &outputFileName, const QtlMovieSettings *settings, QtlLogger *log, QObject *parent=0)
 Constructor. More...
 
virtual void abort () Q_DECL_OVERRIDE
 Abort the processing. More...
 
virtual bool start () Q_DECL_OVERRIDE
 Start the processing. More...
 
- Public Member Functions inherited from QtlMovieAction
 QtlMovieAction (const QtlMovieSettings *settings, QtlLogger *log, QObject *parent=0)
 Constructor. More...
 
virtual ~QtlMovieAction ()
 Virtual destructor. More...
 
virtual void debug (const QString &line, const QColor &color=QColor()) Q_DECL_OVERRIDE
 Log a line of debug text. More...
 
QString description () const
 Get the description of the action. More...
 
int elapsedSeconds () const
 Get the number of seconds since the action started. More...
 
bool isCompleted () const
 Check if the action is completed. More...
 
bool isSilent () const
 Check if unimportant messages are skipped. More...
 
bool isStarted () const
 Check if the action was started (and possibly completed in the meantime). More...
 
virtual void line (const QString &line, const QColor &color=QColor()) Q_DECL_OVERRIDE
 Log a line of text. More...
 
void setDescription (const QString &description)
 Set the description of the action. More...
 
void setSilent (bool silent)
 Set if unimportant messages are skipped. More...
 
const QtlMovieSettingssettings () const
 Get the application settings. More...
 
virtual void text (const QString &text) Q_DECL_OVERRIDE
 Log text. More...
 

Protected Member Functions

virtual void emitCompleted (bool success, const QString &message=QString()) Q_DECL_OVERRIDE
 Emit the completed() signal. More...
 
virtual void timerEvent (QTimerEvent *event) Q_DECL_OVERRIDE
 Event handler to handle timer. More...
 
- Protected Member Functions inherited from QtlMovieAction
virtual void emitProgress (int current, int maximum, int remainingSeconds=-1)
 Emit the progress() signal. More...
 

Private Slots

void processSubtitleFrame (const QtlSubStationAlphaFramePtr &frame)
 Invoked when a subtitle frame is available. More...
 

Private Member Functions

 QtlMovieConvertSubStationAlpha () Q_DECL_EQ_DELETE
 

Private Attributes

QFile _inputFile
 Input file. More...
 
QtlSubStationAlphaParser _inputParser
 SSA/ASS parser. More...
 
QTextStream _inputStream
 Text stream for input file. More...
 
qint64 _nextReport
 Next byte index to indicate progress report. More...
 
QtlSubRipGenerator _outputFile
 Output file. More...
 
QString _outputFileName
 Output file name. More...
 
qint64 _reportInterval
 Min number of bytes between two progress reports. More...
 
int _timerId
 Repetitive timer. More...
 
qint64 _totalSize
 Input file size. More...
 
bool _useHtml
 Add HTML tags in SRT subtitles. More...
 

Additional Inherited Members

- Signals inherited from QtlMovieAction
void completed (bool success)
 Emitted when the action completes. More...
 
void progress (const QString &description, int current, int maximum, int elapsedSeconds, int remainingSeconds)
 Emitted when some progress in the reporting is available. More...
 
void started ()
 Emitted when the action starts. More...
 

Detailed Description

A class to subtitles files from SSA/ASS to SRT format.

The file processing is not a blocking operation. When start() is invoked, the file is not synchronously read. The Qt event loop invokes the appropriate slots when data is available from the file. The completion is notified using the signal completed(), inherited from QtlMovieAction.

Constructor & Destructor Documentation

◆ QtlMovieConvertSubStationAlpha() [1/2]

QtlMovieConvertSubStationAlpha::QtlMovieConvertSubStationAlpha ( const QString &  inputFileName,
const QString &  outputFileName,
const QtlMovieSettings settings,
QtlLogger log,
QObject *  parent = 0 
)

Constructor.

Parameters
[in]inputFileNameInput file name.
[in]outputFileNameOutput file name.
[in]settingsApplication settings.
[in]logWhere to log errors.
[in]parentOptional parent object.

◆ QtlMovieConvertSubStationAlpha() [2/2]

QtlMovieConvertSubStationAlpha::QtlMovieConvertSubStationAlpha ( )
private

Member Function Documentation

◆ start()

bool QtlMovieConvertSubStationAlpha::start ( )
virtual

Start the processing.

Reimplemented from QtlMovieAction.

Returns
False if already started. True otherwise.

Reimplemented from QtlMovieAction.

◆ abort()

void QtlMovieConvertSubStationAlpha::abort ( )
virtual

Abort the processing.

Reimplemented from QtlMovieAction. If the processing is in progress, the signal completed() will be emitted.

Reimplemented from QtlMovieAction.

◆ emitCompleted()

void QtlMovieConvertSubStationAlpha::emitCompleted ( bool  success,
const QString &  message = QString() 
)
protectedvirtual

Emit the completed() signal.

Reimplemented from QtlMovieAction.

Parameters
[in]successTrue when the action completed successfully, false otherwise.
[in]messageOptional error message to log.

Reimplemented from QtlMovieAction.

◆ timerEvent()

void QtlMovieConvertSubStationAlpha::timerEvent ( QTimerEvent *  event)
protectedvirtual

Event handler to handle timer.

Parameters
eventNotified event.

◆ processSubtitleFrame

void QtlMovieConvertSubStationAlpha::processSubtitleFrame ( const QtlSubStationAlphaFramePtr frame)
privateslot

Invoked when a subtitle frame is available.

Parameters
[in]frameSSA/ASS subtitle frame.

Member Data Documentation

◆ _inputFile

QFile QtlMovieConvertSubStationAlpha::_inputFile
private

Input file.

◆ _inputStream

QTextStream QtlMovieConvertSubStationAlpha::_inputStream
private

Text stream for input file.

◆ _inputParser

QtlSubStationAlphaParser QtlMovieConvertSubStationAlpha::_inputParser
private

SSA/ASS parser.

◆ _outputFile

QtlSubRipGenerator QtlMovieConvertSubStationAlpha::_outputFile
private

Output file.

◆ _outputFileName

QString QtlMovieConvertSubStationAlpha::_outputFileName
private

Output file name.

◆ _useHtml

bool QtlMovieConvertSubStationAlpha::_useHtml
private

Add HTML tags in SRT subtitles.

◆ _timerId

int QtlMovieConvertSubStationAlpha::_timerId
private

Repetitive timer.

◆ _totalSize

qint64 QtlMovieConvertSubStationAlpha::_totalSize
private

Input file size.

◆ _reportInterval

qint64 QtlMovieConvertSubStationAlpha::_reportInterval
private

Min number of bytes between two progress reports.

◆ _nextReport

qint64 QtlMovieConvertSubStationAlpha::_nextReport
private

Next byte index to indicate progress report.


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