From da87986b5f2df6c9109983637b2e2b12b49f62ae Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 12 Oct 2021 21:20:45 +0200 Subject: [PATCH] FileSink: API updates --- plugins/channelrx/filesink/filesinksettings.cpp | 3 --- plugins/channelrx/filesink/filesinksettings.h | 1 - plugins/channelrx/filesink/filesinksink.cpp | 3 ++- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/channelrx/filesink/filesinksettings.cpp b/plugins/channelrx/filesink/filesinksettings.cpp index b2146e11d..0a3428a0e 100644 --- a/plugins/channelrx/filesink/filesinksettings.cpp +++ b/plugins/channelrx/filesink/filesinksettings.cpp @@ -29,7 +29,6 @@ FileSinkSettings::FileSinkSettings() void FileSinkSettings::resetToDefaults() { - m_ncoMode = false; m_inputFrequencyOffset = 0; m_fileRecordName = ""; m_rgbColor = QColor(140, 4, 4).rgb(); @@ -53,7 +52,6 @@ QByteArray FileSinkSettings::serialize() const { SimpleSerializer s(1); s.writeS32(1, m_inputFrequencyOffset); - s.writeBool(2, m_ncoMode); s.writeString(3, m_fileRecordName); s.writeS32(4, m_streamIndex); s.writeU32(5, m_rgbColor); @@ -96,7 +94,6 @@ bool FileSinkSettings::deserialize(const QByteArray& data) QByteArray bytetmp; d.readS32(1, &m_inputFrequencyOffset, 0); - d.readBool(2, &m_ncoMode, false); d.readString(3, &m_fileRecordName, ""); d.readS32(4, &m_streamIndex, 0); d.readU32(5, &m_rgbColor, QColor(0, 255, 255).rgb()); diff --git a/plugins/channelrx/filesink/filesinksettings.h b/plugins/channelrx/filesink/filesinksettings.h index 4d730b272..f446d7ca2 100644 --- a/plugins/channelrx/filesink/filesinksettings.h +++ b/plugins/channelrx/filesink/filesinksettings.h @@ -25,7 +25,6 @@ class Serializable; struct FileSinkSettings { - bool m_ncoMode; qint32 m_inputFrequencyOffset; QString m_fileRecordName; quint32 m_rgbColor; diff --git a/plugins/channelrx/filesink/filesinksink.cpp b/plugins/channelrx/filesink/filesinksink.cpp index bc7faa087..e6a0c1264 100644 --- a/plugins/channelrx/filesink/filesinksink.cpp +++ b/plugins/channelrx/filesink/filesinksink.cpp @@ -26,6 +26,7 @@ #include "dsp/wavfilerecord.h" FileSinkSink::FileSinkSink() : + m_sinkSampleRate(0), m_nbCaptures(0), m_preRecordBuffer(48000), m_preRecordFill(0), @@ -50,7 +51,7 @@ void FileSinkSink::startRecording() if (m_recordEnabled) // File is open for writing and valid { // set the length of pre record time - qint64 mSShift = (m_preRecordFill * 1000) / m_sinkSampleRate; + qint64 mSShift = m_sinkSampleRate == 0 ? 0 : (m_preRecordFill * 1000) / m_sinkSampleRate; m_fileSink->setMsShift(-mSShift); // notify capture start