RxTx semantic move: renamed FileSink to FileRecord

pull/27/head
f4exb 2016-10-02 10:30:58 +02:00
rodzic a8247b8b42
commit 1fa80272b5
23 zmienionych plików z 74 dodań i 64 usunięć

Wyświetl plik

@ -106,7 +106,7 @@ set(sdrbase_SOURCES
sdrbase/dsp/fftwindow.cpp
sdrbase/dsp/filterrc.cpp
sdrbase/dsp/filtermbe.cpp
sdrbase/dsp/filesink.cpp
sdrbase/dsp/filerecord.cpp
sdrbase/dsp/interpolator.cpp
sdrbase/dsp/inthalfbandfilter.cpp
sdrbase/dsp/lowpass.cpp
@ -191,7 +191,7 @@ set(sdrbase_HEADERS
sdrbase/dsp/fftwindow.h
sdrbase/dsp/filterrc.h
sdrbase/dsp/filtermbe.h
sdrbase/dsp/filesink.h
sdrbase/dsp/filerecord.h
sdrbase/dsp/gfft.h
sdrbase/dsp/interpolator.h
sdrbase/dsp/inthalfbandfilter.h

Wyświetl plik

@ -20,13 +20,15 @@
#include <libairspy/airspy.h>
#include "airspygui.h"
#include <dsp/filerecord.h>
#include "ui_airspygui.h"
#include "device/deviceapi.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "dsp/filesink.h"
AirspyGui::AirspyGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
@ -54,7 +56,7 @@ AirspyGui::AirspyGui(DeviceAPI *deviceAPI, QWidget* parent) :
char recFileNameCStr[30];
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
m_fileSink = new FileSink(std::string(recFileNameCStr));
m_fileSink = new FileRecord(std::string(recFileNameCStr));
m_deviceAPI->addSink(m_fileSink);
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);

Wyświetl plik

@ -25,7 +25,7 @@
#define AIRSPY_MAX_DEVICE (32)
class DeviceAPI;
class FileSink;
class FileRecord;
namespace Ui {
class AirspyGui;
@ -61,7 +61,7 @@ private:
QTimer m_statusTimer;
std::vector<uint32_t> m_rates;
SampleSource* m_sampleSource;
FileSink *m_fileSink; //!< File sink to record device I/Q output
FileRecord *m_fileSink; //!< File sink to record device I/Q output
int m_sampleRate;
quint64 m_deviceCenterFrequency; //!< Center frequency in device
int m_lastEngineState;

Wyświetl plik

@ -25,8 +25,8 @@
#include "gui/glspectrum.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "dsp/filesink.h"
#include "bladerfgui.h"
#include <dsp/filerecord.h>
BladerfGui::BladerfGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
@ -64,7 +64,7 @@ BladerfGui::BladerfGui(DeviceAPI *deviceAPI, QWidget* parent) :
char recFileNameCStr[30];
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
m_fileSink = new FileSink(std::string(recFileNameCStr));
m_fileSink = new FileRecord(std::string(recFileNameCStr));
m_deviceAPI->addSink(m_fileSink);
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);

Wyświetl plik

@ -23,7 +23,7 @@
#include "bladerfinput.h"
class DeviceAPI;
class FileSink;
class FileRecord;
namespace Ui {
class BladerfGui;
@ -57,7 +57,7 @@ private:
QTimer m_statusTimer;
std::vector<int> m_gains;
SampleSource* m_sampleSource;
FileSink *m_fileSink; //!< File sink to record device I/Q output
FileRecord *m_fileSink; //!< File sink to record device I/Q output
int m_sampleRate;
quint64 m_deviceCenterFrequency; //!< Center frequency in device
int m_lastEngineState;

Wyświetl plik

@ -22,8 +22,9 @@
#include "gui/glspectrum.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "dsp/filesink.h"
#include "fcdprogui.h"
#include <dsp/filerecord.h>
#include "fcdproconst.h"
FCDProGui::FCDProGui(DeviceAPI *deviceAPI, QWidget* parent) :
@ -145,7 +146,7 @@ FCDProGui::FCDProGui(DeviceAPI *deviceAPI, QWidget* parent) :
char recFileNameCStr[30];
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
m_fileSink = new FileSink(std::string(recFileNameCStr));
m_fileSink = new FileRecord(std::string(recFileNameCStr));
m_deviceAPI->addSink(m_fileSink);
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);

Wyświetl plik

@ -23,7 +23,7 @@
#include "plugin/plugingui.h"
class DeviceAPI;
class FileSink;
class FileRecord;
class QWidget;
namespace Ui {
@ -58,7 +58,7 @@ private:
QTimer m_statusTimer;
std::vector<int> m_gains;
SampleSource* m_sampleSource;
FileSink *m_fileSink; //!< File sink to record device I/Q output
FileRecord *m_fileSink; //!< File sink to record device I/Q output
int m_sampleRate;
quint64 m_deviceCenterFrequency; //!< Center frequency in device
int m_lastEngineState;

Wyświetl plik

@ -23,8 +23,9 @@
#include "gui/glspectrum.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "dsp/filesink.h"
#include "fcdproplusgui.h"
#include <dsp/filerecord.h>
#include "fcdproplusconst.h"
FCDProPlusGui::FCDProPlusGui(DeviceAPI *deviceAPI, QWidget* parent) :
@ -63,7 +64,7 @@ FCDProPlusGui::FCDProPlusGui(DeviceAPI *deviceAPI, QWidget* parent) :
char recFileNameCStr[30];
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
m_fileSink = new FileSink(std::string(recFileNameCStr));
m_fileSink = new FileRecord(std::string(recFileNameCStr));
m_deviceAPI->addSink(m_fileSink);
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);

Wyświetl plik

@ -23,7 +23,7 @@
#include "plugin/plugingui.h"
class DeviceAPI;
class FileSink;
class FileRecord;
namespace Ui {
class FCDProPlusGui;
@ -57,7 +57,7 @@ private:
QTimer m_statusTimer;
std::vector<int> m_gains;
SampleSource* m_sampleSource;
FileSink *m_fileSink; //!< File sink to record device I/Q output
FileRecord *m_fileSink; //!< File sink to record device I/Q output
int m_sampleRate;
quint64 m_deviceCenterFrequency; //!< Center frequency in device
int m_lastEngineState;

Wyświetl plik

@ -21,10 +21,11 @@
#include "util/simpleserializer.h"
#include "dsp/dspcommands.h"
#include "dsp/dspengine.h"
#include "dsp/filesink.h"
#include "filesourcegui.h"
#include "filesourceinput.h"
#include <dsp/filerecord.h>
#include "filesourcethread.h"
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSource, Message)
@ -101,15 +102,15 @@ void FileSourceInput::openFileStream()
m_ifstream.open(m_fileName.toStdString().c_str(), std::ios::binary | std::ios::ate);
quint64 fileSize = m_ifstream.tellg();
m_ifstream.seekg(0,std::ios_base::beg);
FileSink::Header header;
FileSink::readHeader(m_ifstream, header);
FileRecord::Header header;
FileRecord::readHeader(m_ifstream, header);
m_sampleRate = header.sampleRate;
m_centerFrequency = header.centerFrequency;
m_startingTimeStamp = header.startTimeStamp;
if (fileSize > sizeof(FileSink::Header)) {
m_recordLength = (fileSize - sizeof(FileSink::Header)) / (4 * m_sampleRate);
if (fileSize > sizeof(FileRecord::Header)) {
m_recordLength = (fileSize - sizeof(FileRecord::Header)) / (4 * m_sampleRate);
} else {
m_recordLength = 0;
}

Wyświetl plik

@ -24,8 +24,10 @@
#include "gui/glspectrum.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "dsp/filesink.h"
#include "hackrfgui.h"
#include <dsp/filerecord.h>
#include "ui_hackrfgui.h"
HackRFGui::HackRFGui(DeviceAPI *deviceAPI, QWidget* parent) :
@ -55,7 +57,7 @@ HackRFGui::HackRFGui(DeviceAPI *deviceAPI, QWidget* parent) :
char recFileNameCStr[30];
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
m_fileSink = new FileSink(std::string(recFileNameCStr));
m_fileSink = new FileRecord(std::string(recFileNameCStr));
m_deviceAPI->addSink(m_fileSink);
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);

Wyświetl plik

@ -25,7 +25,7 @@
#define HACKRF_MAX_DEVICE (32)
class DeviceAPI;
class FileSink;
class FileRecord;
namespace Ui {
class HackRFGui;
@ -65,7 +65,7 @@ private:
QTimer m_updateTimer;
QTimer m_statusTimer;
SampleSource* m_sampleSource;
FileSink *m_fileSink; //!< File sink to record device I/Q output
FileRecord *m_fileSink; //!< File sink to record device I/Q output
int m_sampleRate;
quint64 m_deviceCenterFrequency; //!< Center frequency in device
int m_lastEngineState;

Wyświetl plik

@ -18,13 +18,15 @@
#include <QMessageBox>
#include "rtlsdrgui.h"
#include <dsp/filerecord.h>
#include "ui_rtlsdrgui.h"
#include "device/deviceapi.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "dsp/filesink.h"
RTLSDRGui::RTLSDRGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
@ -57,7 +59,7 @@ RTLSDRGui::RTLSDRGui(DeviceAPI *deviceAPI, QWidget* parent) :
char recFileNameCStr[30];
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
m_fileSink = new FileSink(std::string(recFileNameCStr));
m_fileSink = new FileRecord(std::string(recFileNameCStr));
m_deviceAPI->addSink(m_fileSink);
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);

Wyświetl plik

@ -22,7 +22,7 @@
#include "rtlsdrinput.h"
class DeviceAPI;
class FileSink;
class FileRecord;
namespace Ui {
class RTLSDRGui;
@ -56,7 +56,7 @@ private:
QTimer m_statusTimer;
std::vector<int> m_gains;
SampleSource* m_sampleSource;
FileSink *m_fileSink; //!< File sink to record device I/Q output
FileRecord *m_fileSink; //!< File sink to record device I/Q output
int m_sampleRate;
quint64 m_deviceCenterFrequency; //!< Center frequency in device
int m_lastEngineState;

Wyświetl plik

@ -35,11 +35,11 @@
#include "gui/glspectrum.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "dsp/filesink.h"
#include "mainwindow.h"
#include "util/simpleserializer.h"
#include "sdrdaemongui.h"
#include <dsp/filerecord.h>
SDRdaemonGui::SDRdaemonGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
@ -98,7 +98,7 @@ SDRdaemonGui::SDRdaemonGui(DeviceAPI *deviceAPI, QWidget* parent) :
char recFileNameCStr[30];
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
m_fileSink = new FileSink(std::string(recFileNameCStr));
m_fileSink = new FileRecord(std::string(recFileNameCStr));
m_deviceAPI->addSink(m_fileSink);
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);

Wyświetl plik

@ -24,7 +24,7 @@
#include "sdrdaemoninput.h"
class DeviceAPI;
class FileSink;
class FileRecord;
namespace Ui {
class SDRdaemonGui;
@ -56,7 +56,7 @@ private:
QTimer m_statusTimer;
SampleSource* m_sampleSource;
bool m_acquisition;
FileSink *m_fileSink; //!< File sink to record device I/Q output
FileRecord *m_fileSink; //!< File sink to record device I/Q output
int m_deviceSampleRate;
quint64 m_deviceCenterFrequency; //!< Center frequency in device
int m_lastEngineState;

Wyświetl plik

@ -22,10 +22,11 @@
#include "util/simpleserializer.h"
#include "dsp/dspcommands.h"
#include "dsp/dspengine.h"
#include "dsp/filesink.h"
#include "sdrdaemongui.h"
#include "sdrdaemoninput.h"
#include <dsp/filerecord.h>
#include "sdrdaemonudphandler.h"
MESSAGE_CLASS_DEFINITION(SDRdaemonInput::MsgConfigureSDRdaemonUDPLink, Message)

Wyświetl plik

@ -35,11 +35,11 @@
#include "gui/glspectrum.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "dsp/filesink.h"
#include "mainwindow.h"
#include "util/simpleserializer.h"
#include "sdrdaemonfecgui.h"
#include <dsp/filerecord.h>
SDRdaemonFECGui::SDRdaemonFECGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
@ -96,7 +96,7 @@ SDRdaemonFECGui::SDRdaemonFECGui(DeviceAPI *deviceAPI, QWidget* parent) :
char recFileNameCStr[30];
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
m_fileSink = new FileSink(std::string(recFileNameCStr));
m_fileSink = new FileRecord(std::string(recFileNameCStr));
m_deviceAPI->addSink(m_fileSink);
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);

Wyświetl plik

@ -24,7 +24,7 @@
#include "sdrdaemonfecinput.h"
class DeviceAPI;
class FileSink;
class FileRecord;
namespace Ui {
class SDRdaemonFECGui;
@ -56,7 +56,7 @@ private:
QTimer m_statusTimer;
SampleSource* m_sampleSource;
bool m_acquisition;
FileSink *m_fileSink; //!< File sink to record device I/Q output
FileRecord *m_fileSink; //!< File sink to record device I/Q output
int m_deviceSampleRate;
quint64 m_deviceCenterFrequency; //!< Center frequency in device
int m_lastEngineState;

Wyświetl plik

@ -22,10 +22,10 @@
#include "util/simpleserializer.h"
#include "dsp/dspcommands.h"
#include "dsp/dspengine.h"
#include "dsp/filesink.h"
#include "sdrdaemonfecinput.h"
#include <dsp/filerecord.h>
#include "sdrdaemonfecgui.h"
#include "sdrdaemonfecudphandler.h"

Wyświetl plik

@ -1,11 +1,11 @@
#include "dsp/filesink.h"
#include <dsp/filerecord.h>
#include "dsp/dspcommands.h"
#include "util/simpleserializer.h"
#include "util/message.h"
#include <QDebug>
FileSink::FileSink() :
FileRecord::FileRecord() :
SampleSink(),
m_fileName(std::string("test.sdriq")),
m_sampleRate(0),
@ -17,7 +17,7 @@ FileSink::FileSink() :
setObjectName("FileSink");
}
FileSink::FileSink(const std::string& filename) :
FileRecord::FileRecord(const std::string& filename) :
SampleSink(),
m_fileName(std::string(filename)),
m_sampleRate(0),
@ -29,12 +29,12 @@ FileSink::FileSink(const std::string& filename) :
setObjectName("FileSink");
}
FileSink::~FileSink()
FileRecord::~FileRecord()
{
stopRecording();
}
void FileSink::setFileName(const std::string& filename)
void FileRecord::setFileName(const std::string& filename)
{
if (!m_recordOn)
{
@ -42,7 +42,7 @@ void FileSink::setFileName(const std::string& filename)
}
}
void FileSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly)
void FileRecord::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly)
{
// if no recording is active, send the samples to /dev/null
if(!m_recordOn)
@ -61,16 +61,16 @@ void FileSink::feed(const SampleVector::const_iterator& begin, const SampleVecto
}
}
void FileSink::start()
void FileRecord::start()
{
}
void FileSink::stop()
void FileRecord::stop()
{
stopRecording();
}
void FileSink::startRecording()
void FileRecord::startRecording()
{
if (!m_sampleFile.is_open())
{
@ -82,7 +82,7 @@ void FileSink::startRecording()
}
}
void FileSink::stopRecording()
void FileRecord::stopRecording()
{
if (m_sampleFile.is_open())
{
@ -93,7 +93,7 @@ void FileSink::stopRecording()
}
}
bool FileSink::handleMessage(const Message& message)
bool FileRecord::handleMessage(const Message& message)
{
qDebug() << "FileSink::handleMessage";
@ -112,7 +112,7 @@ bool FileSink::handleMessage(const Message& message)
}
}
void FileSink::handleConfigure(const std::string& fileName)
void FileRecord::handleConfigure(const std::string& fileName)
{
if (fileName != m_fileName)
{
@ -122,7 +122,7 @@ void FileSink::handleConfigure(const std::string& fileName)
m_fileName = fileName;
}
void FileSink::writeHeader()
void FileRecord::writeHeader()
{
m_sampleFile.write((const char *) &m_sampleRate, sizeof(int));
m_sampleFile.write((const char *) &m_centerFrequency, sizeof(quint64));
@ -130,7 +130,7 @@ void FileSink::writeHeader()
m_sampleFile.write((const char *) &ts, sizeof(std::time_t));
}
void FileSink::readHeader(std::ifstream& sampleFile, Header& header)
void FileRecord::readHeader(std::ifstream& sampleFile, Header& header)
{
sampleFile.read((char *) &(header.sampleRate), sizeof(int));
sampleFile.read((char *) &(header.centerFrequency), sizeof(quint64));

Wyświetl plik

@ -11,7 +11,7 @@
class Message;
class SDRANGEL_API FileSink : public SampleSink {
class SDRANGEL_API FileRecord : public SampleSink {
public:
struct Header
@ -21,9 +21,9 @@ public:
std::time_t startTimeStamp;
};
FileSink();
FileSink(const std::string& filename);
virtual ~FileSink();
FileRecord();
FileRecord(const std::string& filename);
virtual ~FileRecord();
quint64 getByteCount() const { return m_byteCount; }

Wyświetl plik

@ -47,7 +47,7 @@ SOURCES += mainwindow.cpp\
dsp/fftwindow.cpp\
dsp/filterrc.cpp\
dsp/filtermbe.cpp\
dsp/filesink.cpp\
dsp/filerecord.cpp\
dsp/interpolator.cpp\
dsp/inthalfbandfilter.cpp\
dsp/lowpass.cpp\
@ -122,7 +122,7 @@ HEADERS += mainwindow.h\
dsp/fftwindow.h\
dsp/filterrc.h\
dsp/filtermbe.h\
dsp/filesink.h\
dsp/filerecord.h\
dsp/gfft.h\
dsp/interpolator.h\
dsp/inthalfbandfilter.h\