Go to the documentation of this file.
11 #include <QWaitCondition>
27 void run(
void)
override;
37 void run(
void)
override;
51 : m_filename(std::move(fname)), m_flags(flags), m_mode(mode) {}
55 bool ReOpen(
const QString& newFilename =
"");
57 long long Seek(
long long pos,
int whence);
58 int Write(
const void *data,
uint count);
60 void SetWriteBufferMinWriteSize(
uint newMinSize = kMinWriteSize);
62 void Sync(
void)
const;
64 bool SetBlocking(
bool block =
true);
70 void TrimEmptyBuffers(
void);
81 bool m_inDtor {
false};
82 bool m_ignoreWrites {
false};
83 uint m_tfwMinWriteSize {kMinWriteSize};
114 bool m_warned {
false};
115 bool m_blocking {
false};
116 bool m_registered {
false};
TFWSyncThread(ThreadedFileWriter *p)
~TFWWriteThread() override
ThreadedFileWriter(QString fname, int flags, mode_t mode)
Creates a threaded file writer.
QWaitCondition m_bufferWasFreed
bool WritesFailing(void) const
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
QWaitCondition m_bufferEmpty
QList< TFWBuffer * > m_emptyBuffers
void run(void) override
Runs ThreadedFileWriter::DiskLoop(void)
~TFWSyncThread() override
QList< TFWBuffer * > m_writeBuffers
QWaitCondition m_bufferSyncWait
static const uint kMaxBufferSize
This class supports the writing of recordings to disk.
TFWWriteThread(ThreadedFileWriter *p)
ThreadedFileWriter * m_parent
This is a wrapper around QThread that does several additional things.
QWaitCondition m_bufferHasData
void run(void) override
Runs ThreadedFileWriter::SyncLoop(void)
static const uint kMinWriteSize
Minimum to write to disk in a single write, when not flushing buffer.
static const uint kMaxBlockSize
Maximum block size to write at a time.
ThreadedFileWriter * m_parent