1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 01:18:38 -05:00

RxTx semantic move: renamed ThreadedSampleSink to ThreadedBasebandSampleSink

This commit is contained in:
f4exb 2016-10-03 15:55:16 +02:00
parent d1fc02e303
commit dce0ace4ef
31 changed files with 190 additions and 182 deletions

View File

@ -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

Binary file not shown.

View File

@ -19,8 +19,9 @@
#include <dsp/downchannelizer.h>
#include <QDockWidget>
#include <QMainWindow>
#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);

View File

@ -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<Real> m_channelPowerDbAvg;
ThreadedSampleSink* m_threadedChannelizer;
ThreadedBasebandSampleSink* m_threadedChannelizer;
DownChannelizer* m_channelizer;
ChannelAnalyzer* m_channelAnalyzer;
SpectrumScopeComboVis* m_spectrumScopeComboVis;

View File

@ -3,8 +3,9 @@
#include <dsp/downchannelizer.h>
#include <QDockWidget>
#include <QMainWindow>
#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);

View File

@ -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<Real> m_channelPowerDbAvg;

View File

@ -26,7 +26,7 @@
#include <iostream>
#include <iomanip>
#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);

View File

@ -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;

View File

@ -21,8 +21,9 @@
#include <QDockWidget>
#include <QMainWindow>
#include <QDebug>
#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);

View File

@ -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;

View File

@ -4,9 +4,10 @@
#include <dsp/downchannelizer.h>
#include <QDockWidget>
#include <QMainWindow>
#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);

View File

@ -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;

View File

@ -4,8 +4,9 @@
#include <QDockWidget>
#include <QMainWindow>
#include <QDebug>
#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);

View File

@ -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;

View File

@ -4,9 +4,10 @@
#include <dsp/downchannelizer.h>
#include <QDockWidget>
#include <QMainWindow>
#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));

View File

@ -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<Real> m_channelPowerDbAvg;
ThreadedSampleSink* m_threadedChannelizer;
ThreadedBasebandSampleSink* m_threadedChannelizer;
DownChannelizer* m_channelizer;
SSBDemod* m_ssbDemod;
SpectrumVis* m_spectrumVis;

View File

@ -4,8 +4,9 @@
#include <QDockWidget>
#include <QMainWindow>
#include <QDebug>
#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()));

View File

@ -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<Real> m_channelPowerDbAvg;

View File

@ -1,9 +1,9 @@
#include "../../channelrx/tcpsrc/tcpsrcgui.h"
#include <dsp/downchannelizer.h>
#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));

View File

@ -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;

View File

@ -18,9 +18,9 @@
#include "../../channelrx/udpsrc/udpsrcgui.h"
#include <dsp/downchannelizer.h>
#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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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

View File

@ -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 {

View File

@ -22,8 +22,8 @@
#include <QDebug>
#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);
}

View File

@ -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<BasebandSampleSink*> SampleSinks;
SampleSinks m_sampleSinks; //!< sample sinks within main thread (usually spectrum, file output)
typedef std::list<ThreadedSampleSink*> ThreadedSampleSinks;
typedef std::list<ThreadedBasebandSampleSink*> ThreadedSampleSinks;
ThreadedSampleSinks m_threadedSampleSinks; //!< sample sinks on their own threads (usually channels)
uint m_sampleRate;

View File

@ -28,7 +28,7 @@
#endif
class DSPDeviceEngine;
class ThreadedSampleSink;
class ThreadedBasebandSampleSink;
class SDRANGEL_API DSPEngine : public QObject {
Q_OBJECT

View File

@ -1,27 +1,28 @@
#include "threadedbasebandsamplesink.h"
#include <QThread>
#include <QDebug>
#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();
}

View File

@ -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;
};

View File

@ -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\