mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
File record default file name fix (1)
This commit is contained in:
@@ -49,9 +49,7 @@ HackRFInput::HackRFInput(DeviceSourceAPI *deviceAPI) :
|
||||
{
|
||||
openDevice();
|
||||
|
||||
char recFileNameCStr[30];
|
||||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
|
||||
m_fileSink = new FileRecord(std::string(recFileNameCStr));
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
|
||||
m_deviceAPI->setBuddySharedPtr(&m_sharedParams);
|
||||
@@ -260,9 +258,18 @@ bool HackRFInput::handleMessage(const Message& message)
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "HackRFInput::handleMessage: MsgFileRecord: " << conf.getStartStop();
|
||||
|
||||
if (conf.getStartStop()) {
|
||||
if (conf.getStartStop())
|
||||
{
|
||||
if (m_settings.m_fileRecordName.size() != 0) {
|
||||
m_fileSink->setFileName(m_settings.m_fileRecordName);
|
||||
} else {
|
||||
m_fileSink->setFileName(QString("rec_%1_%2.sdriq").arg(m_deviceAPI->getDeviceUID()).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddThh:mm:ss")));
|
||||
}
|
||||
|
||||
m_fileSink->startRecording();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fileSink->stopRecording();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ void HackRFInputSettings::resetToDefaults()
|
||||
m_iqCorrection = false;
|
||||
m_devSampleRate = 2400000;
|
||||
m_linkTxFrequency = false;
|
||||
m_fileRecordName = "";
|
||||
}
|
||||
|
||||
QByteArray HackRFInputSettings::serialize() const
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#define _HACKRF_HACKRFINPUTSETTINGS_H_
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QString>
|
||||
|
||||
struct HackRFInputSettings {
|
||||
typedef enum {
|
||||
@@ -39,6 +40,7 @@ struct HackRFInputSettings {
|
||||
bool m_dcBlock;
|
||||
bool m_iqCorrection;
|
||||
bool m_linkTxFrequency;
|
||||
QString m_fileRecordName;
|
||||
|
||||
HackRFInputSettings();
|
||||
void resetToDefaults();
|
||||
|
||||
Reference in New Issue
Block a user