mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
Removed file recording function from device plugins
This commit is contained in:
@@ -25,14 +25,11 @@
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGSDRPlayReport.h"
|
||||
#include "SWGSDRPlayActions.h"
|
||||
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include <dsp/filerecord.h>
|
||||
#include "sdrplayinput.h"
|
||||
|
||||
#include <device/deviceapi.h>
|
||||
@@ -41,7 +38,6 @@
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgConfigureSDRPlay, Message)
|
||||
MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgReportSDRPlayGains, Message)
|
||||
MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgFileRecord, Message)
|
||||
MESSAGE_CLASS_DEFINITION(SDRPlayInput::MsgStartStop, Message)
|
||||
|
||||
SDRPlayInput::SDRPlayInput(DeviceAPI *deviceAPI) :
|
||||
@@ -55,9 +51,7 @@ SDRPlayInput::SDRPlayInput(DeviceAPI *deviceAPI) :
|
||||
m_running(false)
|
||||
{
|
||||
openDevice();
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->setNbSourceStreams(1);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@@ -72,8 +66,6 @@ SDRPlayInput::~SDRPlayInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
@@ -311,28 +303,6 @@ bool SDRPlayInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgFileRecord::match(message))
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "SDRPlayInput::handleMessage: MsgFileRecord: " << conf.getStartStop();
|
||||
|
||||
if (conf.getStartStop())
|
||||
{
|
||||
if (m_settings.m_fileRecordName.size() != 0) {
|
||||
m_fileSink->setFileName(m_settings.m_fileRecordName);
|
||||
} else {
|
||||
m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
|
||||
}
|
||||
|
||||
m_fileSink->startRecording();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fileSink->stopRecording();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (MsgStartStop::match(message))
|
||||
{
|
||||
MsgStartStop& cmd = (MsgStartStop&) message;
|
||||
@@ -625,7 +595,6 @@ bool SDRPlayInput::applySettings(const SDRPlaySettings& settings, bool forwardCh
|
||||
{
|
||||
int sampleRate = getSampleRate();
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency);
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
@@ -713,37 +682,6 @@ int SDRPlayInput::webapiSettingsPutPatch(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int SDRPlayInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGSDRPlayActions *swgSDRPlayActions = query.getSdrPlayActions();
|
||||
|
||||
if (swgSDRPlayActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgSDRPlayActions->getRecord() != 0;
|
||||
MsgFileRecord *msg = MsgFileRecord::create(record);
|
||||
getInputMessageQueue()->push(msg);
|
||||
|
||||
if (getMessageQueueToGUI())
|
||||
{
|
||||
MsgFileRecord *msgToGUI = MsgFileRecord::create(record);
|
||||
getMessageQueueToGUI()->push(msgToGUI);
|
||||
}
|
||||
}
|
||||
|
||||
return 202;
|
||||
}
|
||||
else
|
||||
{
|
||||
errorMessage = "Missing SDRPlayActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void SDRPlayInput::webapiUpdateDeviceSettings(
|
||||
SDRPlaySettings& settings,
|
||||
const QStringList& deviceSettingsKeys,
|
||||
@@ -800,9 +738,6 @@ void SDRPlayInput::webapiUpdateDeviceSettings(
|
||||
if (deviceSettingsKeys.contains("basebandGain")) {
|
||||
settings.m_basebandGain = response.getSdrPlaySettings()->getBasebandGain();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getSdrPlaySettings()->getFileRecordName();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getSdrPlaySettings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@@ -836,12 +771,6 @@ void SDRPlayInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
|
||||
response.getSdrPlaySettings()->setMixerAmpOn(settings.m_mixerAmpOn ? 1 : 0);
|
||||
response.getSdrPlaySettings()->setBasebandGain(settings.m_basebandGain);
|
||||
|
||||
if (response.getSdrPlaySettings()->getFileRecordName()) {
|
||||
*response.getSdrPlaySettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
} else {
|
||||
response.getSdrPlaySettings()->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
response.getSdrPlaySettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getSdrPlaySettings()->getReverseApiAddress()) {
|
||||
@@ -961,9 +890,6 @@ void SDRPlayInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys,
|
||||
if (deviceSettingsKeys.contains("basebandGain") || force) {
|
||||
swgSDRPlaySettings->setBasebandGain(settings.m_basebandGain);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgSDRPlaySettings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
|
||||
.arg(settings.m_reverseAPIAddress)
|
||||
|
||||
Reference in New Issue
Block a user