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

RxTx semantic move: renamed SampleSource to DeviceSampleSource

This commit is contained in:
f4exb 2016-10-02 23:16:40 +02:00
parent 78513854ac
commit 7a535cc3b8
29 changed files with 54 additions and 144 deletions

View File

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

View File

@ -60,7 +60,7 @@ private:
QTimer m_updateTimer;
QTimer m_statusTimer;
std::vector<uint32_t> 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

View File

@ -17,7 +17,8 @@
#ifndef INCLUDE_AIRSPYINPUT_H
#define INCLUDE_AIRSPYINPUT_H
#include "dsp/samplesource.h"
#include <dsp/devicesamplesource.h>
#include "airspysettings.h"
#include <libairspy/airspy.h>
#include <QString>
@ -25,7 +26,7 @@
class DeviceAPI;
class AirspyThread;
class AirspyInput : public SampleSource {
class AirspyInput : public DeviceSampleSource {
public:
class MsgConfigureAirspy : public Message {
MESSAGE_CLASS_DECLARATION

View File

@ -56,7 +56,7 @@ private:
QTimer m_updateTimer;
QTimer m_statusTimer;
std::vector<int> 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

View File

@ -17,7 +17,8 @@
#ifndef INCLUDE_BLADERFINPUT_H
#define INCLUDE_BLADERFINPUT_H
#include "dsp/samplesource.h"
#include <dsp/devicesamplesource.h>
#include "bladerfsettings.h"
#include <libbladeRF.h>
#include <QString>
@ -25,7 +26,7 @@
class DeviceAPI;
class BladerfThread;
class BladerfInput : public SampleSource {
class BladerfInput : public DeviceSampleSource {
public:
class MsgConfigureBladerf : public Message {
MESSAGE_CLASS_DECLARATION

View File

@ -57,7 +57,7 @@ private:
QTimer m_updateTimer;
QTimer m_statusTimer;
std::vector<int> 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

View File

@ -18,7 +18,8 @@
#ifndef INCLUDE_FCDPROINPUT_H
#define INCLUDE_FCDPROINPUT_H
#include "dsp/samplesource.h"
#include <dsp/devicesamplesource.h>
#include "fcdprosettings.h"
#include "fcdhid.h"
#include <QString>
@ -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

View File

@ -56,7 +56,7 @@ private:
QTimer m_updateTimer;
QTimer m_statusTimer;
std::vector<int> 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

View File

@ -17,8 +17,9 @@
#ifndef INCLUDE_FCDINPUT_H
#define INCLUDE_FCDINPUT_H
#include <dsp/devicesamplesource.h>
#include "fcdproplussettings.h"
#include "dsp/samplesource.h"
#include "fcdhid.h"
#include <QString>
#include <inttypes.h>
@ -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

View File

@ -19,8 +19,9 @@
#ifndef INCLUDE_FCDINPUT_H
#define INCLUDE_FCDINPUT_H
#include <dsp/devicesamplesource.h>
#include "fcdproplussettings.h"
#include "dsp/samplesource.h"
#include "fcdhid.h"
#include <QString>
#include <inttypes.h>
@ -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

View File

@ -53,7 +53,7 @@ private:
FileSourceInput::Settings m_settings;
QTimer m_statusTimer;
std::vector<int> m_gains;
SampleSource* m_sampleSource;
DeviceSampleSource* m_sampleSource;
bool m_acquisition;
QString m_fileName;
int m_sampleRate;

View File

@ -17,7 +17,7 @@
#ifndef INCLUDE_FILESOURCEINPUT_H
#define INCLUDE_FILESOURCEINPUT_H
#include "dsp/samplesource.h"
#include <dsp/devicesamplesource.h>
#include <QString>
#include <QTimer>
#include <ctime>
@ -26,7 +26,7 @@
class FileSourceThread;
class FileSourceInput : public SampleSource {
class FileSourceInput : public DeviceSampleSource {
public:
struct Settings {
QString m_fileName;

View File

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

View File

@ -17,7 +17,7 @@
#ifndef INCLUDE_HACKRFINPUT_H
#define INCLUDE_HACKRFINPUT_H
#include "dsp/samplesource.h"
#include <dsp/devicesamplesource.h>
#include "libhackrf/hackrf.h"
#include "hackrfsettings.h"
#include <QString>
@ -25,7 +25,7 @@
class DeviceAPI;
class HackRFThread;
class HackRFInput : public SampleSource {
class HackRFInput : public DeviceSampleSource {
public:
class MsgConfigureHackRF : public Message {

View File

@ -55,7 +55,7 @@ private:
QTimer m_updateTimer;
QTimer m_statusTimer;
std::vector<int> 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

View File

@ -18,7 +18,8 @@
#ifndef INCLUDE_RTLSDRINPUT_H
#define INCLUDE_RTLSDRINPUT_H
#include "dsp/samplesource.h"
#include <dsp/devicesamplesource.h>
#include "rtlsdrsettings.h"
#include <rtl-sdr.h>
#include <QString>
@ -26,7 +27,7 @@
class DeviceAPI;
class RTLSDRThread;
class RTLSDRInput : public SampleSource {
class RTLSDRInput : public DeviceSampleSource {
public:
class MsgConfigureRTLSDR : public Message {
MESSAGE_CLASS_DECLARATION

View File

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

View File

@ -17,7 +17,7 @@
#ifndef INCLUDE_SDRDAEMONINPUT_H
#define INCLUDE_SDRDAEMONINPUT_H
#include "dsp/samplesource.h"
#include <dsp/devicesamplesource.h>
#include <QString>
#include <QTimer>
#include <ctime>
@ -27,7 +27,7 @@
class DeviceAPI;
class SDRdaemonUDPHandler;
class SDRdaemonInput : public SampleSource {
class SDRdaemonInput : public DeviceSampleSource {
public:
class MsgConfigureSDRdaemonUDPLink : public Message {
MESSAGE_CLASS_DECLARATION

View File

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

View File

@ -17,7 +17,7 @@
#ifndef INCLUDE_SDRDAEMONFECINPUT_H
#define INCLUDE_SDRDAEMONFECINPUT_H
#include "dsp/samplesource.h"
#include <dsp/devicesamplesource.h>
#include <QString>
#include <QTimer>
#include <ctime>
@ -27,7 +27,7 @@
class DeviceAPI;
class SDRdaemonFECUDPHandler;
class SDRdaemonFECInput : public SampleSource {
class SDRdaemonFECInput : public DeviceSampleSource {
public:
class MsgConfigureSDRdaemonUDPLink : public Message {
MESSAGE_CLASS_DECLARATION

View File

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

View File

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

View File

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

View File

@ -16,6 +16,7 @@
///////////////////////////////////////////////////////////////////////////////////
#include <dsp/basebandsamplesink.h>
#include <dsp/devicesamplesource.h>
#include <dsp/downchannelizer.h>
#include <stdio.h>
#include <QDebug>
@ -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();

View File

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

View File

@ -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 <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#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;
}
}
}

View File

@ -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 <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDE_SAMPLESOURCE_H
#define INCLUDE_SAMPLESOURCE_H
#include <QtGlobal>
#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

View File

@ -39,7 +39,7 @@ class SpectrumVis;
class GLSpectrum;
class GLSpectrumGUI;
class ChannelWindow;
class SampleSource;
class DeviceSampleSource;
class PluginAPI;
class PluginGUI;
class ChannelMarker;

View File

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