mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-21 07:41:46 -05:00
FileSink: API updates
This commit is contained in:
parent
3641eb7295
commit
da87986b5f
@ -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());
|
||||
|
@ -25,7 +25,6 @@ class Serializable;
|
||||
|
||||
struct FileSinkSettings
|
||||
{
|
||||
bool m_ncoMode;
|
||||
qint32 m_inputFrequencyOffset;
|
||||
QString m_fileRecordName;
|
||||
quint32 m_rgbColor;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user