SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
#include <fileinputthread.h>
Inherits QThread.
Classes | |
class | MsgReportEOF |
Public Member Functions | |
FileInputThread (std::ifstream *samplesStream, SampleSinkFifo *sampleFifo, const QTimer &timer, MessageQueue *fileInputMessageQueue, QObject *parent=NULL) | |
~FileInputThread () | |
void | startWork () |
void | stopWork () |
void | setSampleRateAndSize (int samplerate, quint32 samplesize) |
void | setBuffers (std::size_t chunksize) |
bool | isRunning () const |
quint64 | getSamplesCount () const |
void | setSamplesCount (quint64 samplesCount) |
Private Slots | |
void | tick () |
Private Member Functions | |
void | run () |
void | writeToSampleFifo (const quint8 *buf, qint32 nbBytes) |
Private Attributes | |
QMutex | m_startWaitMutex |
QWaitCondition | m_startWaiter |
volatile bool | m_running |
std::ifstream * | m_ifstream |
quint8 * | m_fileBuf |
quint8 * | m_convertBuf |
std::size_t | m_bufsize |
qint64 | m_chunksize |
SampleSinkFifo * | m_sampleFifo |
quint64 | m_samplesCount |
const QTimer & | m_timer |
MessageQueue * | m_fileInputMessageQueue |
int | m_samplerate |
File I/Q stream original sample rate. More... | |
quint64 | m_samplesize |
File effective sample size in bits (I or Q). Ex: 16, 24. More... | |
quint64 | m_samplebytes |
Number of bytes used to store a I or Q sample. Ex: 2. 4. More... | |
qint64 | m_throttlems |
QElapsedTimer | m_elapsedTimer |
bool | m_throttleToggle |
Definition at line 38 of file fileinputthread.h.
FileInputThread::FileInputThread | ( | std::ifstream * | samplesStream, |
SampleSinkFifo * | sampleFifo, | ||
const QTimer & | timer, | ||
MessageQueue * | fileInputMessageQueue, | ||
QObject * | parent = NULL |
||
) |
Definition at line 30 of file fileinputthread.cpp.
Referenced by FileInputThread::MsgReportEOF::MsgReportEOF().
FileInputThread::~FileInputThread | ( | ) |
Definition at line 55 of file fileinputthread.cpp.
References m_convertBuf, m_fileBuf, m_running, and stopWork().
Referenced by FileInputThread::MsgReportEOF::MsgReportEOF().
|
inline |
Definition at line 68 of file fileinputthread.h.
References m_samplesCount.
Referenced by FileInput::handleMessage(), and FileInput::webapiFormatDeviceReport().
|
inline |
Definition at line 67 of file fileinputthread.h.
References m_running.
Referenced by FileInput::seekFileStream().
|
private |
void FileInputThread::setBuffers | ( | std::size_t | chunksize | ) |
Definition at line 124 of file fileinputthread.cpp.
References m_bufsize, m_convertBuf, m_fileBuf, and m_samplebytes.
Referenced by FileInputThread::MsgReportEOF::MsgReportEOF(), setSampleRateAndSize(), and tick().
void FileInputThread::setSampleRateAndSize | ( | int | samplerate, |
quint32 | samplesize | ||
) |
Definition at line 99 of file fileinputthread.cpp.
References m_chunksize, m_running, m_samplebytes, m_samplerate, m_samplesize, m_throttlems, setBuffers(), and stopWork().
Referenced by FileInput::applySettings(), FileInputThread::MsgReportEOF::MsgReportEOF(), and FileInput::start().
|
inline |
Definition at line 69 of file fileinputthread.h.
References m_samplesCount.
Referenced by FileInput::seekFileStream().
void FileInputThread::startWork | ( | ) |
Definition at line 70 of file fileinputthread.cpp.
References m_elapsedTimer, m_ifstream, m_running, m_startWaiter, m_startWaitMutex, m_timer, and tick().
Referenced by FileInput::handleMessage(), FileInputThread::MsgReportEOF::MsgReportEOF(), and FileInput::start().
void FileInputThread::stopWork | ( | ) |
Definition at line 91 of file fileinputthread.cpp.
References m_running, m_timer, and tick().
Referenced by FileInput::handleMessage(), FileInputThread::MsgReportEOF::MsgReportEOF(), setSampleRateAndSize(), FileInput::stop(), and ~FileInputThread().
|
privateslot |
Definition at line 175 of file fileinputthread.cpp.
References FileInputThread::MsgReportEOF::create(), m_chunksize, m_elapsedTimer, m_fileBuf, m_fileInputMessageQueue, m_ifstream, m_running, m_samplebytes, m_samplerate, m_samplesCount, m_throttlems, m_throttleToggle, MessageQueue::push(), setBuffers(), and writeToSampleFifo().
Referenced by startWork(), and stopWork().
|
private |
Definition at line 206 of file fileinputthread.cpp.
References m_convertBuf, m_samplebytes, m_sampleFifo, m_samplesize, SDR_RX_SAMP_SZ, and SampleSinkFifo::write().
Referenced by tick().
|
private |
Definition at line 79 of file fileinputthread.h.
Referenced by setBuffers().
|
private |
Definition at line 80 of file fileinputthread.h.
Referenced by setSampleRateAndSize(), and tick().
|
private |
Definition at line 78 of file fileinputthread.h.
Referenced by setBuffers(), writeToSampleFifo(), and ~FileInputThread().
|
private |
Definition at line 90 of file fileinputthread.h.
Referenced by startWork(), and tick().
|
private |
Definition at line 77 of file fileinputthread.h.
Referenced by setBuffers(), tick(), and ~FileInputThread().
|
private |
Definition at line 84 of file fileinputthread.h.
Referenced by tick().
|
private |
Definition at line 76 of file fileinputthread.h.
Referenced by startWork(), and tick().
|
private |
Definition at line 74 of file fileinputthread.h.
Referenced by isRunning(), run(), setSampleRateAndSize(), startWork(), stopWork(), tick(), and ~FileInputThread().
|
private |
Number of bytes used to store a I or Q sample. Ex: 2. 4.
Definition at line 88 of file fileinputthread.h.
Referenced by setBuffers(), setSampleRateAndSize(), tick(), and writeToSampleFifo().
|
private |
Definition at line 81 of file fileinputthread.h.
Referenced by writeToSampleFifo().
|
private |
File I/Q stream original sample rate.
Definition at line 86 of file fileinputthread.h.
Referenced by setSampleRateAndSize(), and tick().
|
private |
Definition at line 82 of file fileinputthread.h.
Referenced by getSamplesCount(), setSamplesCount(), and tick().
|
private |
File effective sample size in bits (I or Q). Ex: 16, 24.
Definition at line 87 of file fileinputthread.h.
Referenced by setSampleRateAndSize(), and writeToSampleFifo().
|
private |
Definition at line 73 of file fileinputthread.h.
Referenced by run(), and startWork().
|
private |
Definition at line 72 of file fileinputthread.h.
Referenced by startWork().
|
private |
Definition at line 89 of file fileinputthread.h.
Referenced by setSampleRateAndSize(), and tick().
|
private |
Definition at line 91 of file fileinputthread.h.
Referenced by tick().
|
private |
Definition at line 83 of file fileinputthread.h.
Referenced by startWork(), and stopWork().