37 m_ifstream(samplesStream),
42 m_sampleFifo(sampleFifo),
45 m_fileInputMessageQueue(fileInputMessageQueue),
50 m_throttleToggle(false)
52 assert(m_ifstream != 0);
72 qDebug() <<
"FileInputThread::startWork: ";
76 qDebug() <<
"FileInputThread::startWork: file stream open, starting...";
83 connect(&
m_timer, SIGNAL(timeout()),
this, SLOT(
tick()));
87 qDebug() <<
"FileInputThread::startWork: file stream closed, not starting.";
93 qDebug() <<
"FileInputThread::stopWork";
94 disconnect(&
m_timer, SIGNAL(timeout()),
this, SLOT(
tick()));
101 qDebug() <<
"FileInputThread::setSampleRateAndSize:" 102 <<
" new rate:" << samplerate
103 <<
" new size:" << samplesize
107 if ((samplerate !=
m_samplerate) || (samplesize != m_samplesize))
114 m_samplesize = samplesize;
133 qDebug() <<
"FileInputThread::setBuffers: Allocate file buffer";
138 qDebug() <<
"FileInputThread::setBuffers: Re-allocate file buffer";
146 qDebug() <<
"FileInputThread::setBuffers: Allocate conversion buffer";
151 qDebug() <<
"FileInputThread::setBuffers: Re-allocate conversion buffer";
157 qDebug() <<
"FileInputThread::setBuffers: size: " <<
m_bufsize 158 <<
" #samples: " << nbSamples;
220 for (
int is = 0; is < nbSamples; is++)
222 convertBuf[2*is] = fileBuf[2*is] << 8;
223 convertBuf[2*is+1] = fileBuf[2*is+1] << 8;
241 for (
int is = 0; is < nbSamples; is++)
243 convertBuf[2*is] = fileBuf[2*is] >> 8;
244 convertBuf[2*is+1] = fileBuf[2*is+1] >> 8;
void push(Message *message, bool emitSignal=true)
Push message onto queue.
uint write(const quint8 *data, uint count)
#define MESSAGE_CLASS_DEFINITION(Name, BaseClass)