4 #include "workerthread.h"
6 WorkerThread::WorkerThread(QObject
*parent
, QQueue
<float> *pData
)
9 qDebug("WorkerThread::WorkerThread()");
11 // Initialize random generator here
14 m_file
.setFileName("foo.dat");
15 m_file
.open(QIODevice::ReadOnly
);
16 in
.setDevice(&m_file
);
23 WorkerThread::~WorkerThread()
25 qDebug("WorkerThread::~WorkerThread()");
37 void WorkerThread::run(void)
41 qDebug("WorkerThread::run()");
46 if (pData
->size() >= 667) {
48 condition
.wait(&mutex
);
59 void WorkerThread::setData(QQueue
<float> *pData
)
61 qDebug("WorkerThread::setData()");
66 void WorkerThread::setFileName(QString fileName
)
68 qDebug("WorkerThread::setFileName()");
73 // Caution: discard all old data in QQueue
74 // Worst case scenario if you don't: frame read corruption
78 m_file
.setFileName(fileName
);
79 m_file
.open(QIODevice::ReadOnly
);
80 in
.setDevice(&m_file
);