From 2fa56d7736ea7e82d377e17ebd512808dd14a113 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 17 Jul 2020 05:30:15 +0200 Subject: [PATCH] SigMF recorder: added possiblity to have a time shift at record start --- sdrbase/dsp/sigmffilerecord.cpp | 3 ++- sdrbase/dsp/sigmffilerecord.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdrbase/dsp/sigmffilerecord.cpp b/sdrbase/dsp/sigmffilerecord.cpp index 4114fab9d..a20812d28 100644 --- a/sdrbase/dsp/sigmffilerecord.cpp +++ b/sdrbase/dsp/sigmffilerecord.cpp @@ -35,6 +35,7 @@ SigMFFileRecord::SigMFFileRecord() : m_fileName("test"), m_sampleRate(0), m_centerFrequency(0), + m_msShift(0), m_recordOn(false), m_recordStart(true), m_sampleStart(0), @@ -126,7 +127,7 @@ void SigMFFileRecord::startRecording() qDebug("SigMFFileRecord::startRecording: start new capture"); } - m_captureStartDT = QDateTime::currentDateTimeUtc(); + m_captureStartDT = QDateTime::currentDateTimeUtc().addMSecs(m_msShift); m_recordOn = true; m_sampleCount = 0; } diff --git a/sdrbase/dsp/sigmffilerecord.h b/sdrbase/dsp/sigmffilerecord.h index 01a016bb8..9d31a1709 100644 --- a/sdrbase/dsp/sigmffilerecord.h +++ b/sdrbase/dsp/sigmffilerecord.h @@ -50,6 +50,7 @@ public: virtual bool isRecording() const { return m_recordOn; } void setHardwareId(const QString& hardwareId) { m_hardwareId = hardwareId; } + void setMsShift(qint64 msShift) { m_msShift = msShift; } unsigned int getNbCaptures() const; private: @@ -59,6 +60,7 @@ private: QString m_metaFileName; quint32 m_sampleRate; quint64 m_centerFrequency; + qint64 m_msShift; bool m_recordOn; bool m_recordStart; QDateTime m_captureStartDT;