1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-21 23:55:13 -05:00

FileSink: API updates

This commit is contained in:
f4exb 2021-10-12 21:20:45 +02:00
parent 3641eb7295
commit da87986b5f
3 changed files with 2 additions and 5 deletions

View File

@ -29,7 +29,6 @@ FileSinkSettings::FileSinkSettings()
void FileSinkSettings::resetToDefaults() void FileSinkSettings::resetToDefaults()
{ {
m_ncoMode = false;
m_inputFrequencyOffset = 0; m_inputFrequencyOffset = 0;
m_fileRecordName = ""; m_fileRecordName = "";
m_rgbColor = QColor(140, 4, 4).rgb(); m_rgbColor = QColor(140, 4, 4).rgb();
@ -53,7 +52,6 @@ QByteArray FileSinkSettings::serialize() const
{ {
SimpleSerializer s(1); SimpleSerializer s(1);
s.writeS32(1, m_inputFrequencyOffset); s.writeS32(1, m_inputFrequencyOffset);
s.writeBool(2, m_ncoMode);
s.writeString(3, m_fileRecordName); s.writeString(3, m_fileRecordName);
s.writeS32(4, m_streamIndex); s.writeS32(4, m_streamIndex);
s.writeU32(5, m_rgbColor); s.writeU32(5, m_rgbColor);
@ -96,7 +94,6 @@ bool FileSinkSettings::deserialize(const QByteArray& data)
QByteArray bytetmp; QByteArray bytetmp;
d.readS32(1, &m_inputFrequencyOffset, 0); d.readS32(1, &m_inputFrequencyOffset, 0);
d.readBool(2, &m_ncoMode, false);
d.readString(3, &m_fileRecordName, ""); d.readString(3, &m_fileRecordName, "");
d.readS32(4, &m_streamIndex, 0); d.readS32(4, &m_streamIndex, 0);
d.readU32(5, &m_rgbColor, QColor(0, 255, 255).rgb()); d.readU32(5, &m_rgbColor, QColor(0, 255, 255).rgb());

View File

@ -25,7 +25,6 @@ class Serializable;
struct FileSinkSettings struct FileSinkSettings
{ {
bool m_ncoMode;
qint32 m_inputFrequencyOffset; qint32 m_inputFrequencyOffset;
QString m_fileRecordName; QString m_fileRecordName;
quint32 m_rgbColor; quint32 m_rgbColor;

View File

@ -26,6 +26,7 @@
#include "dsp/wavfilerecord.h" #include "dsp/wavfilerecord.h"
FileSinkSink::FileSinkSink() : FileSinkSink::FileSinkSink() :
m_sinkSampleRate(0),
m_nbCaptures(0), m_nbCaptures(0),
m_preRecordBuffer(48000), m_preRecordBuffer(48000),
m_preRecordFill(0), m_preRecordFill(0),
@ -50,7 +51,7 @@ void FileSinkSink::startRecording()
if (m_recordEnabled) // File is open for writing and valid if (m_recordEnabled) // File is open for writing and valid
{ {
// set the length of pre record time // 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); m_fileSink->setMsShift(-mSShift);
// notify capture start // notify capture start