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 <samplesourcefifo.h>
Inherits QObject.
Signals | |
void | dataWrite (int nbSamples) |
void | dataRead (int nbSamples) |
Public Member Functions | |
SampleSourceFifo (uint32_t size, QObject *parent=nullptr) | |
SampleSourceFifo (const SampleSourceFifo &other) | |
~SampleSourceFifo () | |
void | resize (uint32_t size) |
uint32_t | size () const |
void | init () |
void | readAdvance (SampleVector::iterator &readUntil, unsigned int nbSamples) |
void | getReadIterator (SampleVector::iterator &readUntil) |
get iterator past the last sample of a read advance operation (i.e. current read iterator) More... | |
void | getWriteIterator (SampleVector::iterator &writeAt) |
get iterator to current item for update - write phase 1 More... | |
void | bumpIndex (SampleVector::iterator &writeAt) |
copy current item to second buffer and bump write index - write phase 2 More... | |
int | getIteratorOffset (const SampleVector::iterator &iterator) |
void | setIteratorFromOffset (SampleVector::iterator &iterator, int offset) |
void | write (const Sample &sample) |
write directly - phase 1 + phase 2 More... | |
float | getRWBalance () const |
Private Attributes | |
uint32_t | m_size |
SampleVector | m_data |
uint32_t | m_iw |
uint32_t | m_ir |
bool | m_init |
QMutex | m_mutex |
Definition at line 28 of file samplesourcefifo.h.
SampleSourceFifo::SampleSourceFifo | ( | uint32_t | size, |
QObject * | parent = nullptr |
||
) |
Definition at line 22 of file samplesourcefifo.cpp.
References init(), m_data, and m_size.
SampleSourceFifo::SampleSourceFifo | ( | const SampleSourceFifo & | other | ) |
Definition at line 31 of file samplesourcefifo.cpp.
References init().
SampleSourceFifo::~SampleSourceFifo | ( | ) |
Definition at line 39 of file samplesourcefifo.cpp.
void SampleSourceFifo::bumpIndex | ( | SampleVector::iterator & | writeAt | ) |
copy current item to second buffer and bump write index - write phase 2
Definition at line 92 of file samplesourcefifo.cpp.
References m_data, m_iw, and m_size.
Referenced by BasebandSampleSource::feed(), BasebandSampleSource::handleWriteToFifo(), and DSPDeviceSinkEngine::work().
|
signal |
|
signal |
int SampleSourceFifo::getIteratorOffset | ( | const SampleVector::iterator & | iterator | ) |
Definition at line 104 of file samplesourcefifo.cpp.
References m_data.
Referenced by LocalSourceThread::pullSamples().
void SampleSourceFifo::getReadIterator | ( | SampleVector::iterator & | readUntil | ) |
get iterator past the last sample of a read advance operation (i.e. current read iterator)
Definition at line 82 of file samplesourcefifo.cpp.
References m_data, m_ir, and m_size.
Referenced by DSPDeviceSinkEngine::handleForwardToSpectrumSink(), and DSPDeviceMIMOEngine::handleForwardToSpectrumSink().
|
inline |
returns ratio of off center over buffer size with sign: negative read lags and positive read leads
Definition at line 51 of file samplesourcefifo.h.
Referenced by XTRXOutputThread::callback(), BladeRF2OutputThread::callbackSO(), XTRXOutputThread::callbackSO(), SoapySDROutputThread::callbackSO12(), SoapySDROutputThread::callbackSO16(), SoapySDROutputThread::callbackSO8(), SoapySDROutputThread::callbackSOIF(), and RemoteOutput::webapiFormatDeviceReport().
void SampleSourceFifo::getWriteIterator | ( | SampleVector::iterator & | writeAt | ) |
get iterator to current item for update - write phase 1
Definition at line 87 of file samplesourcefifo.cpp.
Referenced by BasebandSampleSource::feed(), BasebandSampleSource::handleWriteToFifo(), and DSPDeviceSinkEngine::work().
void SampleSourceFifo::init | ( | ) |
Definition at line 51 of file samplesourcefifo.cpp.
References m_data, m_init, m_ir, m_iw, and m_size.
Referenced by resize(), and SampleSourceFifo().
void SampleSourceFifo::readAdvance | ( | SampleVector::iterator & | readUntil, |
unsigned int | nbSamples | ||
) |
advance read pointer for the given length and activate R/W signals
Definition at line 60 of file samplesourcefifo.cpp.
References dataRead(), dataWrite(), m_data, m_ir, and m_size.
Referenced by Bladerf1OutputThread::callback(), HackRFOutputThread::callback(), LimeSDROutputThread::callback(), XTRXOutputThread::callback(), BladeRF2OutputThread::callbackSO(), XTRXOutputThread::callbackSO(), SoapySDROutputThread::callbackSO12(), SoapySDROutputThread::callbackSO16(), SoapySDROutputThread::callbackSO8(), SoapySDROutputThread::callbackSOIF(), PlutoSDROutputThread::convert(), LocalSourceThread::pullSamples(), FileSinkThread::tick(), and RemoteOutputThread::tick().
void SampleSourceFifo::resize | ( | uint32_t | size | ) |
Definition at line 42 of file samplesourcefifo.cpp.
References init(), m_data, m_size, and size().
Referenced by PlutoSDROutput::applySettings(), Bladerf1Output::applySettings(), HackRFOutput::applySettings(), BladeRF2Output::applySettings(), SoapySDROutput::applySettings(), LimeSDROutput::applySettings(), LocalSource::handleMessage(), PlutoSDROutput::openDevice(), Bladerf1Output::openDevice(), HackRFOutput::openDevice(), BladeRF2Output::openDevice(), SoapySDROutput::openDevice(), XTRXOutput::openDevice(), FileSinkThread::setSamplerate(), and RemoteOutputThread::setSamplerate().
void SampleSourceFifo::setIteratorFromOffset | ( | SampleVector::iterator & | iterator, |
int | offset | ||
) |
Definition at line 109 of file samplesourcefifo.cpp.
References m_data.
Referenced by LocalSource::processSamples().
|
inline |
Definition at line 37 of file samplesourcefifo.h.
Referenced by resize(), and LocalSource::start().
void SampleSourceFifo::write | ( | const Sample & | sample | ) |
write directly - phase 1 + phase 2
Definition at line 71 of file samplesourcefifo.cpp.
References m_data, m_iw, and m_size.
|
private |
Definition at line 64 of file samplesourcefifo.h.
Referenced by bumpIndex(), getIteratorOffset(), getReadIterator(), getWriteIterator(), init(), readAdvance(), resize(), SampleSourceFifo(), setIteratorFromOffset(), and write().
|
private |
Definition at line 67 of file samplesourcefifo.h.
Referenced by init().
|
private |
Definition at line 66 of file samplesourcefifo.h.
Referenced by getReadIterator(), init(), and readAdvance().
|
private |
Definition at line 65 of file samplesourcefifo.h.
Referenced by bumpIndex(), getWriteIterator(), init(), and write().
|
private |
Definition at line 68 of file samplesourcefifo.h.
|
private |
Definition at line 63 of file samplesourcefifo.h.
Referenced by bumpIndex(), getReadIterator(), init(), readAdvance(), resize(), SampleSourceFifo(), and write().