diff --git a/CMakeLists.txt b/CMakeLists.txt index 956d719ed..1f5d6b0dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,7 +120,7 @@ set(sdrbase_SOURCES sdrbase/dsp/spectrumscopecombovis.cpp sdrbase/dsp/scopevis.cpp sdrbase/dsp/spectrumvis.cpp - sdrbase/dsp/threadedsamplesink.cpp + sdrbase/dsp/threadedbasebandsamplesink.cpp sdrbase/gui/aboutdialog.cpp sdrbase/gui/addpresetdialog.cpp @@ -209,7 +209,7 @@ set(sdrbase_HEADERS sdrbase/dsp/nullsink.h sdrbase/dsp/scopevis.h sdrbase/dsp/spectrumvis.h - sdrbase/dsp/threadedsamplesink.h + sdrbase/dsp/threadedbasebandsamplesink.h sdrbase/gui/aboutdialog.h sdrbase/gui/addpresetdialog.h diff --git a/doc/model/SDRangelFlow.odg b/doc/model/SDRangelFlow.odg index b68d5f00f..aa6ad094f 100644 Binary files a/doc/model/SDRangelFlow.odg and b/doc/model/SDRangelFlow.odg differ diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.cpp b/plugins/channelrx/chanalyzer/chanalyzergui.cpp index fe978a8a0..56921b1b6 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzergui.cpp @@ -19,8 +19,9 @@ #include #include #include + +#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h" #include "ui_chanalyzergui.h" -#include "dsp/threadedsamplesink.h" #include "dsp/spectrumscopecombovis.h" #include "dsp/spectrumvis.h" #include "dsp/scopevis.h" @@ -327,7 +328,7 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAP m_spectrumScopeComboVis = new SpectrumScopeComboVis(m_spectrumVis, m_scopeVis); m_channelAnalyzer = new ChannelAnalyzer(m_spectrumScopeComboVis); m_channelizer = new DownChannelizer(m_channelAnalyzer); - m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); + m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged())); m_deviceAPI->addThreadedSink(m_threadedChannelizer); diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.h b/plugins/channelrx/chanalyzer/chanalyzergui.h index ba8db688a..b94671793 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.h +++ b/plugins/channelrx/chanalyzer/chanalyzergui.h @@ -25,7 +25,7 @@ class PluginAPI; class DeviceAPI; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DownChannelizer; class ChannelAnalyzer; class SpectrumScopeComboVis; @@ -80,7 +80,7 @@ private: int m_spanLog2; MovingAverage m_channelPowerDbAvg; - ThreadedSampleSink* m_threadedChannelizer; + ThreadedBasebandSampleSink* m_threadedChannelizer; DownChannelizer* m_channelizer; ChannelAnalyzer* m_channelAnalyzer; SpectrumScopeComboVis* m_spectrumScopeComboVis; diff --git a/plugins/channelrx/demodam/amdemodgui.cpp b/plugins/channelrx/demodam/amdemodgui.cpp index 5a166f705..62ac7bf1b 100644 --- a/plugins/channelrx/demodam/amdemodgui.cpp +++ b/plugins/channelrx/demodam/amdemodgui.cpp @@ -3,8 +3,9 @@ #include #include #include + +#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h" #include "ui_amdemodgui.h" -#include "dsp/threadedsamplesink.h" #include "plugin/pluginapi.h" #include "device/deviceapi.h" #include "util/simpleserializer.h" @@ -221,7 +222,7 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pare m_amDemod = new AMDemod(); m_channelizer = new DownChannelizer(m_amDemod); - m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); + m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); //m_pluginAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addThreadedSink(m_threadedChannelizer); diff --git a/plugins/channelrx/demodam/amdemodgui.h b/plugins/channelrx/demodam/amdemodgui.h index 37fe5c2a6..99facaa59 100644 --- a/plugins/channelrx/demodam/amdemodgui.h +++ b/plugins/channelrx/demodam/amdemodgui.h @@ -9,7 +9,7 @@ class PluginAPI; class DeviceAPI; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DownChannelizer; class AMDemod; @@ -58,7 +58,7 @@ private: bool m_basicSettingsShown; bool m_doApplySettings; - ThreadedSampleSink* m_threadedChannelizer; + ThreadedBasebandSampleSink* m_threadedChannelizer; DownChannelizer* m_channelizer; AMDemod* m_amDemod; MovingAverage m_channelPowerDbAvg; diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.cpp b/plugins/channelrx/demodbfm/bfmdemodgui.cpp index 0c1556e98..a84d7d0ea 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.cpp +++ b/plugins/channelrx/demodbfm/bfmdemodgui.cpp @@ -26,7 +26,7 @@ #include #include -#include "dsp/threadedsamplesink.h" +#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h" #include "dsp/dspengine.h" #include "dsp/spectrumvis.h" #include "gui/glspectrum.h" @@ -382,7 +382,7 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa m_spectrumVis = new SpectrumVis(ui->glSpectrum); m_bfmDemod = new BFMDemod(m_spectrumVis, &m_rdsParser); m_channelizer = new DownChannelizer(m_bfmDemod); - m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); + m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged())); m_deviceAPI->addThreadedSink(m_threadedChannelizer); diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.h b/plugins/channelrx/demodbfm/bfmdemodgui.h index 6c079bbcd..892868efe 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.h +++ b/plugins/channelrx/demodbfm/bfmdemodgui.h @@ -28,7 +28,7 @@ class PluginAPI; class DeviceAPI; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DownChannelizer; class SpectrumVis; class BFMDemod; @@ -88,7 +88,7 @@ private: bool m_doApplySettings; int m_rdsTimerCount; - ThreadedSampleSink* m_threadedChannelizer; + ThreadedBasebandSampleSink* m_threadedChannelizer; DownChannelizer* m_channelizer; SpectrumVis* m_spectrumVis; RDSParser m_rdsParser; diff --git a/plugins/channelrx/demoddsd/dsddemodgui.cpp b/plugins/channelrx/demoddsd/dsddemodgui.cpp index f3207bb22..bc9643493 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.cpp +++ b/plugins/channelrx/demoddsd/dsddemodgui.cpp @@ -21,8 +21,9 @@ #include #include #include + +#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h" #include "ui_dsddemodgui.h" -#include "dsp/threadedsamplesink.h" #include "dsp/scopevis.h" #include "gui/glscope.h" #include "plugin/pluginapi.h" @@ -371,7 +372,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); m_channelizer = new DownChannelizer(m_dsdDemod); - m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); + m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); //m_channelMarker = new ChannelMarker(this); diff --git a/plugins/channelrx/demoddsd/dsddemodgui.h b/plugins/channelrx/demoddsd/dsddemodgui.h index 193ac03ca..20c533c0b 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.h +++ b/plugins/channelrx/demoddsd/dsddemodgui.h @@ -27,7 +27,7 @@ class PluginAPI; class DeviceAPI; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DownChannelizer; class ScopeVis; class DSDDemod; @@ -97,7 +97,7 @@ private: char m_formatStatusText[82+1]; //!< Fixed signal format dependent status text SignalFormat m_signalFormat; - ThreadedSampleSink* m_threadedChannelizer; + ThreadedBasebandSampleSink* m_threadedChannelizer; DownChannelizer* m_channelizer; ScopeVis* m_scopeVis; diff --git a/plugins/channelrx/demodlora/lorademodgui.cpp b/plugins/channelrx/demodlora/lorademodgui.cpp index b40addf69..3feb0a68b 100644 --- a/plugins/channelrx/demodlora/lorademodgui.cpp +++ b/plugins/channelrx/demodlora/lorademodgui.cpp @@ -4,9 +4,10 @@ #include #include #include + +#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h" #include "ui_lorademodgui.h" #include "ui_lorademodgui.h" -#include "dsp/threadedsamplesink.h" #include "dsp/spectrumvis.h" #include "gui/glspectrum.h" #include "plugin/pluginapi.h" @@ -167,7 +168,7 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* m_spectrumVis = new SpectrumVis(ui->glSpectrum); m_LoRaDemod = new LoRaDemod(m_spectrumVis); m_channelizer = new DownChannelizer(m_LoRaDemod); - m_threadedChannelizer = new ThreadedSampleSink(m_channelizer); + m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer); m_deviceAPI->addThreadedSink(m_threadedChannelizer); ui->glSpectrum->setCenterFrequency(16000); diff --git a/plugins/channelrx/demodlora/lorademodgui.h b/plugins/channelrx/demodlora/lorademodgui.h index 7e69721f0..6026b203d 100644 --- a/plugins/channelrx/demodlora/lorademodgui.h +++ b/plugins/channelrx/demodlora/lorademodgui.h @@ -9,7 +9,7 @@ class PluginAPI; class DeviceAPI; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DownChannelizer; class LoRaDemod; class SpectrumVis; @@ -53,7 +53,7 @@ private: bool m_basicSettingsShown; bool m_doApplySettings; - ThreadedSampleSink* m_threadedChannelizer; + ThreadedBasebandSampleSink* m_threadedChannelizer; DownChannelizer* m_channelizer; LoRaDemod* m_LoRaDemod; SpectrumVis* m_spectrumVis; diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.cpp b/plugins/channelrx/demodnfm/nfmdemodgui.cpp index e045b746e..5050f5646 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodgui.cpp @@ -4,8 +4,9 @@ #include #include #include + +#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h" #include "ui_nfmdemodgui.h" -#include "dsp/threadedsamplesink.h" #include "dsp/nullsink.h" #include "plugin/pluginapi.h" #include "device/deviceapi.h" @@ -293,7 +294,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); m_channelizer = new DownChannelizer(m_nfmDemod); - m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); + m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); //m_channelMarker = new ChannelMarker(this); diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.h b/plugins/channelrx/demodnfm/nfmdemodgui.h index 43df1d9a0..c7254191c 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.h +++ b/plugins/channelrx/demodnfm/nfmdemodgui.h @@ -10,7 +10,7 @@ class PluginAPI; class DeviceAPI; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DownChannelizer; class NFMDemod; @@ -63,7 +63,7 @@ private: bool m_basicSettingsShown; bool m_doApplySettings; - ThreadedSampleSink* m_threadedChannelizer; + ThreadedBasebandSampleSink* m_threadedChannelizer; DownChannelizer* m_channelizer; NFMDemod* m_nfmDemod; bool m_ctcssOn; diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index d573a045b..b8326e80e 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -4,9 +4,10 @@ #include #include #include + +#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h" #include "ui_ssbdemodgui.h" #include "ui_ssbdemodgui.h" -#include "dsp/threadedsamplesink.h" #include "dsp/spectrumvis.h" #include "gui/glspectrum.h" #include "plugin/pluginapi.h" @@ -342,7 +343,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa m_spectrumVis = new SpectrumVis(ui->glSpectrum); m_ssbDemod = new SSBDemod(m_spectrumVis); m_channelizer = new DownChannelizer(m_ssbDemod); - m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); + m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); diff --git a/plugins/channelrx/demodssb/ssbdemodgui.h b/plugins/channelrx/demodssb/ssbdemodgui.h index 6b649379a..227ad8a48 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.h +++ b/plugins/channelrx/demodssb/ssbdemodgui.h @@ -10,7 +10,7 @@ class PluginAPI; class DeviceAPI; class AudioFifo; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DownChannelizer; class SSBDemod; class SpectrumVis; @@ -70,7 +70,7 @@ private: bool m_audioMute; MovingAverage m_channelPowerDbAvg; - ThreadedSampleSink* m_threadedChannelizer; + ThreadedBasebandSampleSink* m_threadedChannelizer; DownChannelizer* m_channelizer; SSBDemod* m_ssbDemod; SpectrumVis* m_spectrumVis; diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.cpp b/plugins/channelrx/demodwfm/wfmdemodgui.cpp index 257d7902f..d143ace95 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.cpp +++ b/plugins/channelrx/demodwfm/wfmdemodgui.cpp @@ -4,8 +4,9 @@ #include #include #include + +#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h" #include "ui_wfmdemodgui.h" -#include "dsp/threadedsamplesink.h" #include "dsp/dspengine.h" #include "plugin/pluginapi.h" #include "device/deviceapi.h" @@ -236,7 +237,7 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa m_wfmDemod = new WFMDemod(0); m_channelizer = new DownChannelizer(m_wfmDemod); - m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); + m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.h b/plugins/channelrx/demodwfm/wfmdemodgui.h index 66396fafb..96cf76345 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.h +++ b/plugins/channelrx/demodwfm/wfmdemodgui.h @@ -9,7 +9,7 @@ class PluginAPI; class DeviceAPI; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DownChannelizer; class WFMDemod; @@ -57,7 +57,7 @@ private: bool m_basicSettingsShown; bool m_doApplySettings; - ThreadedSampleSink* m_threadedChannelizer; + ThreadedBasebandSampleSink* m_threadedChannelizer; DownChannelizer* m_channelizer; WFMDemod* m_wfmDemod; MovingAverage m_channelPowerDbAvg; diff --git a/plugins/channelrx/tcpsrc/tcpsrcgui.cpp b/plugins/channelrx/tcpsrc/tcpsrcgui.cpp index d5dab99ae..f3f05118d 100644 --- a/plugins/channelrx/tcpsrc/tcpsrcgui.cpp +++ b/plugins/channelrx/tcpsrc/tcpsrcgui.cpp @@ -1,9 +1,9 @@ #include "../../channelrx/tcpsrc/tcpsrcgui.h" #include +#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h" #include "plugin/pluginapi.h" #include "device/deviceapi.h" -#include "dsp/threadedsamplesink.h" #include "dsp/spectrumvis.h" #include "dsp/dspengine.h" #include "util/simpleserializer.h" @@ -203,7 +203,7 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent m_spectrumVis = new SpectrumVis(ui->glSpectrum); m_tcpSrc = new TCPSrc(m_pluginAPI->getMainWindowMessageQueue(), this, m_spectrumVis); m_channelizer = new DownChannelizer(m_tcpSrc); - m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); + m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); diff --git a/plugins/channelrx/tcpsrc/tcpsrcgui.h b/plugins/channelrx/tcpsrc/tcpsrcgui.h index 6da22ac3e..4a313ebbf 100644 --- a/plugins/channelrx/tcpsrc/tcpsrcgui.h +++ b/plugins/channelrx/tcpsrc/tcpsrcgui.h @@ -11,7 +11,7 @@ class PluginAPI; class DeviceAPI; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DownChannelizer; class TCPSrc; class SpectrumVis; @@ -72,7 +72,7 @@ private: bool m_doApplySettings; // RF path - ThreadedSampleSink* m_threadedChannelizer; + ThreadedBasebandSampleSink* m_threadedChannelizer; DownChannelizer* m_channelizer; SpectrumVis* m_spectrumVis; diff --git a/plugins/channelrx/udpsrc/udpsrcgui.cpp b/plugins/channelrx/udpsrc/udpsrcgui.cpp index adbe21037..69336ffbe 100644 --- a/plugins/channelrx/udpsrc/udpsrcgui.cpp +++ b/plugins/channelrx/udpsrc/udpsrcgui.cpp @@ -18,9 +18,9 @@ #include "../../channelrx/udpsrc/udpsrcgui.h" #include +#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h" #include "plugin/pluginapi.h" #include "device/deviceapi.h" -#include "dsp/threadedsamplesink.h" #include "dsp/spectrumvis.h" #include "dsp/dspengine.h" #include "util/simpleserializer.h" @@ -241,7 +241,7 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent m_spectrumVis = new SpectrumVis(ui->glSpectrum); m_udpSrc = new UDPSrc(m_pluginAPI->getMainWindowMessageQueue(), this, m_spectrumVis); m_channelizer = new DownChannelizer(m_udpSrc); - m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); + m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); ui->fmDeviation->setEnabled(false); diff --git a/plugins/channelrx/udpsrc/udpsrcgui.h b/plugins/channelrx/udpsrc/udpsrcgui.h index edb99df72..e1b851f80 100644 --- a/plugins/channelrx/udpsrc/udpsrcgui.h +++ b/plugins/channelrx/udpsrc/udpsrcgui.h @@ -28,7 +28,7 @@ class PluginAPI; class DeviceAPI; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DownChannelizer; class UDPSrc; class SpectrumVis; @@ -101,7 +101,7 @@ private: bool m_doApplySettings; // RF path - ThreadedSampleSink* m_threadedChannelizer; + ThreadedBasebandSampleSink* m_threadedChannelizer; DownChannelizer* m_channelizer; SpectrumVis* m_spectrumVis; diff --git a/sdrbase/device/deviceapi.cpp b/sdrbase/device/deviceapi.cpp index 94d65cf75..ca9004689 100644 --- a/sdrbase/device/deviceapi.cpp +++ b/sdrbase/device/deviceapi.cpp @@ -52,12 +52,12 @@ void DeviceAPI::removeSink(BasebandSampleSink* sink) m_deviceEngine->removeSink(sink); } -void DeviceAPI::addThreadedSink(ThreadedSampleSink* sink) +void DeviceAPI::addThreadedSink(ThreadedBasebandSampleSink* sink) { m_deviceEngine->addThreadedSink(sink); } -void DeviceAPI::removeThreadedSink(ThreadedSampleSink* sink) +void DeviceAPI::removeThreadedSink(ThreadedBasebandSampleSink* sink) { m_deviceEngine->removeThreadedSink(sink); } diff --git a/sdrbase/device/deviceapi.h b/sdrbase/device/deviceapi.h index 2a5ae9053..c155d1d7f 100644 --- a/sdrbase/device/deviceapi.h +++ b/sdrbase/device/deviceapi.h @@ -29,7 +29,7 @@ class DSPDeviceEngine; class GLSpectrum; class ChannelWindow; class BasebandSampleSink; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class DeviceSampleSource; class MessageQueue; class ChannelMarker; @@ -45,8 +45,8 @@ public: // Device engine stuff 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 addThreadedSink(ThreadedBasebandSampleSink* sink); //!< Add a sample sink that will run on its own thread to device engine + void removeThreadedSink(ThreadedBasebandSampleSink* sink); //!< Remove a sample sink that runs on its own thread from device engine void setSource(DeviceSampleSource* source); //!< Set device engine sample source type bool initAcquisition(); //!< Initialize device engine acquisition sequence bool startAcquisition(); //!< Start device engine acquisition sequence diff --git a/sdrbase/dsp/dspcommands.h b/sdrbase/dsp/dspcommands.h index bdbf699e6..a6a585f2c 100644 --- a/sdrbase/dsp/dspcommands.h +++ b/sdrbase/dsp/dspcommands.h @@ -25,7 +25,7 @@ class DeviceSampleSource; class BasebandSampleSink; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class AudioFifo; class SDRANGEL_API DSPExit : public Message { @@ -106,24 +106,24 @@ class SDRANGEL_API DSPAddThreadedSampleSink : public Message { MESSAGE_CLASS_DECLARATION public: - DSPAddThreadedSampleSink(ThreadedSampleSink* threadedSampleSink) : Message(), m_threadedSampleSink(threadedSampleSink) { } + DSPAddThreadedSampleSink(ThreadedBasebandSampleSink* threadedSampleSink) : Message(), m_threadedSampleSink(threadedSampleSink) { } - ThreadedSampleSink* getThreadedSampleSink() const { return m_threadedSampleSink; } + ThreadedBasebandSampleSink* getThreadedSampleSink() const { return m_threadedSampleSink; } private: - ThreadedSampleSink* m_threadedSampleSink; + ThreadedBasebandSampleSink* m_threadedSampleSink; }; class SDRANGEL_API DSPRemoveThreadedSampleSink : public Message { MESSAGE_CLASS_DECLARATION public: - DSPRemoveThreadedSampleSink(ThreadedSampleSink* threadedSampleSink) : Message(), m_threadedSampleSink(threadedSampleSink) { } + DSPRemoveThreadedSampleSink(ThreadedBasebandSampleSink* threadedSampleSink) : Message(), m_threadedSampleSink(threadedSampleSink) { } - ThreadedSampleSink* getThreadedSampleSink() const { return m_threadedSampleSink; } + ThreadedBasebandSampleSink* getThreadedSampleSink() const { return m_threadedSampleSink; } private: - ThreadedSampleSink* m_threadedSampleSink; + ThreadedBasebandSampleSink* m_threadedSampleSink; }; class SDRANGEL_API DSPAddAudioSink : public Message { diff --git a/sdrbase/dsp/dspdeviceengine.cpp b/sdrbase/dsp/dspdeviceengine.cpp index 0fa476101..371ba0ff2 100644 --- a/sdrbase/dsp/dspdeviceengine.cpp +++ b/sdrbase/dsp/dspdeviceengine.cpp @@ -22,8 +22,8 @@ #include #include "dsp/dspdeviceengine.h" #include "dsp/samplefifo.h" -#include "dsp/threadedsamplesink.h" #include "dsp/dspcommands.h" +#include "threadedbasebandsamplesink.h" DSPDeviceEngine::DSPDeviceEngine(uint uid, QObject* parent) : m_uid(uid), @@ -132,14 +132,14 @@ void DSPDeviceEngine::removeSink(BasebandSampleSink* sink) m_syncMessenger.sendWait(cmd); } -void DSPDeviceEngine::addThreadedSink(ThreadedSampleSink* sink) +void DSPDeviceEngine::addThreadedSink(ThreadedBasebandSampleSink* sink) { qDebug() << "DSPDeviceEngine::addThreadedSink: " << sink->objectName().toStdString().c_str(); DSPAddThreadedSampleSink cmd(sink); m_syncMessenger.sendWait(cmd); } -void DSPDeviceEngine::removeThreadedSink(ThreadedSampleSink* sink) +void DSPDeviceEngine::removeThreadedSink(ThreadedBasebandSampleSink* sink) { qDebug() << "DSPDeviceEngine::removeThreadedSink: " << sink->objectName().toStdString().c_str(); DSPRemoveThreadedSampleSink cmd(sink); @@ -562,13 +562,13 @@ void DSPDeviceEngine::handleSynchronousMessages() } else if (DSPAddThreadedSampleSink::match(*message)) { - ThreadedSampleSink *threadedSink = ((DSPAddThreadedSampleSink*) message)->getThreadedSampleSink(); + ThreadedBasebandSampleSink *threadedSink = ((DSPAddThreadedSampleSink*) message)->getThreadedSampleSink(); m_threadedSampleSinks.push_back(threadedSink); threadedSink->start(); } else if (DSPRemoveThreadedSampleSink::match(*message)) { - ThreadedSampleSink* threadedSink = ((DSPRemoveThreadedSampleSink*) message)->getThreadedSampleSink(); + ThreadedBasebandSampleSink* threadedSink = ((DSPRemoveThreadedSampleSink*) message)->getThreadedSampleSink(); threadedSink->stop(); m_threadedSampleSinks.remove(threadedSink); } diff --git a/sdrbase/dsp/dspdeviceengine.h b/sdrbase/dsp/dspdeviceengine.h index ce8441155..c46b039fd 100644 --- a/sdrbase/dsp/dspdeviceengine.h +++ b/sdrbase/dsp/dspdeviceengine.h @@ -31,7 +31,7 @@ class DeviceSampleSource; class BasebandSampleSink; -class ThreadedSampleSink; +class ThreadedBasebandSampleSink; class SDRANGEL_API DSPDeviceEngine : public QThread { Q_OBJECT @@ -66,8 +66,8 @@ public: 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 + void addThreadedSink(ThreadedBasebandSampleSink* sink); //!< Add a sample sink that will run on its own thread + void removeThreadedSink(ThreadedBasebandSampleSink* sink); //!< Remove a sample sink that runs on its own thread void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection); //!< Configure DSP corrections @@ -94,7 +94,7 @@ private: typedef std::list SampleSinks; SampleSinks m_sampleSinks; //!< sample sinks within main thread (usually spectrum, file output) - typedef std::list ThreadedSampleSinks; + typedef std::list ThreadedSampleSinks; ThreadedSampleSinks m_threadedSampleSinks; //!< sample sinks on their own threads (usually channels) uint m_sampleRate; diff --git a/sdrbase/dsp/dspengine.h b/sdrbase/dsp/dspengine.h index bf3228ff6..90593fab5 100644 --- a/sdrbase/dsp/dspengine.h +++ b/sdrbase/dsp/dspengine.h @@ -1,97 +1,97 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2015 F4EXB // -// written by Edouard Griffiths // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDE_DSPENGINE_H -#define INCLUDE_DSPENGINE_H - -#include -#include -#include "dsp/dspdeviceengine.h" -#include "audio/audiooutput.h" -#include "util/export.h" -#ifdef DSD_USE_SERIALDV -#include "dsp/dvserialengine.h" -#endif - -class DSPDeviceEngine; -class ThreadedSampleSink; - -class SDRANGEL_API DSPEngine : public QObject { - Q_OBJECT -public: - DSPEngine(); - ~DSPEngine(); - - static DSPEngine *instance(); - - uint getAudioSampleRate() const { return m_audioSampleRate; } - - DSPDeviceEngine *addDeviceEngine(); - void removeLastDeviceEngine(); - void stopAllAcquisitions(); - void stopAllDeviceEngines(); - - void startAudio(); - void stopAudio(); - void startAudioImmediate(); - void stopAudioImmediate(); - - DSPDeviceEngine *getDeviceEngineByIndex(uint deviceIndex) { return m_deviceEngines[deviceIndex]; } - DSPDeviceEngine *getDeviceEngineByUID(uint uid); - - void addAudioSink(AudioFifo* audioFifo); //!< Add the audio sink - void removeAudioSink(AudioFifo* audioFifo); //!< Remove the audio sink - - // Serial DV methods: - - bool hasDVSerialSupport() - { -#ifdef DSD_USE_SERIALDV - return m_dvSerialSupport; -#else - return false; -#endif - } - - void setDVSerialSupport(bool support); - - void getDVSerialNames(std::vector& deviceNames) - { -#ifdef DSD_USE_SERIALDV - m_dvSerialEngine.getDevicesNames(deviceNames); -#endif - } - - void pushMbeFrame(const unsigned char *mbeFrame, int mbeRateIndex, int mbeVolumeIndex, unsigned char channels, AudioFifo *audioFifo) - { -#ifdef DSD_USE_SERIALDV - m_dvSerialEngine.pushMbeFrame(mbeFrame, mbeRateIndex, mbeVolumeIndex, channels, audioFifo); -#endif - } - -private: - std::vector m_deviceEngines; - uint m_deviceEnginesUIDSequence; - AudioOutput m_audioOutput; - uint m_audioSampleRate; - bool m_dvSerialSupport; -#ifdef DSD_USE_SERIALDV - DVSerialEngine m_dvSerialEngine; -#endif -}; - -#endif // INCLUDE_DSPENGINE_H +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2015 F4EXB // +// written by Edouard Griffiths // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_DSPENGINE_H +#define INCLUDE_DSPENGINE_H + +#include +#include +#include "dsp/dspdeviceengine.h" +#include "audio/audiooutput.h" +#include "util/export.h" +#ifdef DSD_USE_SERIALDV +#include "dsp/dvserialengine.h" +#endif + +class DSPDeviceEngine; +class ThreadedBasebandSampleSink; + +class SDRANGEL_API DSPEngine : public QObject { + Q_OBJECT +public: + DSPEngine(); + ~DSPEngine(); + + static DSPEngine *instance(); + + uint getAudioSampleRate() const { return m_audioSampleRate; } + + DSPDeviceEngine *addDeviceEngine(); + void removeLastDeviceEngine(); + void stopAllAcquisitions(); + void stopAllDeviceEngines(); + + void startAudio(); + void stopAudio(); + void startAudioImmediate(); + void stopAudioImmediate(); + + DSPDeviceEngine *getDeviceEngineByIndex(uint deviceIndex) { return m_deviceEngines[deviceIndex]; } + DSPDeviceEngine *getDeviceEngineByUID(uint uid); + + void addAudioSink(AudioFifo* audioFifo); //!< Add the audio sink + void removeAudioSink(AudioFifo* audioFifo); //!< Remove the audio sink + + // Serial DV methods: + + bool hasDVSerialSupport() + { +#ifdef DSD_USE_SERIALDV + return m_dvSerialSupport; +#else + return false; +#endif + } + + void setDVSerialSupport(bool support); + + void getDVSerialNames(std::vector& deviceNames) + { +#ifdef DSD_USE_SERIALDV + m_dvSerialEngine.getDevicesNames(deviceNames); +#endif + } + + void pushMbeFrame(const unsigned char *mbeFrame, int mbeRateIndex, int mbeVolumeIndex, unsigned char channels, AudioFifo *audioFifo) + { +#ifdef DSD_USE_SERIALDV + m_dvSerialEngine.pushMbeFrame(mbeFrame, mbeRateIndex, mbeVolumeIndex, channels, audioFifo); +#endif + } + +private: + std::vector m_deviceEngines; + uint m_deviceEnginesUIDSequence; + AudioOutput m_audioOutput; + uint m_audioSampleRate; + bool m_dvSerialSupport; +#ifdef DSD_USE_SERIALDV + DVSerialEngine m_dvSerialEngine; +#endif +}; + +#endif // INCLUDE_DSPENGINE_H diff --git a/sdrbase/dsp/threadedsamplesink.cpp b/sdrbase/dsp/threadedbasebandsamplesink.cpp similarity index 70% rename from sdrbase/dsp/threadedsamplesink.cpp rename to sdrbase/dsp/threadedbasebandsamplesink.cpp index b17aadce3..4db107ca4 100644 --- a/sdrbase/dsp/threadedsamplesink.cpp +++ b/sdrbase/dsp/threadedbasebandsamplesink.cpp @@ -1,27 +1,28 @@ +#include "threadedbasebandsamplesink.h" + #include #include -#include "dsp/threadedsamplesink.h" #include "dsp/dspcommands.h" #include "util/message.h" -ThreadedSampleFifo::ThreadedSampleFifo(BasebandSampleSink *sampleSink, std::size_t size) : +ThreadedBasebandSampleFifo::ThreadedBasebandSampleFifo(BasebandSampleSink *sampleSink, std::size_t size) : m_sampleSink(sampleSink) { connect(&m_sampleFifo, SIGNAL(dataReady()), this, SLOT(handleFifoData())); m_sampleFifo.setSize(size); } -ThreadedSampleFifo::~ThreadedSampleFifo() +ThreadedBasebandSampleFifo::~ThreadedBasebandSampleFifo() { m_sampleFifo.readCommit(m_sampleFifo.fill()); } -void ThreadedSampleFifo::writeToFifo(SampleVector::const_iterator& begin, SampleVector::const_iterator& end) +void ThreadedBasebandSampleFifo::writeToFifo(SampleVector::const_iterator& begin, SampleVector::const_iterator& end) { m_sampleFifo.write(begin, end); } -void ThreadedSampleFifo::handleFifoData() // FIXME: Fixed? Move it to the new threadable sink class +void ThreadedBasebandSampleFifo::handleFifoData() // FIXME: Fixed? Move it to the new threadable sink class { bool positiveOnly = false; @@ -62,7 +63,7 @@ void ThreadedSampleFifo::handleFifoData() // FIXME: Fixed? Move it to the new th } } -ThreadedSampleSink::ThreadedSampleSink(BasebandSampleSink* sampleSink, QObject *parent) : +ThreadedBasebandSampleSink::ThreadedBasebandSampleSink(BasebandSampleSink* sampleSink, QObject *parent) : m_sampleSink(sampleSink) { QString name = "ThreadedSampleSink(" + m_sampleSink->objectName() + ")"; @@ -71,7 +72,7 @@ ThreadedSampleSink::ThreadedSampleSink(BasebandSampleSink* sampleSink, QObject * qDebug() << "ThreadedSampleSink::ThreadedSampleSink: " << name; m_thread = new QThread(parent); - m_threadedSampleFifo = new ThreadedSampleFifo(m_sampleSink); + m_threadedSampleFifo = new ThreadedBasebandSampleFifo(m_sampleSink); //moveToThread(m_thread); // FIXME: Fixed? the intermediate FIFO should be handled within the sink. Define a new type of sink that is compatible with threading m_sampleSink->moveToThread(m_thread); m_threadedSampleFifo->moveToThread(m_thread); @@ -82,20 +83,20 @@ ThreadedSampleSink::ThreadedSampleSink(BasebandSampleSink* sampleSink, QObject * qDebug() << "ThreadedSampleSink::ThreadedSampleSink: thread: " << thread() << " m_thread: " << m_thread; } -ThreadedSampleSink::~ThreadedSampleSink() +ThreadedBasebandSampleSink::~ThreadedBasebandSampleSink() { delete m_threadedSampleFifo; // Valgrind memcheck delete m_thread; } -void ThreadedSampleSink::start() +void ThreadedBasebandSampleSink::start() { qDebug() << "ThreadedSampleSink::start"; m_thread->start(); m_sampleSink->start(); } -void ThreadedSampleSink::stop() +void ThreadedBasebandSampleSink::stop() { qDebug() << "ThreadedSampleSink::stop"; m_sampleSink->stop(); @@ -103,19 +104,19 @@ void ThreadedSampleSink::stop() m_thread->wait(); } -void ThreadedSampleSink::feed(SampleVector::const_iterator begin, SampleVector::const_iterator end, bool positiveOnly) +void ThreadedBasebandSampleSink::feed(SampleVector::const_iterator begin, SampleVector::const_iterator end, bool positiveOnly) { //m_sampleSink->feed(begin, end, positiveOnly); //m_sampleFifo.write(begin, end); m_threadedSampleFifo->writeToFifo(begin, end); } -bool ThreadedSampleSink::handleSinkMessage(const Message& cmd) +bool ThreadedBasebandSampleSink::handleSinkMessage(const Message& cmd) { return m_sampleSink->handleMessage(cmd); } -QString ThreadedSampleSink::getSampleSinkObjectName() const +QString ThreadedBasebandSampleSink::getSampleSinkObjectName() const { return m_sampleSink->objectName(); } diff --git a/sdrbase/dsp/threadedsamplesink.h b/sdrbase/dsp/threadedbasebandsamplesink.h similarity index 87% rename from sdrbase/dsp/threadedsamplesink.h rename to sdrbase/dsp/threadedbasebandsamplesink.h index 5184fe1c7..2d19cc4a2 100644 --- a/sdrbase/dsp/threadedsamplesink.h +++ b/sdrbase/dsp/threadedbasebandsamplesink.h @@ -31,12 +31,12 @@ class QThread; * Because Qt is a piece of shit this class cannot be a nested protected class of ThreadedSampleSink * So let's make everything public */ -class ThreadedSampleFifo : public QObject { +class ThreadedBasebandSampleFifo : public QObject { Q_OBJECT public: - ThreadedSampleFifo(BasebandSampleSink* sampleSink, std::size_t size = 1<<18); - ~ThreadedSampleFifo(); + ThreadedBasebandSampleFifo(BasebandSampleSink* sampleSink, std::size_t size = 1<<18); + ~ThreadedBasebandSampleFifo(); void writeToFifo(SampleVector::const_iterator& begin, SampleVector::const_iterator& end); BasebandSampleSink* m_sampleSink; @@ -49,12 +49,12 @@ public slots: /** * This class is a wrapper for SampleSink that runs the SampleSink object in its own thread */ -class SDRANGEL_API ThreadedSampleSink : public QObject { +class SDRANGEL_API ThreadedBasebandSampleSink : public QObject { Q_OBJECT public: - ThreadedSampleSink(BasebandSampleSink* sampleSink, QObject *parent = 0); - ~ThreadedSampleSink(); + ThreadedBasebandSampleSink(BasebandSampleSink* sampleSink, QObject *parent = 0); + ~ThreadedBasebandSampleSink(); const BasebandSampleSink *getSink() const { return m_sampleSink; } MessageQueue* getInputMessageQueue() { return m_sampleSink->getInputMessageQueue(); } //!< Return pointer to sample sink's input message queue @@ -71,7 +71,7 @@ public: protected: QThread *m_thread; //!< The thead object - ThreadedSampleFifo *m_threadedSampleFifo; + ThreadedBasebandSampleFifo *m_threadedSampleFifo; BasebandSampleSink* m_sampleSink; }; diff --git a/sdrbase/sdrbase.pro b/sdrbase/sdrbase.pro index e165fa63d..2aa2681ac 100644 --- a/sdrbase/sdrbase.pro +++ b/sdrbase/sdrbase.pro @@ -61,7 +61,7 @@ SOURCES += mainwindow.cpp\ dsp/spectrumscopecombovis.cpp\ dsp/scopevis.cpp\ dsp/spectrumvis.cpp\ - dsp/threadedsamplesink.cpp\ + dsp/threadedbasebandsamplesink.cpp\ gui/aboutdialog.cpp\ gui/addpresetdialog.cpp\ gui/basicchannelsettingswidget.cpp\ @@ -140,7 +140,7 @@ HEADERS += mainwindow.h\ dsp/nullsink.h\ dsp/scopevis.h\ dsp/spectrumvis.h\ - dsp/threadedsamplesink.h\ + dsp/threadedbasebandsamplesink.h\ gui/aboutdialog.h\ gui/addpresetdialog.h\ gui/audiodialog.h\