From 78513854ac5eab16ad4ae75c3b5db4268e7cbbbe Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 2 Oct 2016 22:29:04 +0200 Subject: [PATCH] RxTx semantic move: renamed SampleSink to BasebandSampleSink --- CMakeLists.txt | 4 ++-- plugins/channelrx/chanalyzer/chanalyzer.cpp | 2 +- plugins/channelrx/chanalyzer/chanalyzer.h | 8 ++++---- plugins/channelrx/demodam/amdemod.h | 4 ++-- plugins/channelrx/demodbfm/bfmdemod.cpp | 2 +- plugins/channelrx/demodbfm/bfmdemod.h | 8 ++++---- plugins/channelrx/demoddsd/dsddemod.cpp | 2 +- plugins/channelrx/demoddsd/dsddemod.h | 8 ++++---- plugins/channelrx/demodlora/lorademod.cpp | 2 +- plugins/channelrx/demodlora/lorademod.h | 8 ++++---- plugins/channelrx/demodnfm/nfmdemod.h | 4 ++-- plugins/channelrx/demodssb/ssbdemod.cpp | 2 +- plugins/channelrx/demodssb/ssbdemod.h | 8 ++++---- plugins/channelrx/demodwfm/wfmdemod.cpp | 2 +- plugins/channelrx/demodwfm/wfmdemod.h | 8 ++++---- plugins/channelrx/tcpsrc/tcpsrc.cpp | 2 +- plugins/channelrx/tcpsrc/tcpsrc.h | 8 ++++---- plugins/channelrx/udpsrc/udpsrc.cpp | 2 +- plugins/channelrx/udpsrc/udpsrc.h | 8 ++++---- sdrbase/device/deviceapi.cpp | 4 ++-- sdrbase/device/deviceapi.h | 6 +++--- .../dsp/{samplesink.cpp => basebandsamplesink.cpp} | 8 ++++---- sdrbase/dsp/{samplesink.h => basebandsamplesink.h} | 6 +++--- sdrbase/dsp/downchannelizer.cpp | 2 +- sdrbase/dsp/downchannelizer.h | 8 ++++---- sdrbase/dsp/dspcommands.h | 14 +++++++------- sdrbase/dsp/dspdeviceengine.cpp | 10 +++++----- sdrbase/dsp/dspdeviceengine.h | 8 ++++---- sdrbase/dsp/filerecord.cpp | 4 ++-- sdrbase/dsp/filerecord.h | 4 ++-- sdrbase/dsp/nullsink.h | 4 ++-- sdrbase/dsp/scopevis.h | 4 ++-- sdrbase/dsp/spectrumscopecombovis.h | 4 ++-- sdrbase/dsp/spectrumvis.cpp | 2 +- sdrbase/dsp/spectrumvis.h | 4 ++-- sdrbase/dsp/threadedsamplesink.cpp | 4 ++-- sdrbase/dsp/threadedsamplesink.h | 14 +++++++------- sdrbase/sdrbase.pro | 4 ++-- 38 files changed, 103 insertions(+), 103 deletions(-) rename sdrbase/dsp/{samplesink.cpp => basebandsamplesink.cpp} (62%) rename sdrbase/dsp/{samplesink.h => basebandsamplesink.h} (90%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e64ed404e..4fc0e8cb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,7 +115,7 @@ set(sdrbase_SOURCES sdrbase/dsp/pidcontroller.cpp sdrbase/dsp/phaselock.cpp sdrbase/dsp/samplefifo.cpp - sdrbase/dsp/samplesink.cpp + sdrbase/dsp/basebandsamplesink.cpp sdrbase/dsp/nullsink.cpp sdrbase/dsp/spectrumscopecombovis.cpp sdrbase/dsp/scopevis.cpp @@ -205,7 +205,7 @@ set(sdrbase_HEADERS sdrbase/dsp/phaselock.h sdrbase/dsp/pidcontroller.h sdrbase/dsp/samplefifo.h - sdrbase/dsp/samplesink.h + sdrbase/dsp/basebandsamplesink.h sdrbase/dsp/nullsink.h sdrbase/dsp/scopevis.h sdrbase/dsp/spectrumvis.h diff --git a/plugins/channelrx/chanalyzer/chanalyzer.cpp b/plugins/channelrx/chanalyzer/chanalyzer.cpp index d11c17f24..3fbbc8528 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzer.cpp @@ -25,7 +25,7 @@ MESSAGE_CLASS_DEFINITION(ChannelAnalyzer::MsgConfigureChannelAnalyzer, Message) -ChannelAnalyzer::ChannelAnalyzer(SampleSink* sampleSink) : +ChannelAnalyzer::ChannelAnalyzer(BasebandSampleSink* sampleSink) : m_sampleSink(sampleSink), m_settingsMutex(QMutex::Recursive) { diff --git a/plugins/channelrx/chanalyzer/chanalyzer.h b/plugins/channelrx/chanalyzer/chanalyzer.h index cfdca81e3..a2003e6fe 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.h +++ b/plugins/channelrx/chanalyzer/chanalyzer.h @@ -17,9 +17,9 @@ #ifndef INCLUDE_CHANALYZER_H #define INCLUDE_CHANALYZER_H +#include #include #include -#include "dsp/samplesink.h" #include "dsp/nco.h" #include "dsp/fftfilt.h" #include "audio/audiofifo.h" @@ -27,9 +27,9 @@ #define ssbFftLen 1024 -class ChannelAnalyzer : public SampleSink { +class ChannelAnalyzer : public BasebandSampleSink { public: - ChannelAnalyzer(SampleSink* m_sampleSink); + ChannelAnalyzer(BasebandSampleSink* m_sampleSink); virtual ~ChannelAnalyzer(); void configure(MessageQueue* messageQueue, @@ -98,7 +98,7 @@ private: fftfilt* SSBFilter; fftfilt* DSBFilter; - SampleSink* m_sampleSink; + BasebandSampleSink* m_sampleSink; SampleVector m_sampleBuffer; QMutex m_settingsMutex; }; diff --git a/plugins/channelrx/demodam/amdemod.h b/plugins/channelrx/demodam/amdemod.h index b37095a69..6f9558fd8 100644 --- a/plugins/channelrx/demodam/amdemod.h +++ b/plugins/channelrx/demodam/amdemod.h @@ -17,9 +17,9 @@ #ifndef INCLUDE_AMDEMOD_H #define INCLUDE_AMDEMOD_H +#include #include #include -#include "dsp/samplesink.h" #include "dsp/nco.h" #include "dsp/interpolator.h" #include "dsp/lowpass.h" @@ -28,7 +28,7 @@ #include "audio/audiofifo.h" #include "util/message.h" -class AMDemod : public SampleSink { +class AMDemod : public BasebandSampleSink { Q_OBJECT public: AMDemod(); diff --git a/plugins/channelrx/demodbfm/bfmdemod.cpp b/plugins/channelrx/demodbfm/bfmdemod.cpp index b51f0d6e6..d7ea77421 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.cpp +++ b/plugins/channelrx/demodbfm/bfmdemod.cpp @@ -34,7 +34,7 @@ MESSAGE_CLASS_DEFINITION(BFMDemod::MsgConfigureBFMDemod, Message) const Real BFMDemod::default_deemphasis = 50.0; // 50 us -BFMDemod::BFMDemod(SampleSink* sampleSink, RDSParser *rdsParser) : +BFMDemod::BFMDemod(BasebandSampleSink* sampleSink, RDSParser *rdsParser) : m_sampleSink(sampleSink), m_rdsParser(rdsParser), m_audioFifo(4, 250000), diff --git a/plugins/channelrx/demodbfm/bfmdemod.h b/plugins/channelrx/demodbfm/bfmdemod.h index eb6001e25..5e67bf08b 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.h +++ b/plugins/channelrx/demodbfm/bfmdemod.h @@ -18,9 +18,9 @@ #ifndef INCLUDE_BFMDEMOD_H #define INCLUDE_BFMDEMOD_H +#include #include #include -#include "dsp/samplesink.h" #include "dsp/nco.h" #include "dsp/interpolator.h" #include "dsp/lowpass.h" @@ -37,9 +37,9 @@ class RDSParser; -class BFMDemod : public SampleSink { +class BFMDemod : public BasebandSampleSink { public: - BFMDemod(SampleSink* sampleSink, RDSParser* rdsParser); + BFMDemod(BasebandSampleSink* sampleSink, RDSParser* rdsParser); virtual ~BFMDemod(); void configure(MessageQueue* messageQueue, @@ -201,7 +201,7 @@ private: AudioVector m_audioBuffer; uint m_audioBufferFill; - SampleSink* m_sampleSink; + BasebandSampleSink* m_sampleSink; AudioFifo m_audioFifo; SampleVector m_sampleBuffer; QMutex m_settingsMutex; diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index f67984699..e72f0d289 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -32,7 +32,7 @@ static const Real afSqTones[2] = {1200.0, 6400.0}; // {1200.0, 8000.0}; MESSAGE_CLASS_DEFINITION(DSDDemod::MsgConfigureDSDDemod, Message) MESSAGE_CLASS_DEFINITION(DSDDemod::MsgConfigureMyPosition, Message) -DSDDemod::DSDDemod(SampleSink* sampleSink) : +DSDDemod::DSDDemod(BasebandSampleSink* sampleSink) : m_sampleCount(0), m_squelchCount(0), m_squelchOpen(false), diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index 080637364..411a0dae7 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -18,10 +18,10 @@ #ifndef INCLUDE_DSDDEMOD_H #define INCLUDE_DSDDEMOD_H +#include #include #include #include -#include "dsp/samplesink.h" #include "dsp/nco.h" #include "dsp/interpolator.h" #include "dsp/lowpass.h" @@ -36,9 +36,9 @@ class DSDDemodGUI; -class DSDDemod : public SampleSink { +class DSDDemod : public BasebandSampleSink { public: - DSDDemod(SampleSink* sampleSink); + DSDDemod(BasebandSampleSink* sampleSink); ~DSDDemod(); void configure(MessageQueue* messageQueue, @@ -264,7 +264,7 @@ private: AudioFifo m_audioFifo1; AudioFifo m_audioFifo2; - SampleSink* m_scope; + BasebandSampleSink* m_scope; bool m_scopeEnabled; DSDDecoder m_dsdDecoder; diff --git a/plugins/channelrx/demodlora/lorademod.cpp b/plugins/channelrx/demodlora/lorademod.cpp index 9f935500b..43d88cc63 100644 --- a/plugins/channelrx/demodlora/lorademod.cpp +++ b/plugins/channelrx/demodlora/lorademod.cpp @@ -26,7 +26,7 @@ MESSAGE_CLASS_DEFINITION(LoRaDemod::MsgConfigureLoRaDemod, Message) -LoRaDemod::LoRaDemod(SampleSink* sampleSink) : +LoRaDemod::LoRaDemod(BasebandSampleSink* sampleSink) : m_sampleSink(sampleSink), m_settingsMutex(QMutex::Recursive) { diff --git a/plugins/channelrx/demodlora/lorademod.h b/plugins/channelrx/demodlora/lorademod.h index d8858e8e0..4e7c5db7b 100644 --- a/plugins/channelrx/demodlora/lorademod.h +++ b/plugins/channelrx/demodlora/lorademod.h @@ -18,9 +18,9 @@ #ifndef INCLUDE_LoRaDEMOD_H #define INCLUDE_LoRaDEMOD_H +#include #include #include -#include "dsp/samplesink.h" #include "dsp/nco.h" #include "dsp/interpolator.h" #include "util/message.h" @@ -32,9 +32,9 @@ #define LORA_SFFT_LEN (SPREADFACTOR / 2) #define LORA_SQUELCH (3) -class LoRaDemod : public SampleSink { +class LoRaDemod : public BasebandSampleSink { public: - LoRaDemod(SampleSink* sampleSink); + LoRaDemod(BasebandSampleSink* sampleSink); virtual ~LoRaDemod(); void configure(MessageQueue* messageQueue, Real Bandwidth); @@ -96,7 +96,7 @@ private: Interpolator m_interpolator; Real m_sampleDistanceRemain; - SampleSink* m_sampleSink; + BasebandSampleSink* m_sampleSink; SampleVector m_sampleBuffer; QMutex m_settingsMutex; }; diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index 38bc44dab..66f7d5f9d 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -18,10 +18,10 @@ #ifndef INCLUDE_NFMDEMOD_H #define INCLUDE_NFMDEMOD_H +#include #include #include #include -#include "dsp/samplesink.h" #include "dsp/nco.h" #include "dsp/interpolator.h" #include "dsp/lowpass.h" @@ -35,7 +35,7 @@ class NFMDemodGUI; -class NFMDemod : public SampleSink { +class NFMDemod : public BasebandSampleSink { public: NFMDemod(); ~NFMDemod(); diff --git a/plugins/channelrx/demodssb/ssbdemod.cpp b/plugins/channelrx/demodssb/ssbdemod.cpp index e4530fe9b..5b89e437e 100644 --- a/plugins/channelrx/demodssb/ssbdemod.cpp +++ b/plugins/channelrx/demodssb/ssbdemod.cpp @@ -27,7 +27,7 @@ MESSAGE_CLASS_DEFINITION(SSBDemod::MsgConfigureSSBDemod, Message) -SSBDemod::SSBDemod(SampleSink* sampleSink) : +SSBDemod::SSBDemod(BasebandSampleSink* sampleSink) : m_sampleSink(sampleSink), m_audioFifo(4, 24000), m_settingsMutex(QMutex::Recursive), diff --git a/plugins/channelrx/demodssb/ssbdemod.h b/plugins/channelrx/demodssb/ssbdemod.h index e464a5682..ae81d9474 100644 --- a/plugins/channelrx/demodssb/ssbdemod.h +++ b/plugins/channelrx/demodssb/ssbdemod.h @@ -18,9 +18,9 @@ #ifndef INCLUDE_SSBDEMOD_H #define INCLUDE_SSBDEMOD_H +#include #include #include -#include "dsp/samplesink.h" #include "dsp/nco.h" #include "dsp/interpolator.h" #include "dsp/fftfilt.h" @@ -29,9 +29,9 @@ #define ssbFftLen 1024 -class SSBDemod : public SampleSink { +class SSBDemod : public BasebandSampleSink { public: - SSBDemod(SampleSink* sampleSink); + SSBDemod(BasebandSampleSink* sampleSink); virtual ~SSBDemod(); void configure(MessageQueue* messageQueue, @@ -135,7 +135,7 @@ private: fftfilt* SSBFilter; fftfilt* DSBFilter; - SampleSink* m_sampleSink; + BasebandSampleSink* m_sampleSink; SampleVector m_sampleBuffer; AudioVector m_audioBuffer; diff --git a/plugins/channelrx/demodwfm/wfmdemod.cpp b/plugins/channelrx/demodwfm/wfmdemod.cpp index 8ea896ce9..841707c6b 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.cpp +++ b/plugins/channelrx/demodwfm/wfmdemod.cpp @@ -28,7 +28,7 @@ MESSAGE_CLASS_DEFINITION(WFMDemod::MsgConfigureWFMDemod, Message) -WFMDemod::WFMDemod(SampleSink* sampleSink) : +WFMDemod::WFMDemod(BasebandSampleSink* sampleSink) : m_sampleSink(sampleSink), m_audioFifo(4, 250000), m_settingsMutex(QMutex::Recursive) diff --git a/plugins/channelrx/demodwfm/wfmdemod.h b/plugins/channelrx/demodwfm/wfmdemod.h index 15881a67e..b90b5a085 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.h +++ b/plugins/channelrx/demodwfm/wfmdemod.h @@ -18,9 +18,9 @@ #ifndef INCLUDE_WFMDEMOD_H #define INCLUDE_WFMDEMOD_H +#include #include #include -#include "dsp/samplesink.h" #include "dsp/nco.h" #include "dsp/interpolator.h" #include "dsp/lowpass.h" @@ -32,9 +32,9 @@ #define rfFilterFftLength 1024 -class WFMDemod : public SampleSink { +class WFMDemod : public BasebandSampleSink { public: - WFMDemod(SampleSink* sampleSink); + WFMDemod(BasebandSampleSink* sampleSink); virtual ~WFMDemod(); void configure(MessageQueue* messageQueue, Real rfBandwidth, Real afBandwidth, Real volume, Real squelch); @@ -127,7 +127,7 @@ private: AudioVector m_audioBuffer; uint m_audioBufferFill; - SampleSink* m_sampleSink; + BasebandSampleSink* m_sampleSink; AudioFifo m_audioFifo; SampleVector m_sampleBuffer; QMutex m_settingsMutex; diff --git a/plugins/channelrx/tcpsrc/tcpsrc.cpp b/plugins/channelrx/tcpsrc/tcpsrc.cpp index e151b22e0..1ed8a73d1 100644 --- a/plugins/channelrx/tcpsrc/tcpsrc.cpp +++ b/plugins/channelrx/tcpsrc/tcpsrc.cpp @@ -26,7 +26,7 @@ MESSAGE_CLASS_DEFINITION(TCPSrc::MsgTCPSrcConfigure, Message) MESSAGE_CLASS_DEFINITION(TCPSrc::MsgTCPSrcConnection, Message) MESSAGE_CLASS_DEFINITION(TCPSrc::MsgTCPSrcSpectrum, Message) -TCPSrc::TCPSrc(MessageQueue* uiMessageQueue, TCPSrcGUI* tcpSrcGUI, SampleSink* spectrum) : +TCPSrc::TCPSrc(MessageQueue* uiMessageQueue, TCPSrcGUI* tcpSrcGUI, BasebandSampleSink* spectrum) : m_settingsMutex(QMutex::Recursive) { setObjectName("TCPSrc"); diff --git a/plugins/channelrx/tcpsrc/tcpsrc.h b/plugins/channelrx/tcpsrc/tcpsrc.h index 836ae36f6..c4b48e6db 100644 --- a/plugins/channelrx/tcpsrc/tcpsrc.h +++ b/plugins/channelrx/tcpsrc/tcpsrc.h @@ -1,9 +1,9 @@ #ifndef INCLUDE_TCPSRC_H #define INCLUDE_TCPSRC_H +#include #include #include -#include "dsp/samplesink.h" #include "dsp/nco.h" #include "dsp/fftfilt.h" #include "dsp/interpolator.h" @@ -15,7 +15,7 @@ class QTcpServer; class QTcpSocket; class TCPSrcGUI; -class TCPSrc : public SampleSink { +class TCPSrc : public BasebandSampleSink { Q_OBJECT public: @@ -26,7 +26,7 @@ public: FormatNone }; - TCPSrc(MessageQueue* uiMessageQueue, TCPSrcGUI* tcpSrcGUI, SampleSink* spectrum); + TCPSrc(MessageQueue* uiMessageQueue, TCPSrcGUI* tcpSrcGUI, BasebandSampleSink* spectrum); virtual ~TCPSrc(); void configure(MessageQueue* messageQueue, SampleFormat sampleFormat, Real outputSampleRate, Real rfBandwidth, int tcpPort, int boost); @@ -160,7 +160,7 @@ protected: SampleVector m_sampleBuffer; SampleVector m_sampleBufferSSB; - SampleSink* m_spectrum; + BasebandSampleSink* m_spectrum; bool m_spectrumEnabled; QTcpServer* m_tcpServer; diff --git a/plugins/channelrx/udpsrc/udpsrc.cpp b/plugins/channelrx/udpsrc/udpsrc.cpp index 03d37ebac..28cc681e4 100644 --- a/plugins/channelrx/udpsrc/udpsrc.cpp +++ b/plugins/channelrx/udpsrc/udpsrc.cpp @@ -29,7 +29,7 @@ MESSAGE_CLASS_DEFINITION(UDPSrc::MsgUDPSrcConfigure, Message) MESSAGE_CLASS_DEFINITION(UDPSrc::MsgUDPSrcConfigureImmediate, Message) MESSAGE_CLASS_DEFINITION(UDPSrc::MsgUDPSrcSpectrum, Message) -UDPSrc::UDPSrc(MessageQueue* uiMessageQueue, UDPSrcGUI* udpSrcGUI, SampleSink* spectrum) : +UDPSrc::UDPSrc(MessageQueue* uiMessageQueue, UDPSrcGUI* udpSrcGUI, BasebandSampleSink* spectrum) : m_settingsMutex(QMutex::Recursive), m_udpPort(9999), m_audioFifo(4, 24000), diff --git a/plugins/channelrx/udpsrc/udpsrc.h b/plugins/channelrx/udpsrc/udpsrc.h index 28348be2f..8facbf799 100644 --- a/plugins/channelrx/udpsrc/udpsrc.h +++ b/plugins/channelrx/udpsrc/udpsrc.h @@ -18,9 +18,9 @@ #ifndef INCLUDE_UDPSRC_H #define INCLUDE_UDPSRC_H +#include #include #include -#include "dsp/samplesink.h" #include "dsp/nco.h" #include "dsp/fftfilt.h" #include "dsp/interpolator.h" @@ -33,7 +33,7 @@ class QUdpSocket; class UDPSrcGUI; -class UDPSrc : public SampleSink { +class UDPSrc : public BasebandSampleSink { Q_OBJECT public: @@ -56,7 +56,7 @@ public: typedef std::vector AudioVector; - UDPSrc(MessageQueue* uiMessageQueue, UDPSrcGUI* udpSrcGUI, SampleSink* spectrum); + UDPSrc(MessageQueue* uiMessageQueue, UDPSrcGUI* udpSrcGUI, BasebandSampleSink* spectrum); virtual ~UDPSrc(); void configure(MessageQueue* messageQueue, @@ -239,7 +239,7 @@ protected: uint m_audioBufferFill; AudioFifo m_audioFifo; - SampleSink* m_spectrum; + BasebandSampleSink* m_spectrum; bool m_spectrumEnabled; quint32 m_nextSSBId; diff --git a/sdrbase/device/deviceapi.cpp b/sdrbase/device/deviceapi.cpp index b5354df7d..370b80171 100644 --- a/sdrbase/device/deviceapi.cpp +++ b/sdrbase/device/deviceapi.cpp @@ -42,12 +42,12 @@ DeviceAPI::~DeviceAPI() { } -void DeviceAPI::addSink(SampleSink *sink) +void DeviceAPI::addSink(BasebandSampleSink *sink) { m_deviceEngine->addSink(sink); } -void DeviceAPI::removeSink(SampleSink* sink) +void DeviceAPI::removeSink(BasebandSampleSink* sink) { m_deviceEngine->removeSink(sink); } diff --git a/sdrbase/device/deviceapi.h b/sdrbase/device/deviceapi.h index a389b015e..787e2fa23 100644 --- a/sdrbase/device/deviceapi.h +++ b/sdrbase/device/deviceapi.h @@ -28,7 +28,7 @@ class MainWindow; class DSPDeviceEngine; class GLSpectrum; class ChannelWindow; -class SampleSink; +class BasebandSampleSink; class ThreadedSampleSink; class SampleSource; class MessageQueue; @@ -43,8 +43,8 @@ class SDRANGEL_API DeviceAPI : public QObject { public: // Device engine stuff - void addSink(SampleSink* sink); //!< Add a sample sink to device engine - void removeSink(SampleSink* sink); //!< Remove a sample sink from device engine + void addSink(BasebandSampleSink* sink); //!< Add a sample sink to device engine + void removeSink(BasebandSampleSink* sink); //!< Remove a sample sink from device engine void addThreadedSink(ThreadedSampleSink* sink); //!< Add a sample sink that will run on its own thread to device engine void removeThreadedSink(ThreadedSampleSink* sink); //!< Remove a sample sink that runs on its own thread from device engine void setSource(SampleSource* source); //!< Set device engine sample source type diff --git a/sdrbase/dsp/samplesink.cpp b/sdrbase/dsp/basebandsamplesink.cpp similarity index 62% rename from sdrbase/dsp/samplesink.cpp rename to sdrbase/dsp/basebandsamplesink.cpp index 242c32e83..dac936700 100644 --- a/sdrbase/dsp/samplesink.cpp +++ b/sdrbase/dsp/basebandsamplesink.cpp @@ -1,16 +1,16 @@ -#include "dsp/samplesink.h" +#include #include "util/message.h" -SampleSink::SampleSink() +BasebandSampleSink::BasebandSampleSink() { connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); } -SampleSink::~SampleSink() +BasebandSampleSink::~BasebandSampleSink() { } -void SampleSink::handleInputMessages() +void BasebandSampleSink::handleInputMessages() { Message* message; diff --git a/sdrbase/dsp/samplesink.h b/sdrbase/dsp/basebandsamplesink.h similarity index 90% rename from sdrbase/dsp/samplesink.h rename to sdrbase/dsp/basebandsamplesink.h index e4e39f5da..996d0ea6b 100644 --- a/sdrbase/dsp/samplesink.h +++ b/sdrbase/dsp/basebandsamplesink.h @@ -8,11 +8,11 @@ class Message; -class SDRANGEL_API SampleSink : public QObject { +class SDRANGEL_API BasebandSampleSink : public QObject { Q_OBJECT public: - SampleSink(); - virtual ~SampleSink(); + BasebandSampleSink(); + virtual ~BasebandSampleSink(); virtual void start() = 0; virtual void stop() = 0; diff --git a/sdrbase/dsp/downchannelizer.cpp b/sdrbase/dsp/downchannelizer.cpp index 1454091ce..2324b6ae9 100644 --- a/sdrbase/dsp/downchannelizer.cpp +++ b/sdrbase/dsp/downchannelizer.cpp @@ -7,7 +7,7 @@ MESSAGE_CLASS_DEFINITION(DownChannelizer::MsgChannelizerNotification, Message) -DownChannelizer::DownChannelizer(SampleSink* sampleSink) : +DownChannelizer::DownChannelizer(BasebandSampleSink* sampleSink) : m_sampleSink(sampleSink), m_inputSampleRate(0), m_requestedOutputSampleRate(0), diff --git a/sdrbase/dsp/downchannelizer.h b/sdrbase/dsp/downchannelizer.h index 4172ae6e6..9eb233078 100644 --- a/sdrbase/dsp/downchannelizer.h +++ b/sdrbase/dsp/downchannelizer.h @@ -1,16 +1,16 @@ #ifndef INCLUDE_CHANNELIZER_H #define INCLUDE_CHANNELIZER_H +#include #include #include -#include "dsp/samplesink.h" #include "util/export.h" #include "util/message.h" class MessageQueue; class IntHalfbandFilter; -class SDRANGEL_API DownChannelizer : public SampleSink { +class SDRANGEL_API DownChannelizer : public BasebandSampleSink { Q_OBJECT public: class SDRANGEL_API MsgChannelizerNotification : public Message { @@ -31,7 +31,7 @@ public: qint64 m_frequencyOffset; }; - DownChannelizer(SampleSink* sampleSink); + DownChannelizer(BasebandSampleSink* sampleSink); virtual ~DownChannelizer(); void configure(MessageQueue* messageQueue, int sampleRate, int centerFrequency); @@ -64,7 +64,7 @@ protected: }; typedef std::list FilterStages; FilterStages m_filterStages; - SampleSink* m_sampleSink; + BasebandSampleSink* m_sampleSink; int m_inputSampleRate; int m_requestedOutputSampleRate; int m_requestedCenterFrequency; diff --git a/sdrbase/dsp/dspcommands.h b/sdrbase/dsp/dspcommands.h index a3140ea8e..1574bcc65 100644 --- a/sdrbase/dsp/dspcommands.h +++ b/sdrbase/dsp/dspcommands.h @@ -24,7 +24,7 @@ #include "util/export.h" class SampleSource; -class SampleSink; +class BasebandSampleSink; class ThreadedSampleSink; class AudioFifo; @@ -82,24 +82,24 @@ class SDRANGEL_API DSPAddSink : public Message { MESSAGE_CLASS_DECLARATION public: - DSPAddSink(SampleSink* sampleSink) : Message(), m_sampleSink(sampleSink) { } + DSPAddSink(BasebandSampleSink* sampleSink) : Message(), m_sampleSink(sampleSink) { } - SampleSink* getSampleSink() const { return m_sampleSink; } + BasebandSampleSink* getSampleSink() const { return m_sampleSink; } private: - SampleSink* m_sampleSink; + BasebandSampleSink* m_sampleSink; }; class SDRANGEL_API DSPRemoveSink : public Message { MESSAGE_CLASS_DECLARATION public: - DSPRemoveSink(SampleSink* sampleSink) : Message(), m_sampleSink(sampleSink) { } + DSPRemoveSink(BasebandSampleSink* sampleSink) : Message(), m_sampleSink(sampleSink) { } - SampleSink* getSampleSink() const { return m_sampleSink; } + BasebandSampleSink* getSampleSink() const { return m_sampleSink; } private: - SampleSink* m_sampleSink; + BasebandSampleSink* m_sampleSink; }; class SDRANGEL_API DSPAddThreadedSampleSink : public Message { diff --git a/sdrbase/dsp/dspdeviceengine.cpp b/sdrbase/dsp/dspdeviceengine.cpp index b9f41725e..e962c783b 100644 --- a/sdrbase/dsp/dspdeviceengine.cpp +++ b/sdrbase/dsp/dspdeviceengine.cpp @@ -15,12 +15,12 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include #include #include #include #include "dsp/dspdeviceengine.h" #include "dsp/samplefifo.h" -#include "dsp/samplesink.h" #include "dsp/threadedsamplesink.h" #include "dsp/dspcommands.h" #include "dsp/samplesource.h" @@ -118,14 +118,14 @@ void DSPDeviceEngine::setSourceSequence(int sequence) m_sampleSourceSequence = sequence; } -void DSPDeviceEngine::addSink(SampleSink* sink) +void DSPDeviceEngine::addSink(BasebandSampleSink* sink) { qDebug() << "DSPDeviceEngine::addSink: " << sink->objectName().toStdString().c_str(); DSPAddSink cmd(sink); m_syncMessenger.sendWait(cmd); } -void DSPDeviceEngine::removeSink(SampleSink* sink) +void DSPDeviceEngine::removeSink(BasebandSampleSink* sink) { qDebug() << "DSPDeviceEngine::removeSink: " << sink->objectName().toStdString().c_str(); DSPRemoveSink cmd(sink); @@ -547,12 +547,12 @@ void DSPDeviceEngine::handleSynchronousMessages() } else if (DSPAddSink::match(*message)) { - SampleSink* sink = ((DSPAddSink*) message)->getSampleSink(); + BasebandSampleSink* sink = ((DSPAddSink*) message)->getSampleSink(); m_sampleSinks.push_back(sink); } else if (DSPRemoveSink::match(*message)) { - SampleSink* sink = ((DSPRemoveSink*) message)->getSampleSink(); + BasebandSampleSink* sink = ((DSPRemoveSink*) message)->getSampleSink(); if(m_state == StRunning) { sink->stop(); diff --git a/sdrbase/dsp/dspdeviceengine.h b/sdrbase/dsp/dspdeviceengine.h index 18e406939..f33948ed7 100644 --- a/sdrbase/dsp/dspdeviceengine.h +++ b/sdrbase/dsp/dspdeviceengine.h @@ -30,7 +30,7 @@ #include "util/export.h" class SampleSource; -class SampleSink; +class BasebandSampleSink; class ThreadedSampleSink; class SDRANGEL_API DSPDeviceEngine : public QThread { @@ -63,8 +63,8 @@ public: void setSource(SampleSource* source); //!< Set the sample source type void setSourceSequence(int sequence); //!< Set the sample source sequence in type - void addSink(SampleSink* sink); //!< Add a sample sink - void removeSink(SampleSink* sink); //!< Remove a sample sink + void addSink(BasebandSampleSink* sink); //!< Add a sample sink + void removeSink(BasebandSampleSink* sink); //!< Remove a sample sink void addThreadedSink(ThreadedSampleSink* sink); //!< Add a sample sink that will run on its own thread void removeThreadedSink(ThreadedSampleSink* sink); //!< Remove a sample sink that runs on its own thread @@ -91,7 +91,7 @@ private: SampleSource* m_sampleSource; int m_sampleSourceSequence; - typedef std::list SampleSinks; + typedef std::list SampleSinks; SampleSinks m_sampleSinks; //!< sample sinks within main thread (usually spectrum, file output) typedef std::list ThreadedSampleSinks; diff --git a/sdrbase/dsp/filerecord.cpp b/sdrbase/dsp/filerecord.cpp index c19377313..1ae2f99b9 100644 --- a/sdrbase/dsp/filerecord.cpp +++ b/sdrbase/dsp/filerecord.cpp @@ -6,7 +6,7 @@ #include FileRecord::FileRecord() : - SampleSink(), + BasebandSampleSink(), m_fileName(std::string("test.sdriq")), m_sampleRate(0), m_centerFrequency(0), @@ -18,7 +18,7 @@ FileRecord::FileRecord() : } FileRecord::FileRecord(const std::string& filename) : - SampleSink(), + BasebandSampleSink(), m_fileName(std::string(filename)), m_sampleRate(0), m_centerFrequency(0), diff --git a/sdrbase/dsp/filerecord.h b/sdrbase/dsp/filerecord.h index 12dbcf815..9444966a3 100644 --- a/sdrbase/dsp/filerecord.h +++ b/sdrbase/dsp/filerecord.h @@ -1,17 +1,17 @@ #ifndef INCLUDE_FILESINK_H #define INCLUDE_FILESINK_H +#include #include #include #include #include -#include "dsp/samplesink.h" #include "util/export.h" class Message; -class SDRANGEL_API FileRecord : public SampleSink { +class SDRANGEL_API FileRecord : public BasebandSampleSink { public: struct Header diff --git a/sdrbase/dsp/nullsink.h b/sdrbase/dsp/nullsink.h index 4f87ae9b6..aef7240eb 100644 --- a/sdrbase/dsp/nullsink.h +++ b/sdrbase/dsp/nullsink.h @@ -1,12 +1,12 @@ #ifndef INCLUDE_NULLSINK_H #define INCLUDE_NULLSINK_H -#include "dsp/samplesink.h" +#include #include "util/export.h" class Message; -class SDRANGEL_API NullSink : public SampleSink { +class SDRANGEL_API NullSink : public BasebandSampleSink { public: NullSink(); diff --git a/sdrbase/dsp/scopevis.h b/sdrbase/dsp/scopevis.h index c28476db8..8cdfe9232 100644 --- a/sdrbase/dsp/scopevis.h +++ b/sdrbase/dsp/scopevis.h @@ -2,14 +2,14 @@ #define INCLUDE_SCOPEVIS_H #include -#include "dsp/samplesink.h" +#include #include "util/export.h" #include "util/message.h" class GLScope; class MessageQueue; -class SDRANGEL_API ScopeVis : public SampleSink { +class SDRANGEL_API ScopeVis : public BasebandSampleSink { public: enum TriggerChannel { TriggerFreeRun, diff --git a/sdrbase/dsp/spectrumscopecombovis.h b/sdrbase/dsp/spectrumscopecombovis.h index 04b2ceccd..bd0f84e8f 100644 --- a/sdrbase/dsp/spectrumscopecombovis.h +++ b/sdrbase/dsp/spectrumscopecombovis.h @@ -1,14 +1,14 @@ #ifndef INCLUDE_SPECTRUMSCOPECOMBOVIS_H #define INCLUDE_SPECTRUMSCOPECOMBOVIS_H -#include "dsp/samplesink.h" +#include #include "dsp/spectrumvis.h" #include "dsp/scopevis.h" #include "util/export.h" class Message; -class SDRANGEL_API SpectrumScopeComboVis : public SampleSink { +class SDRANGEL_API SpectrumScopeComboVis : public BasebandSampleSink { public: SpectrumScopeComboVis(SpectrumVis* spectrumVis, ScopeVis* scopeVis); diff --git a/sdrbase/dsp/spectrumvis.cpp b/sdrbase/dsp/spectrumvis.cpp index 9257ac727..9c3d67773 100644 --- a/sdrbase/dsp/spectrumvis.cpp +++ b/sdrbase/dsp/spectrumvis.cpp @@ -15,7 +15,7 @@ inline double log2f(double n) MESSAGE_CLASS_DEFINITION(SpectrumVis::MsgConfigureSpectrumVis, Message) SpectrumVis::SpectrumVis(GLSpectrum* glSpectrum) : - SampleSink(), + BasebandSampleSink(), m_fft(FFTEngine::create()), m_fftBuffer(MAX_FFT_SIZE), m_logPowerSpectrum(MAX_FFT_SIZE), diff --git a/sdrbase/dsp/spectrumvis.h b/sdrbase/dsp/spectrumvis.h index 46820dbd6..196858b5d 100644 --- a/sdrbase/dsp/spectrumvis.h +++ b/sdrbase/dsp/spectrumvis.h @@ -1,8 +1,8 @@ #ifndef INCLUDE_SPECTRUMVIS_H #define INCLUDE_SPECTRUMVIS_H +#include #include -#include "dsp/samplesink.h" #include "dsp/fftengine.h" #include "fftwindow.h" #include "util/export.h" @@ -11,7 +11,7 @@ class GLSpectrum; class MessageQueue; -class SDRANGEL_API SpectrumVis : public SampleSink { +class SDRANGEL_API SpectrumVis : public BasebandSampleSink { public: class SDRANGEL_API MsgConfigureSpectrumVis : public Message { diff --git a/sdrbase/dsp/threadedsamplesink.cpp b/sdrbase/dsp/threadedsamplesink.cpp index 1cce36092..b17aadce3 100644 --- a/sdrbase/dsp/threadedsamplesink.cpp +++ b/sdrbase/dsp/threadedsamplesink.cpp @@ -4,7 +4,7 @@ #include "dsp/dspcommands.h" #include "util/message.h" -ThreadedSampleFifo::ThreadedSampleFifo(SampleSink *sampleSink, std::size_t size) : +ThreadedSampleFifo::ThreadedSampleFifo(BasebandSampleSink *sampleSink, std::size_t size) : m_sampleSink(sampleSink) { connect(&m_sampleFifo, SIGNAL(dataReady()), this, SLOT(handleFifoData())); @@ -62,7 +62,7 @@ void ThreadedSampleFifo::handleFifoData() // FIXME: Fixed? Move it to the new th } } -ThreadedSampleSink::ThreadedSampleSink(SampleSink* sampleSink, QObject *parent) : +ThreadedSampleSink::ThreadedSampleSink(BasebandSampleSink* sampleSink, QObject *parent) : m_sampleSink(sampleSink) { QString name = "ThreadedSampleSink(" + m_sampleSink->objectName() + ")"; diff --git a/sdrbase/dsp/threadedsamplesink.h b/sdrbase/dsp/threadedsamplesink.h index 82999d3d8..5184fe1c7 100644 --- a/sdrbase/dsp/threadedsamplesink.h +++ b/sdrbase/dsp/threadedsamplesink.h @@ -18,13 +18,13 @@ #ifndef INCLUDE_THREADEDSAMPLESINK_H #define INCLUDE_THREADEDSAMPLESINK_H +#include #include -#include "samplesink.h" #include "dsp/samplefifo.h" #include "util/messagequeue.h" #include "util/export.h" -class SampleSink; +class BasebandSampleSink; class QThread; /** @@ -35,11 +35,11 @@ class ThreadedSampleFifo : public QObject { Q_OBJECT public: - ThreadedSampleFifo(SampleSink* sampleSink, std::size_t size = 1<<18); + ThreadedSampleFifo(BasebandSampleSink* sampleSink, std::size_t size = 1<<18); ~ThreadedSampleFifo(); void writeToFifo(SampleVector::const_iterator& begin, SampleVector::const_iterator& end); - SampleSink* m_sampleSink; + BasebandSampleSink* m_sampleSink; SampleFifo m_sampleFifo; public slots: @@ -53,10 +53,10 @@ class SDRANGEL_API ThreadedSampleSink : public QObject { Q_OBJECT public: - ThreadedSampleSink(SampleSink* sampleSink, QObject *parent = 0); + ThreadedSampleSink(BasebandSampleSink* sampleSink, QObject *parent = 0); ~ThreadedSampleSink(); - const SampleSink *getSink() const { return m_sampleSink; } + const BasebandSampleSink *getSink() const { return m_sampleSink; } MessageQueue* getInputMessageQueue() { return m_sampleSink->getInputMessageQueue(); } //!< Return pointer to sample sink's input message queue MessageQueue* getOutputMessageQueue() { return m_sampleSink->getOutputMessageQueue(); } //!< Return pointer to sample sink's output message queue @@ -72,7 +72,7 @@ protected: QThread *m_thread; //!< The thead object ThreadedSampleFifo *m_threadedSampleFifo; - SampleSink* m_sampleSink; + BasebandSampleSink* m_sampleSink; }; #endif // INCLUDE_THREADEDSAMPLESINK_H diff --git a/sdrbase/sdrbase.pro b/sdrbase/sdrbase.pro index 792f9b573..072f4b303 100644 --- a/sdrbase/sdrbase.pro +++ b/sdrbase/sdrbase.pro @@ -56,7 +56,7 @@ SOURCES += mainwindow.cpp\ dsp/pidcontroller.cpp\ dsp/phaselock.cpp\ dsp/samplefifo.cpp\ - dsp/samplesink.cpp\ + dsp/basebandsamplesink.cpp\ dsp/nullsink.cpp\ dsp/spectrumscopecombovis.cpp\ dsp/scopevis.cpp\ @@ -136,7 +136,7 @@ HEADERS += mainwindow.h\ dsp/phaselock.h\ dsp/pidcontroller.h\ dsp/samplefifo.h\ - dsp/samplesink.h\ + dsp/basebandsamplesink.h\ dsp/nullsink.h\ dsp/scopevis.h\ dsp/spectrumvis.h\