diff --git a/doc/model/SDRAngel.mdj b/doc/model/SDRAngel.mdj index 5564f866b..35413fb75 100644 --- a/doc/model/SDRAngel.mdj +++ b/doc/model/SDRAngel.mdj @@ -14431,7 +14431,7 @@ "height": 13, "autoResize": false, "underline": false, - "text": "SampleSourceFifo", + "text": "SampleSourceFifoDB", "horizontalAlignment": 2, "verticalAlignment": 5 }, @@ -29096,7 +29096,7 @@ "height": 13, "autoResize": false, "underline": false, - "text": "Lifeline2: SampleSourceFifo", + "text": "Lifeline2: SampleSourceFifoDB", "horizontalAlignment": 2, "verticalAlignment": 5 }, @@ -31908,7 +31908,7 @@ "_parent": { "$ref": "AAAAAAFQXc4WXZjpioY=" }, - "name": "SampleSourceFifo", + "name": "SampleSourceFifoDB", "visibility": "public", "operations": [ { diff --git a/plugins/channeltx/localsource/localsource.h b/plugins/channeltx/localsource/localsource.h index f04ada792..afa2c05f0 100644 --- a/plugins/channeltx/localsource/localsource.h +++ b/plugins/channeltx/localsource/localsource.h @@ -172,7 +172,7 @@ private: LocalSourceSettings m_settings; LocalSourceThread *m_sinkThread; - SampleSourceFifo *m_localSampleSourceFifo; + SampleSourceFifoDB *m_localSampleSourceFifo; int m_chunkSize; SampleVector m_localSamples; int m_localSamplesIndex; diff --git a/plugins/channeltx/localsource/localsourcethread.cpp b/plugins/channeltx/localsource/localsourcethread.cpp index 854aa2f36..d16210c71 100644 --- a/plugins/channeltx/localsource/localsourcethread.cpp +++ b/plugins/channeltx/localsource/localsourcethread.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "localsourcethread.h" @@ -40,7 +40,7 @@ void LocalSourceThread::startStop(bool start) m_inputMessageQueue.push(msg); } -void LocalSourceThread::setSampleFifo(SampleSourceFifo *sampleFifo) +void LocalSourceThread::setSampleFifo(SampleSourceFifoDB *sampleFifo) { m_sampleFifo = sampleFifo; } diff --git a/plugins/channeltx/localsource/localsourcethread.h b/plugins/channeltx/localsource/localsourcethread.h index 94636378a..f59240ae0 100644 --- a/plugins/channeltx/localsource/localsourcethread.h +++ b/plugins/channeltx/localsource/localsourcethread.h @@ -26,7 +26,7 @@ #include "util/message.h" #include "util/messagequeue.h" -class SampleSourceFifo; +class SampleSourceFifoDB; class LocalSourceThread : public QThread { Q_OBJECT @@ -55,7 +55,7 @@ public: ~LocalSourceThread(); void startStop(bool start); - void setSampleFifo(SampleSourceFifo *sampleFifo); + void setSampleFifo(SampleSourceFifoDB *sampleFifo); public slots: void pullSamples(unsigned int count); @@ -67,7 +67,7 @@ private: QMutex m_startWaitMutex; QWaitCondition m_startWaiter; volatile bool m_running; - SampleSourceFifo *m_sampleFifo; + SampleSourceFifoDB *m_sampleFifo; MessageQueue m_inputMessageQueue; diff --git a/plugins/samplesink/bladerf1output/bladerf1outputthread.cpp b/plugins/samplesink/bladerf1output/bladerf1outputthread.cpp index d104f8932..57c63d3de 100644 --- a/plugins/samplesink/bladerf1output/bladerf1outputthread.cpp +++ b/plugins/samplesink/bladerf1output/bladerf1outputthread.cpp @@ -23,7 +23,7 @@ -Bladerf1OutputThread::Bladerf1OutputThread(struct bladerf* dev, SampleSourceFifo* sampleFifo, QObject* parent) : +Bladerf1OutputThread::Bladerf1OutputThread(struct bladerf* dev, SampleSourceFifoDB* sampleFifo, QObject* parent) : QThread(parent), m_running(false), m_dev(dev), diff --git a/plugins/samplesink/bladerf1output/bladerf1outputthread.h b/plugins/samplesink/bladerf1output/bladerf1outputthread.h index 7280cdd2a..00864cade 100644 --- a/plugins/samplesink/bladerf1output/bladerf1outputthread.h +++ b/plugins/samplesink/bladerf1output/bladerf1outputthread.h @@ -22,7 +22,7 @@ #include #include #include -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "dsp/interpolators.h" #define BLADERFOUTPUT_BLOCKSIZE (1<<16) @@ -31,7 +31,7 @@ class Bladerf1OutputThread : public QThread { Q_OBJECT public: - Bladerf1OutputThread(struct bladerf* dev, SampleSourceFifo* sampleFifo, QObject* parent = NULL); + Bladerf1OutputThread(struct bladerf* dev, SampleSourceFifoDB* sampleFifo, QObject* parent = NULL); ~Bladerf1OutputThread(); void startWork(); @@ -46,7 +46,7 @@ private: struct bladerf* m_dev; qint16 m_buf[2*BLADERFOUTPUT_BLOCKSIZE]; - SampleSourceFifo* m_sampleFifo; + SampleSourceFifoDB* m_sampleFifo; unsigned int m_log2Interp; diff --git a/plugins/samplesink/bladerf2output/bladerf2output.cpp b/plugins/samplesink/bladerf2output/bladerf2output.cpp index f3a7bca80..440fddcd4 100644 --- a/plugins/samplesink/bladerf2output/bladerf2output.cpp +++ b/plugins/samplesink/bladerf2output/bladerf2output.cpp @@ -279,7 +279,7 @@ bool BladeRF2Output::start() { qDebug("BladeRF2Output::start: expand channels. Re-allocate thread and take ownership"); - SampleSourceFifo **fifos = new SampleSourceFifo*[nbOriginalChannels]; + SampleSourceFifoDB **fifos = new SampleSourceFifoDB*[nbOriginalChannels]; unsigned int *log2Interps = new unsigned int[nbOriginalChannels]; for (int i = 0; i < nbOriginalChannels; i++) // save original FIFO references and data @@ -407,7 +407,7 @@ void BladeRF2Output::stop() { qDebug("BladeRF2Output::stop: MO mode. Reduce by deleting and re-creating the thread"); bladeRF2OutputThread->stopWork(); - SampleSourceFifo **fifos = new SampleSourceFifo*[nbOriginalChannels-1]; + SampleSourceFifoDB **fifos = new SampleSourceFifoDB*[nbOriginalChannels-1]; unsigned int *log2Interps = new unsigned int[nbOriginalChannels-1]; bool stillActiveFIFO = false; @@ -714,7 +714,7 @@ bool BladeRF2Output::applySettings(const BladeRF2OutputSettings& settings, bool { reverseAPIKeys.append("devSampleRate"); BladeRF2OutputThread *bladeRF2OutputThread = findThread(); - SampleSourceFifo *fifo = 0; + SampleSourceFifoDB *fifo = 0; if (bladeRF2OutputThread) { diff --git a/plugins/samplesink/bladerf2output/bladerf2outputthread.cpp b/plugins/samplesink/bladerf2output/bladerf2outputthread.cpp index a60359e3f..097654967 100644 --- a/plugins/samplesink/bladerf2output/bladerf2outputthread.cpp +++ b/plugins/samplesink/bladerf2output/bladerf2outputthread.cpp @@ -17,7 +17,7 @@ #include -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "bladerf2outputthread.h" @@ -151,14 +151,14 @@ unsigned int BladeRF2OutputThread::getLog2Interpolation(unsigned int channel) co } } -void BladeRF2OutputThread::setFifo(unsigned int channel, SampleSourceFifo *sampleFifo) +void BladeRF2OutputThread::setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo) { if (channel < m_nbChannels) { m_channels[channel].m_sampleFifo = sampleFifo; } } -SampleSourceFifo *BladeRF2OutputThread::getFifo(unsigned int channel) +SampleSourceFifoDB *BladeRF2OutputThread::getFifo(unsigned int channel) { if (channel < m_nbChannels) { return m_channels[channel].m_sampleFifo; diff --git a/plugins/samplesink/bladerf2output/bladerf2outputthread.h b/plugins/samplesink/bladerf2output/bladerf2outputthread.h index 7b4bd0f73..13bb03059 100644 --- a/plugins/samplesink/bladerf2output/bladerf2outputthread.h +++ b/plugins/samplesink/bladerf2output/bladerf2outputthread.h @@ -26,7 +26,7 @@ #include "bladerf2/devicebladerf2shared.h" #include "dsp/interpolators.h" -class SampleSourceFifo; +class SampleSourceFifoDB; class BladeRF2OutputThread : public QThread { Q_OBJECT @@ -41,13 +41,13 @@ public: unsigned int getNbChannels() const { return m_nbChannels; } void setLog2Interpolation(unsigned int channel, unsigned int log2_interp); unsigned int getLog2Interpolation(unsigned int channel) const; - void setFifo(unsigned int channel, SampleSourceFifo *sampleFifo); - SampleSourceFifo *getFifo(unsigned int channel); + void setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo); + SampleSourceFifoDB *getFifo(unsigned int channel); private: struct Channel { - SampleSourceFifo* m_sampleFifo; + SampleSourceFifoDB* m_sampleFifo; unsigned int m_log2Interp; Interpolators m_interpolators; diff --git a/plugins/samplesink/filesink/filesinkthread.cpp b/plugins/samplesink/filesink/filesinkthread.cpp index 1faa94e5f..11db6eff4 100644 --- a/plugins/samplesink/filesink/filesinkthread.cpp +++ b/plugins/samplesink/filesink/filesinkthread.cpp @@ -21,10 +21,10 @@ #include #include -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "filesinkthread.h" -FileSinkThread::FileSinkThread(std::ofstream *samplesStream, SampleSourceFifo* sampleFifo, QObject* parent) : +FileSinkThread::FileSinkThread(std::ofstream *samplesStream, SampleSourceFifoDB* sampleFifo, QObject* parent) : QThread(parent), m_running(false), m_ofstream(samplesStream), diff --git a/plugins/samplesink/filesink/filesinkthread.h b/plugins/samplesink/filesink/filesinkthread.h index 455d675e0..bf0accf90 100644 --- a/plugins/samplesink/filesink/filesinkthread.h +++ b/plugins/samplesink/filesink/filesinkthread.h @@ -33,13 +33,13 @@ #define FILESINK_THROTTLE_MS 50 -class SampleSourceFifo; +class SampleSourceFifoDB; class FileSinkThread : public QThread { Q_OBJECT public: - FileSinkThread(std::ofstream *samplesStream, SampleSourceFifo* sampleFifo, QObject* parent = 0); + FileSinkThread(std::ofstream *samplesStream, SampleSourceFifoDB* sampleFifo, QObject* parent = 0); ~FileSinkThread(); void startWork(); @@ -61,7 +61,7 @@ private: std::ofstream* m_ofstream; std::size_t m_bufsize; unsigned int m_samplesChunkSize; - SampleSourceFifo* m_sampleFifo; + SampleSourceFifoDB* m_sampleFifo; std::size_t m_samplesCount; int m_samplerate; diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp b/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp index 348b5e136..2c14b1813 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutputthread.cpp @@ -20,9 +20,9 @@ #include #include -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" -HackRFOutputThread::HackRFOutputThread(hackrf_device* dev, SampleSourceFifo* sampleFifo, QObject* parent) : +HackRFOutputThread::HackRFOutputThread(hackrf_device* dev, SampleSourceFifoDB* sampleFifo, QObject* parent) : QThread(parent), m_running(false), m_dev(dev), diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputthread.h b/plugins/samplesink/hackrfoutput/hackrfoutputthread.h index be73016c8..3f5b7613e 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputthread.h +++ b/plugins/samplesink/hackrfoutput/hackrfoutputthread.h @@ -23,7 +23,7 @@ #include #include -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "dsp/interpolators.h" #define HACKRF_BLOCKSIZE (1<<17) @@ -32,7 +32,7 @@ class HackRFOutputThread : public QThread { Q_OBJECT public: - HackRFOutputThread(hackrf_device* dev, SampleSourceFifo* sampleFifo, QObject* parent = NULL); + HackRFOutputThread(hackrf_device* dev, SampleSourceFifoDB* sampleFifo, QObject* parent = NULL); ~HackRFOutputThread(); void startWork(); @@ -47,7 +47,7 @@ private: hackrf_device* m_dev; qint8 m_buf[2*HACKRF_BLOCKSIZE]; - SampleSourceFifo* m_sampleFifo; + SampleSourceFifoDB* m_sampleFifo; unsigned int m_log2Interp; int m_fcPos; diff --git a/plugins/samplesink/limesdroutput/limesdroutputthread.cpp b/plugins/samplesink/limesdroutput/limesdroutputthread.cpp index 25a113260..1e252539f 100644 --- a/plugins/samplesink/limesdroutput/limesdroutputthread.cpp +++ b/plugins/samplesink/limesdroutput/limesdroutputthread.cpp @@ -21,7 +21,7 @@ #include "limesdroutputthread.h" #include "limesdroutputsettings.h" -LimeSDROutputThread::LimeSDROutputThread(lms_stream_t* stream, SampleSourceFifo* sampleFifo, QObject* parent) : +LimeSDROutputThread::LimeSDROutputThread(lms_stream_t* stream, SampleSourceFifoDB* sampleFifo, QObject* parent) : QThread(parent), m_running(false), m_stream(stream), diff --git a/plugins/samplesink/limesdroutput/limesdroutputthread.h b/plugins/samplesink/limesdroutput/limesdroutputthread.h index b7c724456..fb9cd6cde 100644 --- a/plugins/samplesink/limesdroutput/limesdroutputthread.h +++ b/plugins/samplesink/limesdroutput/limesdroutputthread.h @@ -24,7 +24,7 @@ #include "lime/LimeSuite.h" -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "dsp/interpolators.h" #include "limesdr/devicelimesdrshared.h" @@ -35,7 +35,7 @@ class LimeSDROutputThread : public QThread, public DeviceLimeSDRShared::ThreadIn Q_OBJECT public: - LimeSDROutputThread(lms_stream_t* stream, SampleSourceFifo* sampleFifo, QObject* parent = 0); + LimeSDROutputThread(lms_stream_t* stream, SampleSourceFifoDB* sampleFifo, QObject* parent = 0); ~LimeSDROutputThread(); virtual void startWork(); @@ -51,7 +51,7 @@ private: lms_stream_t* m_stream; qint16 m_buf[2*LIMESDROUTPUT_BLOCKSIZE]; //must hold I+Q values of each sample hence 2xcomplex size - SampleSourceFifo* m_sampleFifo; + SampleSourceFifoDB* m_sampleFifo; unsigned int m_log2Interp; // soft decimation diff --git a/plugins/samplesink/plutosdroutput/plutosdroutputthread.cpp b/plugins/samplesink/plutosdroutput/plutosdroutputthread.cpp index 34a2c3c3c..a0ebbce2b 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutputthread.cpp +++ b/plugins/samplesink/plutosdroutput/plutosdroutputthread.cpp @@ -20,7 +20,7 @@ #include "iio.h" #include "plutosdroutputthread.h" -PlutoSDROutputThread::PlutoSDROutputThread(uint32_t blocksizeSamples, DevicePlutoSDRBox* plutoBox, SampleSourceFifo* sampleFifo, QObject* parent) : +PlutoSDROutputThread::PlutoSDROutputThread(uint32_t blocksizeSamples, DevicePlutoSDRBox* plutoBox, SampleSourceFifoDB* sampleFifo, QObject* parent) : QThread(parent), m_running(false), m_plutoBox(plutoBox), diff --git a/plugins/samplesink/plutosdroutput/plutosdroutputthread.h b/plugins/samplesink/plutosdroutput/plutosdroutputthread.h index c9a0af2d1..05db0955c 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutputthread.h +++ b/plugins/samplesink/plutosdroutput/plutosdroutputthread.h @@ -22,7 +22,7 @@ #include #include -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "dsp/interpolators.h" #include "plutosdr/deviceplutosdrshared.h" @@ -33,7 +33,7 @@ class PlutoSDROutputThread : public QThread, public DevicePlutoSDRShared::Thread Q_OBJECT public: - PlutoSDROutputThread(uint32_t blocksize, DevicePlutoSDRBox* plutoBox, SampleSourceFifo* sampleFifo, QObject* parent = 0); + PlutoSDROutputThread(uint32_t blocksize, DevicePlutoSDRBox* plutoBox, SampleSourceFifoDB* sampleFifo, QObject* parent = 0); ~PlutoSDROutputThread(); virtual void startWork(); @@ -51,7 +51,7 @@ private: int16_t *m_buf; //!< holds I+Q values of each sample from devce // int16_t *m_bufConv; //!< holds I+Q values of each sample converted to host format via iio_channel_convert uint32_t m_blockSizeSamples; //!< buffer sizes in number of (I,Q) samples - SampleSourceFifo* m_sampleFifo; //!< DSP sample FIFO (I,Q) + SampleSourceFifoDB* m_sampleFifo; //!< DSP sample FIFO (I,Q) unsigned int m_log2Interp; // soft interpolation diff --git a/plugins/samplesink/remoteoutput/remoteoutputthread.cpp b/plugins/samplesink/remoteoutput/remoteoutputthread.cpp index 5e70c741c..c0f99d347 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputthread.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutputthread.cpp @@ -21,11 +21,11 @@ #include #include -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "util/timeutil.h" #include "remoteoutputthread.h" -RemoteOutputThread::RemoteOutputThread(SampleSourceFifo* sampleFifo, QObject* parent) : +RemoteOutputThread::RemoteOutputThread(SampleSourceFifoDB* sampleFifo, QObject* parent) : QThread(parent), m_running(false), m_samplesChunkSize(0), diff --git a/plugins/samplesink/remoteoutput/remoteoutputthread.h b/plugins/samplesink/remoteoutput/remoteoutputthread.h index ce992a59e..3a1001432 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputthread.h +++ b/plugins/samplesink/remoteoutput/remoteoutputthread.h @@ -36,14 +36,14 @@ #define REMOTEOUTPUT_THROTTLE_MS 50 -class SampleSourceFifo; +class SampleSourceFifoDB; struct timeval; class RemoteOutputThread : public QThread { Q_OBJECT public: - RemoteOutputThread(SampleSourceFifo* sampleFifo, QObject* parent = 0); + RemoteOutputThread(SampleSourceFifoDB* sampleFifo, QObject* parent = 0); ~RemoteOutputThread(); void startWork(); @@ -68,7 +68,7 @@ private: volatile bool m_running; int m_samplesChunkSize; - SampleSourceFifo* m_sampleFifo; + SampleSourceFifoDB* m_sampleFifo; uint32_t m_samplesCount; int m_chunkCorrection; diff --git a/plugins/samplesink/soapysdroutput/soapysdroutput.cpp b/plugins/samplesink/soapysdroutput/soapysdroutput.cpp index 0a3c3b1da..39717166a 100644 --- a/plugins/samplesink/soapysdroutput/soapysdroutput.cpp +++ b/plugins/samplesink/soapysdroutput/soapysdroutput.cpp @@ -463,7 +463,7 @@ bool SoapySDROutput::start() { qDebug("SoapySDROutput::start: expand channels. Re-allocate thread and take ownership"); - SampleSourceFifo **fifos = new SampleSourceFifo*[nbOriginalChannels]; + SampleSourceFifoDB **fifos = new SampleSourceFifoDB*[nbOriginalChannels]; unsigned int *log2Interps = new unsigned int[nbOriginalChannels]; for (int i = 0; i < nbOriginalChannels; i++) // save original FIFO references and data @@ -574,7 +574,7 @@ void SoapySDROutput::stop() { qDebug("SoapySDROutput::stop: MO mode. Reduce by deleting and re-creating the thread"); soapySDROutputThread->stopWork(); - SampleSourceFifo **fifos = new SampleSourceFifo*[nbOriginalChannels-1]; + SampleSourceFifoDB **fifos = new SampleSourceFifoDB*[nbOriginalChannels-1]; unsigned int *log2Interps = new unsigned int[nbOriginalChannels-1]; int highestActiveChannelIndex = -1; @@ -871,7 +871,7 @@ bool SoapySDROutput::applySettings(const SoapySDROutputSettings& settings, bool if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || (m_settings.m_log2Interp != settings.m_log2Interp) || force) { SoapySDROutputThread *soapySDROutputThread = findThread(); - SampleSourceFifo *fifo = 0; + SampleSourceFifoDB *fifo = 0; if (soapySDROutputThread) { diff --git a/plugins/samplesink/soapysdroutput/soapysdroutputthread.cpp b/plugins/samplesink/soapysdroutput/soapysdroutputthread.cpp index a54d8354f..412d30c70 100644 --- a/plugins/samplesink/soapysdroutput/soapysdroutputthread.cpp +++ b/plugins/samplesink/soapysdroutput/soapysdroutputthread.cpp @@ -20,7 +20,7 @@ #include #include -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "soapysdroutputthread.h" @@ -218,14 +218,14 @@ unsigned int SoapySDROutputThread::getLog2Interpolation(unsigned int channel) co } } -void SoapySDROutputThread::setFifo(unsigned int channel, SampleSourceFifo *sampleFifo) +void SoapySDROutputThread::setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo) { if (channel < m_nbChannels) { m_channels[channel].m_sampleFifo = sampleFifo; } } -SampleSourceFifo *SoapySDROutputThread::getFifo(unsigned int channel) +SampleSourceFifoDB *SoapySDROutputThread::getFifo(unsigned int channel) { if (channel < m_nbChannels) { return m_channels[channel].m_sampleFifo; diff --git a/plugins/samplesink/soapysdroutput/soapysdroutputthread.h b/plugins/samplesink/soapysdroutput/soapysdroutputthread.h index 78178b864..8d19aa2eb 100644 --- a/plugins/samplesink/soapysdroutput/soapysdroutputthread.h +++ b/plugins/samplesink/soapysdroutput/soapysdroutputthread.h @@ -29,7 +29,7 @@ #include "dsp/interpolators.h" #include "dsp/interpolatorsif.h" -class SampleSourceFifo; +class SampleSourceFifoDB; class SoapySDROutputThread : public QThread { Q_OBJECT @@ -46,13 +46,13 @@ public: unsigned int getLog2Interpolation(unsigned int channel) const; void setSampleRate(unsigned int sampleRate) { m_sampleRate = sampleRate; } unsigned int getSampleRate() const { return m_sampleRate; } - void setFifo(unsigned int channel, SampleSourceFifo *sampleFifo); - SampleSourceFifo *getFifo(unsigned int channel); + void setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo); + SampleSourceFifoDB *getFifo(unsigned int channel); private: struct Channel { - SampleSourceFifo* m_sampleFifo; + SampleSourceFifoDB* m_sampleFifo; unsigned int m_log2Interp; Interpolators m_interpolators8; Interpolators m_interpolators12; diff --git a/plugins/samplesink/testsink/testsinkthread.cpp b/plugins/samplesink/testsink/testsinkthread.cpp index 086ae06af..9950ac4c4 100644 --- a/plugins/samplesink/testsink/testsinkthread.cpp +++ b/plugins/samplesink/testsink/testsinkthread.cpp @@ -21,11 +21,11 @@ #include #include -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "dsp/basebandsamplesink.h" #include "testsinkthread.h" -TestSinkThread::TestSinkThread(SampleSourceFifo* sampleFifo, QObject* parent) : +TestSinkThread::TestSinkThread(SampleSourceFifoDB* sampleFifo, QObject* parent) : QThread(parent), m_running(false), m_bufsize(0), diff --git a/plugins/samplesink/testsink/testsinkthread.h b/plugins/samplesink/testsink/testsinkthread.h index bfb4467c3..c7a193b91 100644 --- a/plugins/samplesink/testsink/testsinkthread.h +++ b/plugins/samplesink/testsink/testsinkthread.h @@ -34,14 +34,14 @@ #define TESTSINK_THROTTLE_MS 50 -class SampleSourceFifo; +class SampleSourceFifoDB; class BasebandSampleSink; class TestSinkThread : public QThread { Q_OBJECT public: - TestSinkThread(SampleSourceFifo* sampleFifo, QObject* parent = nullptr); + TestSinkThread(SampleSourceFifoDB* sampleFifo, QObject* parent = nullptr); ~TestSinkThread(); void startWork(); @@ -70,7 +70,7 @@ private: std::size_t m_bufsize; unsigned int m_samplesChunkSize; - SampleSourceFifo* m_sampleFifo; + SampleSourceFifoDB* m_sampleFifo; std::size_t m_samplesCount; int m_samplerate; diff --git a/plugins/samplesink/xtrxoutput/xtrxoutput.cpp b/plugins/samplesink/xtrxoutput/xtrxoutput.cpp index e16ca1fa3..d2ef8fe2e 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutput.cpp +++ b/plugins/samplesink/xtrxoutput/xtrxoutput.cpp @@ -278,7 +278,7 @@ bool XTRXOutput::start() { qDebug("XTRXOutput::start: expand channels. Re-allocate thread and take ownership"); - SampleSourceFifo **fifos = new SampleSourceFifo*[2]; + SampleSourceFifoDB **fifos = new SampleSourceFifoDB*[2]; unsigned int *log2Interps = new unsigned int[2]; for (int i = 0; i < 2; i++) // save original FIFO references and data diff --git a/plugins/samplesink/xtrxoutput/xtrxoutputthread.cpp b/plugins/samplesink/xtrxoutput/xtrxoutputthread.cpp index f13911b28..ddd42a653 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutputthread.cpp +++ b/plugins/samplesink/xtrxoutput/xtrxoutputthread.cpp @@ -20,7 +20,7 @@ #include #include "xtrx/devicextrx.h" -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "xtrxoutputthread.h" @@ -94,14 +94,14 @@ unsigned int XTRXOutputThread::getLog2Interpolation(unsigned int channel) const } } -void XTRXOutputThread::setFifo(unsigned int channel, SampleSourceFifo *sampleFifo) +void XTRXOutputThread::setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo) { if (channel < 2) { m_channels[channel].m_sampleFifo = sampleFifo; } } -SampleSourceFifo *XTRXOutputThread::getFifo(unsigned int channel) +SampleSourceFifoDB *XTRXOutputThread::getFifo(unsigned int channel) { if (channel < 2) { return m_channels[channel].m_sampleFifo; diff --git a/plugins/samplesink/xtrxoutput/xtrxoutputthread.h b/plugins/samplesink/xtrxoutput/xtrxoutputthread.h index 670e76014..4b903368a 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutputthread.h +++ b/plugins/samplesink/xtrxoutput/xtrxoutputthread.h @@ -24,7 +24,7 @@ #include "xtrx_api.h" -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "dsp/interpolators.h" #include "xtrx/devicextrxshared.h" @@ -44,13 +44,13 @@ public: unsigned int getNbChannels() const { return m_nbChannels; } void setLog2Interpolation(unsigned int channel, unsigned int log2_interp); unsigned int getLog2Interpolation(unsigned int channel) const; - void setFifo(unsigned int channel, SampleSourceFifo *sampleFifo); - SampleSourceFifo *getFifo(unsigned int channel); + void setFifo(unsigned int channel, SampleSourceFifoDB *sampleFifo); + SampleSourceFifoDB *getFifo(unsigned int channel); private: struct Channel { - SampleSourceFifo* m_sampleFifo; + SampleSourceFifoDB* m_sampleFifo; unsigned int m_log2Interp; Interpolators m_interpolators; diff --git a/sdrbase/CMakeLists.txt b/sdrbase/CMakeLists.txt index 6a926dd88..c7b8633e4 100644 --- a/sdrbase/CMakeLists.txt +++ b/sdrbase/CMakeLists.txt @@ -101,7 +101,7 @@ set(sdrbase_SOURCES dsp/samplemififo.cpp dsp/samplemofifo.cpp dsp/samplesinkfifo.cpp - dsp/samplesourcefifo.cpp + dsp/samplesourcefifodb.cpp dsp/basebandsamplesink.cpp dsp/basebandsamplesource.cpp dsp/nullsink.cpp @@ -241,7 +241,7 @@ set(sdrbase_HEADERS dsp/samplemififo.h dsp/samplemofifo.h dsp/samplesinkfifo.h - dsp/samplesourcefifo.h + dsp/samplesourcefifodb.h dsp/basebandsamplesink.h dsp/basebandsamplesource.h dsp/nullsink.h diff --git a/sdrbase/dsp/basebandsamplesource.cpp b/sdrbase/dsp/basebandsamplesource.cpp index bab1a52ef..e3ce8f2b1 100644 --- a/sdrbase/dsp/basebandsamplesource.cpp +++ b/sdrbase/dsp/basebandsamplesource.cpp @@ -55,7 +55,7 @@ void BasebandSampleSource::handleWriteToDeviceFifo(int nbSamples) handleWriteToFifo(m_deviceSampleFifo, nbSamples); } -void BasebandSampleSource::handleWriteToFifo(SampleSourceFifo *sampleFifo, int nbSamples) +void BasebandSampleSource::handleWriteToFifo(SampleSourceFifoDB *sampleFifo, int nbSamples) { SampleVector::iterator writeAt; sampleFifo->getWriteIterator(writeAt); @@ -69,7 +69,7 @@ void BasebandSampleSource::handleWriteToFifo(SampleSourceFifo *sampleFifo, int n } -void BasebandSampleSource::setDeviceSampleSourceFifo(SampleSourceFifo *deviceSampleFifo) +void BasebandSampleSource::setDeviceSampleSourceFifo(SampleSourceFifoDB *deviceSampleFifo) { if (m_deviceSampleFifo != deviceSampleFifo) { diff --git a/sdrbase/dsp/basebandsamplesource.h b/sdrbase/dsp/basebandsamplesource.h index d0f6c920e..1f8288181 100644 --- a/sdrbase/dsp/basebandsamplesource.h +++ b/sdrbase/dsp/basebandsamplesource.h @@ -21,7 +21,7 @@ #include #include "dsp/dsptypes.h" -#include "dsp/samplesourcefifo.h" +#include "dsp/samplesourcefifodb.h" #include "export.h" #include "util/messagequeue.h" @@ -39,7 +39,7 @@ public: virtual void pullAudio(int nbSamples) { (void) nbSamples; } /** direct feeding of sample source FIFO */ - void feed(SampleSourceFifo* sampleFifo, int nbSamples) + void feed(SampleSourceFifoDB* sampleFifo, int nbSamples) { SampleVector::iterator writeAt; sampleFifo->getWriteIterator(writeAt); @@ -52,22 +52,22 @@ public: } } - SampleSourceFifo& getSampleSourceFifo() { return m_sampleFifo; } + SampleSourceFifoDB& getSampleSourceFifo() { return m_sampleFifo; } virtual bool handleMessage(const Message& cmd) = 0; //!< Processing of a message. Returns true if message has actually been processed MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; } - void setDeviceSampleSourceFifo(SampleSourceFifo *deviceSampleFifo); + void setDeviceSampleSourceFifo(SampleSourceFifoDB *deviceSampleFifo); protected: MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI - SampleSourceFifo m_sampleFifo; //!< Internal FIFO for multi-channel processing - SampleSourceFifo *m_deviceSampleFifo; //!< Reference to the device FIFO for single channel processing + SampleSourceFifoDB m_sampleFifo; //!< Internal FIFO for multi-channel processing + SampleSourceFifoDB *m_deviceSampleFifo; //!< Reference to the device FIFO for single channel processing - void handleWriteToFifo(SampleSourceFifo *sampleFifo, int nbSamples); + void handleWriteToFifo(SampleSourceFifoDB *sampleFifo, int nbSamples); protected slots: void handleInputMessages(); diff --git a/sdrbase/dsp/devicesamplemimo.h b/sdrbase/dsp/devicesamplemimo.h index 023a80015..0a5de4f5c 100644 --- a/sdrbase/dsp/devicesamplemimo.h +++ b/sdrbase/dsp/devicesamplemimo.h @@ -21,7 +21,7 @@ #include -#include "samplesourcefifo.h" +#include "samplesourcefifodb.h" #include "samplemififo.h" #include "samplemofifo.h" #include "util/message.h" diff --git a/sdrbase/dsp/devicesamplesink.h b/sdrbase/dsp/devicesamplesink.h index 98cdb89fa..ac370b5e7 100644 --- a/sdrbase/dsp/devicesamplesink.h +++ b/sdrbase/dsp/devicesamplesink.h @@ -21,7 +21,7 @@ #include -#include "samplesourcefifo.h" +#include "samplesourcefifodb.h" #include "util/message.h" #include "util/messagequeue.h" #include "export.h" @@ -114,7 +114,7 @@ public: MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } virtual void setMessageQueueToGUI(MessageQueue *queue) = 0; // pure virtual so that child classes must have to deal with this MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; } - SampleSourceFifo* getSampleFifo() { return &m_sampleSourceFifo; } + SampleSourceFifoDB* getSampleFifo() { return &m_sampleSourceFifo; } static qint64 calculateDeviceCenterFrequency( quint64 centerFrequency, @@ -141,7 +141,7 @@ protected slots: void handleInputMessages(); protected: - SampleSourceFifo m_sampleSourceFifo; + SampleSourceFifoDB m_sampleSourceFifo; MessageQueue m_inputMessageQueue; //!< Input queue to the sink MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI }; diff --git a/sdrbase/dsp/dspdevicemimoengine.cpp b/sdrbase/dsp/dspdevicemimoengine.cpp index 13cb40124..a8f88b867 100644 --- a/sdrbase/dsp/dspdevicemimoengine.cpp +++ b/sdrbase/dsp/dspdevicemimoengine.cpp @@ -1129,7 +1129,7 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages() // if (!m_spectrumInputSourceElseSink && m_deviceSampleMIMO && (m_spectrumInputIndex < m_deviceSampleMIMO->getNbSinkStreams())) // { - // SampleSourceFifo *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(m_spectrumInputIndex); + // SampleSourceFifoDB *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(m_spectrumInputIndex); // disconnect(inputFIFO, SIGNAL(dataRead(int)), this, SLOT(handleForwardToSpectrumSink(int))); // } @@ -1145,13 +1145,13 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages() { // if (!m_spectrumInputSourceElseSink) // remove the source listener // { - // SampleSourceFifo *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(m_spectrumInputIndex); + // SampleSourceFifoDB *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(m_spectrumInputIndex); // disconnect(inputFIFO, SIGNAL(dataRead(int)), this, SLOT(handleForwardToSpectrumSink(int))); // } if ((!spectrumInputSourceElseSink) && (spectrumInputIndex < m_deviceSampleMIMO->getNbSinkStreams())) // add the source listener { - // SampleSourceFifo *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(spectrumInputIndex); + // SampleSourceFifoDB *inputFIFO = m_deviceSampleMIMO->getSampleSourceFifo(spectrumInputIndex); // connect(inputFIFO, SIGNAL(dataRead(int)), this, SLOT(handleForwardToSpectrumSink(int))); if (m_spectrumSink) diff --git a/sdrbase/dsp/dspdevicesinkengine.cpp b/sdrbase/dsp/dspdevicesinkengine.cpp index d5dc8bf14..f1d578cfb 100644 --- a/sdrbase/dsp/dspdevicesinkengine.cpp +++ b/sdrbase/dsp/dspdevicesinkengine.cpp @@ -26,7 +26,7 @@ #include "dsp/basebandsamplesink.h" #include "dsp/devicesamplesink.h" #include "dsp/dspcommands.h" -#include "samplesourcefifo.h" +#include "samplesourcefifodb.h" #include "threadedbasebandsamplesource.h" DSPDeviceSinkEngine::DSPDeviceSinkEngine(uint32_t uid, QObject* parent) : @@ -165,7 +165,7 @@ void DSPDeviceSinkEngine::work(int nbWriteSamples) // qDebug("DSPDeviceSinkEngine::work: multiple channel sources handling: %u", m_multipleSourcesDivisionFactor); SampleVector::iterator writeBegin; - SampleSourceFifo* sampleFifo = m_deviceSampleSink->getSampleFifo(); + SampleSourceFifoDB* sampleFifo = m_deviceSampleSink->getSampleFifo(); sampleFifo->getWriteIterator(writeBegin); SampleVector::iterator writeAt = writeBegin; std::vector sampleSourceIterators; @@ -560,7 +560,7 @@ void DSPDeviceSinkEngine::handleForwardToSpectrumSink(int nbSamples) { if (m_spectrumSink) { - SampleSourceFifo* sampleFifo = m_deviceSampleSink->getSampleFifo(); + SampleSourceFifoDB* sampleFifo = m_deviceSampleSink->getSampleFifo(); SampleVector::iterator readUntil; sampleFifo->getReadIterator(readUntil); m_spectrumSink->feed(readUntil - nbSamples, readUntil, false); @@ -569,7 +569,7 @@ void DSPDeviceSinkEngine::handleForwardToSpectrumSink(int nbSamples) void DSPDeviceSinkEngine::checkNumberOfBasebandSources() { - SampleSourceFifo* sampleFifo = m_deviceSampleSink->getSampleFifo(); + SampleSourceFifoDB* sampleFifo = m_deviceSampleSink->getSampleFifo(); // single channel source handling if ((m_threadedBasebandSampleSources.size() + m_basebandSampleSources.size()) == 1) diff --git a/sdrbase/dsp/samplesourcefifo.cpp b/sdrbase/dsp/samplesourcefifodb.cpp similarity index 73% rename from sdrbase/dsp/samplesourcefifo.cpp rename to sdrbase/dsp/samplesourcefifodb.cpp index 436dac787..f702cc7fd 100644 --- a/sdrbase/dsp/samplesourcefifo.cpp +++ b/sdrbase/dsp/samplesourcefifodb.cpp @@ -17,9 +17,9 @@ #include #include -#include "samplesourcefifo.h" +#include "samplesourcefifodb.h" -SampleSourceFifo::SampleSourceFifo(uint32_t size, QObject* parent) : +SampleSourceFifoDB::SampleSourceFifoDB(uint32_t size, QObject* parent) : QObject(parent), m_size(size), m_init(false) @@ -28,7 +28,7 @@ SampleSourceFifo::SampleSourceFifo(uint32_t size, QObject* parent) : init(); } -SampleSourceFifo::SampleSourceFifo(const SampleSourceFifo& other) : +SampleSourceFifoDB::SampleSourceFifoDB(const SampleSourceFifoDB& other) : QObject(other.parent()), m_size(other.m_size), m_data(other.m_data) @@ -36,19 +36,19 @@ SampleSourceFifo::SampleSourceFifo(const SampleSourceFifo& other) : init(); } -SampleSourceFifo::~SampleSourceFifo() +SampleSourceFifoDB::~SampleSourceFifoDB() {} -void SampleSourceFifo::resize(uint32_t size) +void SampleSourceFifoDB::resize(uint32_t size) { - qDebug("SampleSourceFifo::resize: %d", size); + qDebug("SampleSourceFifoDB::resize: %d", size); m_size = size; m_data.resize(2*m_size); init(); } -void SampleSourceFifo::init() +void SampleSourceFifoDB::init() { static Sample zero = {0,0}; std::fill(m_data.begin(), m_data.end(), zero); @@ -57,7 +57,7 @@ void SampleSourceFifo::init() m_init = true; } -void SampleSourceFifo::readAdvance(SampleVector::iterator& readUntil, unsigned int nbSamples) +void SampleSourceFifoDB::readAdvance(SampleVector::iterator& readUntil, unsigned int nbSamples) { // QMutexLocker mutexLocker(&m_mutex); assert(nbSamples <= m_size/2); @@ -68,7 +68,7 @@ void SampleSourceFifo::readAdvance(SampleVector::iterator& readUntil, unsigned i emit dataRead(nbSamples); } -void SampleSourceFifo::readAdvance(SampleVector::const_iterator& readUntil, unsigned int nbSamples) +void SampleSourceFifoDB::readAdvance(SampleVector::const_iterator& readUntil, unsigned int nbSamples) { // QMutexLocker mutexLocker(&m_mutex); assert(nbSamples <= m_size/2); @@ -79,7 +79,7 @@ void SampleSourceFifo::readAdvance(SampleVector::const_iterator& readUntil, unsi emit dataRead(nbSamples); } -void SampleSourceFifo::write(const Sample& sample) +void SampleSourceFifoDB::write(const Sample& sample) { m_data[m_iw] = sample; m_data[m_iw+m_size] = sample; @@ -90,17 +90,17 @@ void SampleSourceFifo::write(const Sample& sample) } } -void SampleSourceFifo::getReadIterator(SampleVector::iterator& readUntil) +void SampleSourceFifoDB::getReadIterator(SampleVector::iterator& readUntil) { readUntil = m_data.begin() + m_size + m_ir; } -void SampleSourceFifo::getWriteIterator(SampleVector::iterator& writeAt) +void SampleSourceFifoDB::getWriteIterator(SampleVector::iterator& writeAt) { writeAt = m_data.begin() + m_iw; } -void SampleSourceFifo::bumpIndex(SampleVector::iterator& writeAt) +void SampleSourceFifoDB::bumpIndex(SampleVector::iterator& writeAt) { m_data[m_iw+m_size] = m_data[m_iw]; @@ -112,12 +112,12 @@ void SampleSourceFifo::bumpIndex(SampleVector::iterator& writeAt) writeAt = m_data.begin() + m_iw; } -int SampleSourceFifo::getIteratorOffset(const SampleVector::iterator& iterator) +int SampleSourceFifoDB::getIteratorOffset(const SampleVector::iterator& iterator) { return iterator - m_data.begin(); } -void SampleSourceFifo::setIteratorFromOffset(SampleVector::iterator& iterator, int offset) +void SampleSourceFifoDB::setIteratorFromOffset(SampleVector::iterator& iterator, int offset) { iterator = m_data.begin() + offset; } diff --git a/sdrbase/dsp/samplesourcefifo.h b/sdrbase/dsp/samplesourcefifodb.h similarity index 91% rename from sdrbase/dsp/samplesourcefifo.h rename to sdrbase/dsp/samplesourcefifodb.h index e4d248525..7062ae87f 100644 --- a/sdrbase/dsp/samplesourcefifo.h +++ b/sdrbase/dsp/samplesourcefifodb.h @@ -15,8 +15,8 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#ifndef SDRBASE_DSP_SAMPLESOURCEFIFO_H_ -#define SDRBASE_DSP_SAMPLESOURCEFIFO_H_ +#ifndef SDRBASE_DSP_SAMPLESOURCEFIFODB_H_ +#define SDRBASE_DSP_SAMPLESOURCEFIFODB_H_ #include #include @@ -25,13 +25,13 @@ #include "export.h" #include "dsp/dsptypes.h" -class SDRBASE_API SampleSourceFifo : public QObject { +class SDRBASE_API SampleSourceFifoDB : public QObject { Q_OBJECT public: - SampleSourceFifo(uint32_t size, QObject* parent = nullptr); - SampleSourceFifo(const SampleSourceFifo& other); - ~SampleSourceFifo(); + SampleSourceFifoDB(uint32_t size, QObject* parent = nullptr); + SampleSourceFifoDB(const SampleSourceFifoDB& other); + ~SampleSourceFifoDB(); void resize(uint32_t size); uint32_t size() const { return m_size; } diff --git a/sdrbase/dsp/threadedbasebandsamplesource.cpp b/sdrbase/dsp/threadedbasebandsamplesource.cpp index e21acf561..5b3e4cb56 100644 --- a/sdrbase/dsp/threadedbasebandsamplesource.cpp +++ b/sdrbase/dsp/threadedbasebandsamplesource.cpp @@ -64,7 +64,7 @@ void ThreadedBasebandSampleSource::pull(Sample& sample) m_basebandSampleSource->pull(sample); } -void ThreadedBasebandSampleSource::feed(SampleSourceFifo* sampleFifo, +void ThreadedBasebandSampleSource::feed(SampleSourceFifoDB* sampleFifo, int nbSamples) { m_basebandSampleSource->feed(sampleFifo, nbSamples); diff --git a/sdrbase/dsp/threadedbasebandsamplesource.h b/sdrbase/dsp/threadedbasebandsamplesource.h index 0184c3e51..862123800 100644 --- a/sdrbase/dsp/threadedbasebandsamplesource.h +++ b/sdrbase/dsp/threadedbasebandsamplesource.h @@ -48,11 +48,11 @@ public: void pullAudio(int nbSamples) { if (m_basebandSampleSource) m_basebandSampleSource->pullAudio(nbSamples); } /** direct feeding of sample source FIFO */ - void feed(SampleSourceFifo* sampleFifo, + void feed(SampleSourceFifoDB* sampleFifo, int nbSamples); - SampleSourceFifo& getSampleSourceFifo() { return m_basebandSampleSource->getSampleSourceFifo(); } - void setDeviceSampleSourceFifo(SampleSourceFifo *deviceSampleFifo) { m_basebandSampleSource->setDeviceSampleSourceFifo(deviceSampleFifo); } + SampleSourceFifoDB& getSampleSourceFifo() { return m_basebandSampleSource->getSampleSourceFifo(); } + void setDeviceSampleSourceFifo(SampleSourceFifoDB *deviceSampleFifo) { m_basebandSampleSource->setDeviceSampleSourceFifo(deviceSampleFifo); } QString getSampleSourceObjectName() const;