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

A class to pull data from a list of files into an asynchronous device such as QProcess. More...

Inheritance diagram for QtlFileDataPull:
QtlDataPull

Public Member Functions

 QtlFileDataPull (const QStringList &fileNames, int transferSize=DEFAULT_TRANSFER_SIZE, int minBufferSize=DEFAULT_MIN_BUFFER_SIZE, QtlLogger *log=0, QObject *parent=0)
 Constructor using a list of files. More...
 
 QtlFileDataPull (const QtlFileSlicesPtrList &files=QtlFileSlicesPtrList(), int transferSize=DEFAULT_TRANSFER_SIZE, int minBufferSize=DEFAULT_MIN_BUFFER_SIZE, QtlLogger *log=0, QObject *parent=0)
 Constructor using a list of file slices. More...
 
- Public Member Functions inherited from QtlDataPull
 QtlDataPull (int minBufferSize=DEFAULT_MIN_BUFFER_SIZE, QtlLogger *log=0, QObject *parent=0)
 Constructor. More...
 
virtual ~QtlDataPull ()
 Destructor. More...
 
bool isStarted () const
 Check if the data transfer is started. More...
 
QtlLoggerlog () const
 Get the message logger. More...
 
bool progressAvailable () const
 Check if progress report is meaningful. More...
 
qint64 pulledSize () const
 Get the total size of all pulled data. More...
 
void setAutoDelete (bool on)
 Set automatic object deletion on transfer completion. More...
 
void setMaxPulledSize (qint64 size)
 Set the maximum number of bytes to pull. More...
 
void setProgressIntervalInBytes (qint64 size)
 Set the interval between two emissions of progress(). More...
 
void setProgressMaxHint (qint64 size)
 Set the probable ("hint") total size of the transfer. More...
 

Static Public Attributes

static const int DEFAULT_TRANSFER_SIZE = 1024 * 1024
 Default transfer size in bytes (1 MB). More...
 
- Static Public Attributes inherited from QtlDataPull
static const int DEFAULT_MIN_BUFFER_SIZE = 128 * 1024
 Default minimum buffer size in bytes (128 kB). More...
 

Protected Member Functions

virtual void cleanupTransfer (bool clean) Q_DECL_OVERRIDE
 Cleanup the transfer. More...
 
virtual bool initializeTransfer () Q_DECL_OVERRIDE
 Initialize the transfer. More...
 
virtual bool needTransfer (qint64 maxSize) Q_DECL_OVERRIDE
 Invoked when more data is needed. More...
 
- Protected Member Functions inherited from QtlDataPull
void close ()
 Properly terminate the transfer. More...
 
bool write (const void *data, int dataSize)
 Write data to all devices. More...
 

Static Private Member Functions

static QtlFileSlicesPtrList toFileSlicesList (const QStringList &fileNames)
 Convert a list of file names into a list of file slices. More...
 

Private Attributes

QtlByteBlock _buffer
 Transfer buffer. More...
 
QtlFileSlicesPtrList::ConstIterator _current
 Current file. More...
 
QtlFileSlicesPtrList _files
 Input files. More...
 

Additional Inherited Members

- Public Slots inherited from QtlDataPull
bool start (QIODevice *device)
 Start to transfer data into the specified device. More...
 
bool start (const QList< QIODevice *> &devices)
 Start to transfer data into the several devices in parallel. More...
 
void stop ()
 Force a premature stop of the data transfer. More...
 
void stopCaller ()
 This slot stops the transfer on the device which sent the signal. More...
 
void stopDevice (QIODevice *device)
 Stop the transfer on the specified device. More...
 
- Signals inherited from QtlDataPull
void completed (bool success)
 Emitted when the transfer is completed on all devices. More...
 
void deviceCompleted (QIODevice *device, bool success)
 Emitted when the transfer is completed on one device. More...
 
void progress (qint64 current, qint64 maximum)
 Emitted when some progress in the data transfer is available. More...
 
void started ()
 Emitted when the transfer is started. More...
 

Detailed Description

A class to pull data from a list of files into an asynchronous device such as QProcess.

See also
QtlDataPull

Constructor & Destructor Documentation

◆ QtlFileDataPull() [1/2]

QtlFileDataPull::QtlFileDataPull ( const QStringList &  fileNames,
int  transferSize = DEFAULT_TRANSFER_SIZE,
int  minBufferSize = DEFAULT_MIN_BUFFER_SIZE,
QtlLogger log = 0,
QObject *  parent = 0 
)
explicit

Constructor using a list of files.

Progress reporting is automatically enabled.

Parameters
[in]fileNamesList of files to transfer. They are concatenated on the destination.
[in]transferSizeData transfer size in bytes.
[in]minBufferSizeThe minimum buffer size is the lower limit of the buffered data. When the amount of data not yet written to the device is lower than this size, new data is pulled from the DVD.
[in]logOptional message logger.
[in]parentOptional parent object.

◆ QtlFileDataPull() [2/2]

QtlFileDataPull::QtlFileDataPull ( const QtlFileSlicesPtrList files = QtlFileSlicesPtrList(),
int  transferSize = DEFAULT_TRANSFER_SIZE,
int  minBufferSize = DEFAULT_MIN_BUFFER_SIZE,
QtlLogger log = 0,
QObject *  parent = 0 
)
explicit

Constructor using a list of file slices.

Progress reporting is automatically enabled.

Parameters
[in]filesList of slices of files to transfer. They are concatenated on the destination.
[in]transferSizeData transfer size in bytes.
[in]minBufferSizeThe minimum buffer size is the lower limit of the buffered data. When the amount of data not yet written to the device is lower than this size, new data is pulled from the DVD.
[in]logOptional message logger.
[in]parentOptional parent object.

Member Function Documentation

◆ initializeTransfer()

bool QtlFileDataPull::initializeTransfer ( )
protectedvirtual

Initialize the transfer.

Reimplemented from QtlDataPull.

Returns
True on success, false on error.

Reimplemented from QtlDataPull.

◆ needTransfer()

bool QtlFileDataPull::needTransfer ( qint64  maxSize)
protectedvirtual

Invoked when more data is needed.

Reimplemented from QtlDataPull.

Parameters
[in]maxSizeMaximum size in bytes of the requested transfer.
Returns
True on success, false on error.

Implements QtlDataPull.

◆ cleanupTransfer()

void QtlFileDataPull::cleanupTransfer ( bool  clean)
protectedvirtual

Cleanup the transfer.

Reimplemented from QtlDataPull.

Parameters
[in]cleanIf true, this is a clean termination.

Reimplemented from QtlDataPull.

◆ toFileSlicesList()

QtlFileSlicesPtrList QtlFileDataPull::toFileSlicesList ( const QStringList &  fileNames)
staticprivate

Convert a list of file names into a list of file slices.

Parameters
[in]fileNamesList of file names.
Returns
A list of file slices.

Member Data Documentation

◆ DEFAULT_TRANSFER_SIZE

const int QtlFileDataPull::DEFAULT_TRANSFER_SIZE = 1024 * 1024
static

Default transfer size in bytes (1 MB).

◆ _files

QtlFileSlicesPtrList QtlFileDataPull::_files
private

Input files.

◆ _current

QtlFileSlicesPtrList::ConstIterator QtlFileDataPull::_current
private

Current file.

◆ _buffer

QtlByteBlock QtlFileDataPull::_buffer
private

Transfer buffer.


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