QtlMovie 1.12 (A specialized FFmpeg front-end)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
QtlMovieCleanupSubtitles Class Reference

A class to cleanup subtitles files. More...

Inheritance diagram for QtlMovieCleanupSubtitles:
QtlMovieAction QtlLogger

Public Member Functions

 QtlMovieCleanupSubtitles (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 Member Functions

 QtlMovieCleanupSubtitles () Q_DECL_EQ_DELETE
 

Private Attributes

QFile _inputFile
 Input file. More...
 
qint64 _nextReport
 Next byte index to indicate progress report. More...
 
QFile _outputFile
 Output file. More...
 
qint64 _readSize
 Number of bytes read so far. More...
 
qint64 _reportInterval
 Min number of bytes between two progress reports. More...
 
int _timerId
 Repetitive timer. More...
 
qint64 _totalSize
 Input file size. 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 cleanup subtitles files.

The cleanup operation removes all nul bytes into the file. It has been observed that some MKV files had ASS subtitles using metadata containing a trailing zero character. This invalid character broke ffmpeg and the subtitles were not burned into the video.

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

◆ QtlMovieCleanupSubtitles() [1/2]

QtlMovieCleanupSubtitles::QtlMovieCleanupSubtitles ( 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.

◆ QtlMovieCleanupSubtitles() [2/2]

QtlMovieCleanupSubtitles::QtlMovieCleanupSubtitles ( )
private

Member Function Documentation

◆ start()

bool QtlMovieCleanupSubtitles::start ( )
virtual

Start the processing.

Reimplemented from QtlMovieAction.

Returns
False if already started. True otherwise.

Reimplemented from QtlMovieAction.

◆ abort()

void QtlMovieCleanupSubtitles::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 QtlMovieCleanupSubtitles::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 QtlMovieCleanupSubtitles::timerEvent ( QTimerEvent *  event)
protectedvirtual

Event handler to handle timer.

Parameters
eventNotified event.

Member Data Documentation

◆ _inputFile

QFile QtlMovieCleanupSubtitles::_inputFile
private

Input file.

◆ _outputFile

QFile QtlMovieCleanupSubtitles::_outputFile
private

Output file.

◆ _timerId

int QtlMovieCleanupSubtitles::_timerId
private

Repetitive timer.

◆ _totalSize

qint64 QtlMovieCleanupSubtitles::_totalSize
private

Input file size.

◆ _readSize

qint64 QtlMovieCleanupSubtitles::_readSize
private

Number of bytes read so far.

◆ _reportInterval

qint64 QtlMovieCleanupSubtitles::_reportInterval
private

Min number of bytes between two progress reports.

◆ _nextReport

qint64 QtlMovieCleanupSubtitles::_nextReport
private

Next byte index to indicate progress report.


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