From 7a535cc3b8247887e82639947eb56f9e657ba131 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 2 Oct 2016 23:16:40 +0200 Subject: [PATCH] RxTx semantic move: renamed SampleSource to DeviceSampleSource --- CMakeLists.txt | 4 +- plugins/samplesource/airspy/airspygui.h | 2 +- plugins/samplesource/airspy/airspyinput.h | 5 +- plugins/samplesource/bladerf/bladerfgui.h | 2 +- plugins/samplesource/bladerf/bladerfinput.h | 5 +- plugins/samplesource/fcdpro/fcdprogui.h | 2 +- plugins/samplesource/fcdpro/fcdproinput.h | 5 +- .../samplesource/fcdproplus/fcdproplusgui.h | 2 +- .../samplesource/fcdproplus/fcdproplusinput.h | 5 +- .../fcdproplus/fcdproplusinputqt.h | 5 +- .../samplesource/filesource/filesourcegui.h | 2 +- .../samplesource/filesource/filesourceinput.h | 4 +- plugins/samplesource/hackrf/hackrfgui.h | 2 +- plugins/samplesource/hackrf/hackrfinput.h | 4 +- plugins/samplesource/rtlsdr/rtlsdrgui.h | 2 +- plugins/samplesource/rtlsdr/rtlsdrinput.h | 5 +- plugins/samplesource/sdrdaemon/sdrdaemongui.h | 2 +- .../samplesource/sdrdaemon/sdrdaemoninput.h | 4 +- .../sdrdaemonfec/sdrdaemonfecgui.h | 2 +- .../sdrdaemonfec/sdrdaemonfecinput.h | 4 +- sdrbase/device/deviceapi.cpp | 2 +- sdrbase/device/deviceapi.h | 4 +- sdrbase/dsp/dspcommands.h | 8 +-- sdrbase/dsp/dspdeviceengine.cpp | 6 +- sdrbase/dsp/dspdeviceengine.h | 8 +-- sdrbase/dsp/samplesource.cpp | 40 ------------- sdrbase/dsp/samplesource.h | 56 ------------------- sdrbase/mainwindow.h | 2 +- sdrbase/sdrbase.pro | 4 +- 29 files changed, 54 insertions(+), 144 deletions(-) delete mode 100644 sdrbase/dsp/samplesource.cpp delete mode 100644 sdrbase/dsp/samplesource.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fc0e8cb7..956d719ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,7 +145,7 @@ set(sdrbase_SOURCES sdrbase/gui/scaleengine.cpp sdrbase/gui/valuedial.cpp - sdrbase/dsp/samplesource.cpp + sdrbase/dsp/devicesamplesource.cpp sdrbase/plugin/pluginapi.cpp #sdrbase/plugin/plugingui.cpp @@ -235,7 +235,7 @@ set(sdrbase_HEADERS sdrbase/gui/scaleengine.h sdrbase/gui/valuedial.h - sdrbase/dsp/samplesource.h + sdrbase/dsp/devicesamplesource.h sdrbase/plugin/pluginapi.h sdrbase/plugin/plugingui.h diff --git a/plugins/samplesource/airspy/airspygui.h b/plugins/samplesource/airspy/airspygui.h index 738b31e3b..23c7b78e6 100644 --- a/plugins/samplesource/airspy/airspygui.h +++ b/plugins/samplesource/airspy/airspygui.h @@ -60,7 +60,7 @@ private: QTimer m_updateTimer; QTimer m_statusTimer; std::vector m_rates; - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; FileRecord *m_fileSink; //!< File sink to record device I/Q output int m_sampleRate; quint64 m_deviceCenterFrequency; //!< Center frequency in device diff --git a/plugins/samplesource/airspy/airspyinput.h b/plugins/samplesource/airspy/airspyinput.h index 176b425b0..94bd5ef7f 100644 --- a/plugins/samplesource/airspy/airspyinput.h +++ b/plugins/samplesource/airspy/airspyinput.h @@ -17,7 +17,8 @@ #ifndef INCLUDE_AIRSPYINPUT_H #define INCLUDE_AIRSPYINPUT_H -#include "dsp/samplesource.h" +#include + #include "airspysettings.h" #include #include @@ -25,7 +26,7 @@ class DeviceAPI; class AirspyThread; -class AirspyInput : public SampleSource { +class AirspyInput : public DeviceSampleSource { public: class MsgConfigureAirspy : public Message { MESSAGE_CLASS_DECLARATION diff --git a/plugins/samplesource/bladerf/bladerfgui.h b/plugins/samplesource/bladerf/bladerfgui.h index 96313c8a5..d8fac68a5 100644 --- a/plugins/samplesource/bladerf/bladerfgui.h +++ b/plugins/samplesource/bladerf/bladerfgui.h @@ -56,7 +56,7 @@ private: QTimer m_updateTimer; QTimer m_statusTimer; std::vector m_gains; - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; FileRecord *m_fileSink; //!< File sink to record device I/Q output int m_sampleRate; quint64 m_deviceCenterFrequency; //!< Center frequency in device diff --git a/plugins/samplesource/bladerf/bladerfinput.h b/plugins/samplesource/bladerf/bladerfinput.h index 5d45b5563..a2f15da64 100644 --- a/plugins/samplesource/bladerf/bladerfinput.h +++ b/plugins/samplesource/bladerf/bladerfinput.h @@ -17,7 +17,8 @@ #ifndef INCLUDE_BLADERFINPUT_H #define INCLUDE_BLADERFINPUT_H -#include "dsp/samplesource.h" +#include + #include "bladerfsettings.h" #include #include @@ -25,7 +26,7 @@ class DeviceAPI; class BladerfThread; -class BladerfInput : public SampleSource { +class BladerfInput : public DeviceSampleSource { public: class MsgConfigureBladerf : public Message { MESSAGE_CLASS_DECLARATION diff --git a/plugins/samplesource/fcdpro/fcdprogui.h b/plugins/samplesource/fcdpro/fcdprogui.h index 8131ccbb4..52cb71c45 100644 --- a/plugins/samplesource/fcdpro/fcdprogui.h +++ b/plugins/samplesource/fcdpro/fcdprogui.h @@ -57,7 +57,7 @@ private: QTimer m_updateTimer; QTimer m_statusTimer; std::vector m_gains; - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; FileRecord *m_fileSink; //!< File sink to record device I/Q output int m_sampleRate; quint64 m_deviceCenterFrequency; //!< Center frequency in device diff --git a/plugins/samplesource/fcdpro/fcdproinput.h b/plugins/samplesource/fcdpro/fcdproinput.h index ac1dd5764..49f10ca4d 100644 --- a/plugins/samplesource/fcdpro/fcdproinput.h +++ b/plugins/samplesource/fcdpro/fcdproinput.h @@ -18,7 +18,8 @@ #ifndef INCLUDE_FCDPROINPUT_H #define INCLUDE_FCDPROINPUT_H -#include "dsp/samplesource.h" +#include + #include "fcdprosettings.h" #include "fcdhid.h" #include @@ -32,7 +33,7 @@ struct fcd_buffer { class DeviceAPI; class FCDProThread; -class FCDProInput : public SampleSource { +class FCDProInput : public DeviceSampleSource { public: class MsgConfigureFCD : public Message { MESSAGE_CLASS_DECLARATION diff --git a/plugins/samplesource/fcdproplus/fcdproplusgui.h b/plugins/samplesource/fcdproplus/fcdproplusgui.h index eca9ec86e..71b3b83e8 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusgui.h +++ b/plugins/samplesource/fcdproplus/fcdproplusgui.h @@ -56,7 +56,7 @@ private: QTimer m_updateTimer; QTimer m_statusTimer; std::vector m_gains; - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; FileRecord *m_fileSink; //!< File sink to record device I/Q output int m_sampleRate; quint64 m_deviceCenterFrequency; //!< Center frequency in device diff --git a/plugins/samplesource/fcdproplus/fcdproplusinput.h b/plugins/samplesource/fcdproplus/fcdproplusinput.h index b1b9ee65d..783bc27c1 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusinput.h +++ b/plugins/samplesource/fcdproplus/fcdproplusinput.h @@ -17,8 +17,9 @@ #ifndef INCLUDE_FCDINPUT_H #define INCLUDE_FCDINPUT_H +#include + #include "fcdproplussettings.h" -#include "dsp/samplesource.h" #include "fcdhid.h" #include #include @@ -31,7 +32,7 @@ struct fcd_buffer { class DeviceAPI; class FCDProPlusThread; -class FCDProPlusInput : public SampleSource { +class FCDProPlusInput : public DeviceSampleSource { public: class MsgConfigureFCD : public Message { MESSAGE_CLASS_DECLARATION diff --git a/plugins/samplesource/fcdproplus/fcdproplusinputqt.h b/plugins/samplesource/fcdproplus/fcdproplusinputqt.h index 4b3063f01..215af1856 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusinputqt.h +++ b/plugins/samplesource/fcdproplus/fcdproplusinputqt.h @@ -19,8 +19,9 @@ #ifndef INCLUDE_FCDINPUT_H #define INCLUDE_FCDINPUT_H +#include + #include "fcdproplussettings.h" -#include "dsp/samplesource.h" #include "fcdhid.h" #include #include @@ -32,7 +33,7 @@ struct fcd_buffer { class FCDProPlusReader; -class FCDProPlusInput : public SampleSource { +class FCDProPlusInput : public DeviceSampleSource { public: class MsgConfigureFCD : public Message { MESSAGE_CLASS_DECLARATION diff --git a/plugins/samplesource/filesource/filesourcegui.h b/plugins/samplesource/filesource/filesourcegui.h index a647ddfaf..fc3e43a1f 100644 --- a/plugins/samplesource/filesource/filesourcegui.h +++ b/plugins/samplesource/filesource/filesourcegui.h @@ -53,7 +53,7 @@ private: FileSourceInput::Settings m_settings; QTimer m_statusTimer; std::vector m_gains; - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; bool m_acquisition; QString m_fileName; int m_sampleRate; diff --git a/plugins/samplesource/filesource/filesourceinput.h b/plugins/samplesource/filesource/filesourceinput.h index eb624f936..e9a60a026 100644 --- a/plugins/samplesource/filesource/filesourceinput.h +++ b/plugins/samplesource/filesource/filesourceinput.h @@ -17,7 +17,7 @@ #ifndef INCLUDE_FILESOURCEINPUT_H #define INCLUDE_FILESOURCEINPUT_H -#include "dsp/samplesource.h" +#include #include #include #include @@ -26,7 +26,7 @@ class FileSourceThread; -class FileSourceInput : public SampleSource { +class FileSourceInput : public DeviceSampleSource { public: struct Settings { QString m_fileName; diff --git a/plugins/samplesource/hackrf/hackrfgui.h b/plugins/samplesource/hackrf/hackrfgui.h index 026b46a85..dbfddeac6 100644 --- a/plugins/samplesource/hackrf/hackrfgui.h +++ b/plugins/samplesource/hackrf/hackrfgui.h @@ -64,7 +64,7 @@ private: HackRFSettings m_settings; QTimer m_updateTimer; QTimer m_statusTimer; - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; FileRecord *m_fileSink; //!< File sink to record device I/Q output int m_sampleRate; quint64 m_deviceCenterFrequency; //!< Center frequency in device diff --git a/plugins/samplesource/hackrf/hackrfinput.h b/plugins/samplesource/hackrf/hackrfinput.h index f5634006f..1864838be 100644 --- a/plugins/samplesource/hackrf/hackrfinput.h +++ b/plugins/samplesource/hackrf/hackrfinput.h @@ -17,7 +17,7 @@ #ifndef INCLUDE_HACKRFINPUT_H #define INCLUDE_HACKRFINPUT_H -#include "dsp/samplesource.h" +#include #include "libhackrf/hackrf.h" #include "hackrfsettings.h" #include @@ -25,7 +25,7 @@ class DeviceAPI; class HackRFThread; -class HackRFInput : public SampleSource { +class HackRFInput : public DeviceSampleSource { public: class MsgConfigureHackRF : public Message { diff --git a/plugins/samplesource/rtlsdr/rtlsdrgui.h b/plugins/samplesource/rtlsdr/rtlsdrgui.h index d6c533def..7abd127f0 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrgui.h +++ b/plugins/samplesource/rtlsdr/rtlsdrgui.h @@ -55,7 +55,7 @@ private: QTimer m_updateTimer; QTimer m_statusTimer; std::vector m_gains; - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; FileRecord *m_fileSink; //!< File sink to record device I/Q output int m_sampleRate; quint64 m_deviceCenterFrequency; //!< Center frequency in device diff --git a/plugins/samplesource/rtlsdr/rtlsdrinput.h b/plugins/samplesource/rtlsdr/rtlsdrinput.h index eff008122..a8153efa9 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrinput.h +++ b/plugins/samplesource/rtlsdr/rtlsdrinput.h @@ -18,7 +18,8 @@ #ifndef INCLUDE_RTLSDRINPUT_H #define INCLUDE_RTLSDRINPUT_H -#include "dsp/samplesource.h" +#include + #include "rtlsdrsettings.h" #include #include @@ -26,7 +27,7 @@ class DeviceAPI; class RTLSDRThread; -class RTLSDRInput : public SampleSource { +class RTLSDRInput : public DeviceSampleSource { public: class MsgConfigureRTLSDR : public Message { MESSAGE_CLASS_DECLARATION diff --git a/plugins/samplesource/sdrdaemon/sdrdaemongui.h b/plugins/samplesource/sdrdaemon/sdrdaemongui.h index b44a31b32..cf7aa3389 100644 --- a/plugins/samplesource/sdrdaemon/sdrdaemongui.h +++ b/plugins/samplesource/sdrdaemon/sdrdaemongui.h @@ -54,7 +54,7 @@ private: DeviceAPI* m_deviceAPI; QTimer m_updateTimer; QTimer m_statusTimer; - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; bool m_acquisition; FileRecord *m_fileSink; //!< File sink to record device I/Q output int m_deviceSampleRate; diff --git a/plugins/samplesource/sdrdaemon/sdrdaemoninput.h b/plugins/samplesource/sdrdaemon/sdrdaemoninput.h index 6a162b8b9..c4568820d 100644 --- a/plugins/samplesource/sdrdaemon/sdrdaemoninput.h +++ b/plugins/samplesource/sdrdaemon/sdrdaemoninput.h @@ -17,7 +17,7 @@ #ifndef INCLUDE_SDRDAEMONINPUT_H #define INCLUDE_SDRDAEMONINPUT_H -#include "dsp/samplesource.h" +#include #include #include #include @@ -27,7 +27,7 @@ class DeviceAPI; class SDRdaemonUDPHandler; -class SDRdaemonInput : public SampleSource { +class SDRdaemonInput : public DeviceSampleSource { public: class MsgConfigureSDRdaemonUDPLink : public Message { MESSAGE_CLASS_DECLARATION diff --git a/plugins/samplesource/sdrdaemonfec/sdrdaemonfecgui.h b/plugins/samplesource/sdrdaemonfec/sdrdaemonfecgui.h index 1618cceab..8f249dc4b 100644 --- a/plugins/samplesource/sdrdaemonfec/sdrdaemonfecgui.h +++ b/plugins/samplesource/sdrdaemonfec/sdrdaemonfecgui.h @@ -54,7 +54,7 @@ private: DeviceAPI* m_deviceAPI; QTimer m_updateTimer; QTimer m_statusTimer; - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; bool m_acquisition; FileRecord *m_fileSink; //!< File sink to record device I/Q output int m_deviceSampleRate; diff --git a/plugins/samplesource/sdrdaemonfec/sdrdaemonfecinput.h b/plugins/samplesource/sdrdaemonfec/sdrdaemonfecinput.h index fe1a8500a..9052a2190 100644 --- a/plugins/samplesource/sdrdaemonfec/sdrdaemonfecinput.h +++ b/plugins/samplesource/sdrdaemonfec/sdrdaemonfecinput.h @@ -17,7 +17,7 @@ #ifndef INCLUDE_SDRDAEMONFECINPUT_H #define INCLUDE_SDRDAEMONFECINPUT_H -#include "dsp/samplesource.h" +#include #include #include #include @@ -27,7 +27,7 @@ class DeviceAPI; class SDRdaemonFECUDPHandler; -class SDRdaemonFECInput : public SampleSource { +class SDRdaemonFECInput : public DeviceSampleSource { public: class MsgConfigureSDRdaemonUDPLink : public Message { MESSAGE_CLASS_DECLARATION diff --git a/sdrbase/device/deviceapi.cpp b/sdrbase/device/deviceapi.cpp index 370b80171..94d65cf75 100644 --- a/sdrbase/device/deviceapi.cpp +++ b/sdrbase/device/deviceapi.cpp @@ -62,7 +62,7 @@ void DeviceAPI::removeThreadedSink(ThreadedSampleSink* sink) m_deviceEngine->removeThreadedSink(sink); } -void DeviceAPI::setSource(SampleSource* source) +void DeviceAPI::setSource(DeviceSampleSource* source) { m_deviceEngine->setSource(source); } diff --git a/sdrbase/device/deviceapi.h b/sdrbase/device/deviceapi.h index 787e2fa23..2a5ae9053 100644 --- a/sdrbase/device/deviceapi.h +++ b/sdrbase/device/deviceapi.h @@ -30,7 +30,7 @@ class GLSpectrum; class ChannelWindow; class BasebandSampleSink; class ThreadedSampleSink; -class SampleSource; +class DeviceSampleSource; class MessageQueue; class ChannelMarker; class QWidget; @@ -47,7 +47,7 @@ public: 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 + void setSource(DeviceSampleSource* source); //!< Set device engine sample source type bool initAcquisition(); //!< Initialize device engine acquisition sequence bool startAcquisition(); //!< Start device engine acquisition sequence void stopAcquisition(); //!< Stop device engine acquisition sequence diff --git a/sdrbase/dsp/dspcommands.h b/sdrbase/dsp/dspcommands.h index 1574bcc65..bdbf699e6 100644 --- a/sdrbase/dsp/dspcommands.h +++ b/sdrbase/dsp/dspcommands.h @@ -23,7 +23,7 @@ #include "fftwindow.h" #include "util/export.h" -class SampleSource; +class DeviceSampleSource; class BasebandSampleSink; class ThreadedSampleSink; class AudioFifo; @@ -70,12 +70,12 @@ class SDRANGEL_API DSPSetSource : public Message { MESSAGE_CLASS_DECLARATION public: - DSPSetSource(SampleSource* sampleSource) : Message(), m_sampleSource(sampleSource) { } + DSPSetSource(DeviceSampleSource* sampleSource) : Message(), m_sampleSource(sampleSource) { } - SampleSource* getSampleSource() const { return m_sampleSource; } + DeviceSampleSource* getSampleSource() const { return m_sampleSource; } private: - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; }; class SDRANGEL_API DSPAddSink : public Message { diff --git a/sdrbase/dsp/dspdeviceengine.cpp b/sdrbase/dsp/dspdeviceengine.cpp index e962c783b..0fa476101 100644 --- a/sdrbase/dsp/dspdeviceengine.cpp +++ b/sdrbase/dsp/dspdeviceengine.cpp @@ -16,6 +16,7 @@ /////////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -23,7 +24,6 @@ #include "dsp/samplefifo.h" #include "dsp/threadedsamplesink.h" #include "dsp/dspcommands.h" -#include "dsp/samplesource.h" DSPDeviceEngine::DSPDeviceEngine(uint uid, QObject* parent) : m_uid(uid), @@ -105,7 +105,7 @@ void DSPDeviceEngine::stopAcquistion() } } -void DSPDeviceEngine::setSource(SampleSource* source) +void DSPDeviceEngine::setSource(DeviceSampleSource* source) { qDebug() << "DSPDeviceEngine::setSource"; DSPSetSource cmd(source); @@ -475,7 +475,7 @@ DSPDeviceEngine::State DSPDeviceEngine::gotoError(const QString& errorMessage) return StError; } -void DSPDeviceEngine::handleSetSource(SampleSource* source) +void DSPDeviceEngine::handleSetSource(DeviceSampleSource* source) { gotoIdle(); diff --git a/sdrbase/dsp/dspdeviceengine.h b/sdrbase/dsp/dspdeviceengine.h index f33948ed7..ce8441155 100644 --- a/sdrbase/dsp/dspdeviceengine.h +++ b/sdrbase/dsp/dspdeviceengine.h @@ -29,7 +29,7 @@ #include "util/syncmessenger.h" #include "util/export.h" -class SampleSource; +class DeviceSampleSource; class BasebandSampleSink; class ThreadedSampleSink; @@ -60,7 +60,7 @@ public: bool startAcquisition(); //!< Start acquisition sequence void stopAcquistion(); //!< Stop acquisition sequence - void setSource(SampleSource* source); //!< Set the sample source type + void setSource(DeviceSampleSource* source); //!< Set the sample source type void setSourceSequence(int sequence); //!< Set the sample source sequence in type void addSink(BasebandSampleSink* sink); //!< Add a sample sink @@ -88,7 +88,7 @@ private: QString m_errorMessage; QString m_deviceDescription; - SampleSource* m_sampleSource; + DeviceSampleSource* m_sampleSource; int m_sampleSourceSequence; typedef std::list SampleSinks; @@ -118,7 +118,7 @@ private: State gotoRunning(); //!< Go to the running state from ready state State gotoError(const QString& errorMsg); //!< Go to an error state - void handleSetSource(SampleSource* source); //!< Manage source setting + void handleSetSource(DeviceSampleSource* source); //!< Manage source setting private slots: void handleData(); //!< Handle data when samples from source FIFO are ready to be processed diff --git a/sdrbase/dsp/samplesource.cpp b/sdrbase/dsp/samplesource.cpp deleted file mode 100644 index be4958178..000000000 --- a/sdrbase/dsp/samplesource.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany // -// written by Christian Daniel // -// // -// 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 . // -/////////////////////////////////////////////////////////////////////////////////// - -#include "dsp/samplesource.h" - -SampleSource::SampleSource() -{ - connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); -} - -SampleSource::~SampleSource() -{ -} - -void SampleSource::handleInputMessages() -{ - Message* message; - - while ((message = m_inputMessageQueue.pop()) != 0) - { - if (handleMessage(*message)) - { - delete message; - } - } -} diff --git a/sdrbase/dsp/samplesource.h b/sdrbase/dsp/samplesource.h deleted file mode 100644 index 944a539f3..000000000 --- a/sdrbase/dsp/samplesource.h +++ /dev/null @@ -1,56 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// 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_SAMPLESOURCE_H -#define INCLUDE_SAMPLESOURCE_H - -#include -#include "dsp/samplefifo.h" -#include "util/message.h" -#include "util/messagequeue.h" -#include "util/export.h" - -class SDRANGEL_API SampleSource : public QObject { - Q_OBJECT -public: - SampleSource(); - virtual ~SampleSource(); - - virtual bool init(const Message& cmd) = 0; - virtual bool start(int device) = 0; - virtual void stop() = 0; - - virtual const QString& getDeviceDescription() const = 0; - virtual int getSampleRate() const = 0; //!< Sample rate exposed by the source - virtual quint64 getCenterFrequency() const = 0; //!< Center frequency exposed by the source - - virtual bool handleMessage(const Message& message) = 0; - - MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } - MessageQueue *getOutputMessageQueueToGUI() { return &m_outputMessageQueueToGUI; } - SampleFifo* getSampleFifo() { return &m_sampleFifo; } - -protected slots: - void handleInputMessages(); - -protected: - SampleFifo m_sampleFifo; - MessageQueue m_inputMessageQueue; //!< Input queue to the source - MessageQueue m_outputMessageQueueToGUI; //!< Output queue specialized for the source GUI -}; - -#endif // INCLUDE_SAMPLESOURCE_H diff --git a/sdrbase/mainwindow.h b/sdrbase/mainwindow.h index 6b5b347d0..9a8461c67 100644 --- a/sdrbase/mainwindow.h +++ b/sdrbase/mainwindow.h @@ -39,7 +39,7 @@ class SpectrumVis; class GLSpectrum; class GLSpectrumGUI; class ChannelWindow; -class SampleSource; +class DeviceSampleSource; class PluginAPI; class PluginGUI; class ChannelMarker; diff --git a/sdrbase/sdrbase.pro b/sdrbase/sdrbase.pro index 072f4b303..e165fa63d 100644 --- a/sdrbase/sdrbase.pro +++ b/sdrbase/sdrbase.pro @@ -84,7 +84,7 @@ SOURCES += mainwindow.cpp\ gui/scale.cpp\ gui/scaleengine.cpp\ gui/valuedial.cpp\ - dsp/samplesource.cpp\ + dsp/devicesamplesource.cpp\ plugin/pluginapi.cpp\ plugin/plugininterface.cpp\ plugin/pluginmanager.cpp\ @@ -164,7 +164,7 @@ HEADERS += mainwindow.h\ gui/scale.h\ gui/scaleengine.h\ gui/valuedial.h\ - dsp/samplesource.h\ + dsp/devicesamplesource.h\ plugin/pluginapi.h\ plugin/plugingui.h\ plugin/plugininterface.h\