1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-08 17:46:03 -05:00
sdrangel/sdrbase/dsp/filerecordinterface.h

77 lines
3.3 KiB
C
Raw Normal View History

2020-08-06 04:46:49 -04:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2020 Edouard Griffiths, F4EXB //
// //
// File recorder in SigMF format single channel for SI plugins //
// //
// 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 //
// (at your option) any later version. //
// //
// 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_FILERECORD_INTERFACE_H
#define INCLUDE_FILERECORD_INTERFACE_H
#include <QString>
#include <QObject>
2020-08-06 04:46:49 -04:00
#include "dsp/dsptypes.h"
#include "util/message.h"
#include "util/messagequeue.h"
2020-08-06 04:46:49 -04:00
#include "export.h"
class SDRBASE_API FileRecordInterface : public QObject {
Q_OBJECT
2020-08-06 04:46:49 -04:00
public:
enum RecordType
{
RecordTypeUndefined = 0,
RecordTypeSdrIQ,
RecordTypeSigMF,
RecordTypeWav
2020-08-06 04:46:49 -04:00
};
FileRecordInterface();
virtual ~FileRecordInterface();
virtual void start() = 0;
virtual void stop() = 0;
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly) = 0;
virtual bool handleMessage(const Message& cmd) = 0; //!< Processing of a message. Returns true if message has actually been processed
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
2020-08-06 04:46:49 -04:00
virtual void setFileName(const QString &filename) = 0;
virtual const QString& getCurrentFileName() = 0;
virtual bool startRecording() = 0;
virtual bool stopRecording() = 0;
2020-08-06 04:46:49 -04:00
virtual bool isRecording() const = 0;
virtual void setMsShift(qint64 msShift) = 0;
virtual int getBytesPerSample() { return sizeof(Sample); };
2020-08-06 04:46:49 -04:00
static QString genUniqueFileName(unsigned int deviceUID, int istream = -1);
static RecordType guessTypeFromFileName(const QString& fileName, QString& fileBase);
protected:
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
protected slots:
void handleInputMessages();
2020-08-06 04:46:49 -04:00
};
#endif // INCLUDE_FILERECORD_INTERFACE_H