mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-17 13:51:47 -05:00
commit
811f1462aa
@ -35,7 +35,8 @@ FileRecord::FileRecord() :
|
|||||||
m_recordOn(false),
|
m_recordOn(false),
|
||||||
m_recordStart(false),
|
m_recordStart(false),
|
||||||
m_byteCount(0),
|
m_byteCount(0),
|
||||||
m_msShift(0)
|
m_msShift(0),
|
||||||
|
m_mutex(QMutex::Recursive)
|
||||||
{
|
{
|
||||||
setObjectName("FileRecord");
|
setObjectName("FileRecord");
|
||||||
}
|
}
|
||||||
@ -47,7 +48,8 @@ FileRecord::FileRecord(const QString& fileBase) :
|
|||||||
m_centerFrequency(0),
|
m_centerFrequency(0),
|
||||||
m_recordOn(false),
|
m_recordOn(false),
|
||||||
m_recordStart(false),
|
m_recordStart(false),
|
||||||
m_byteCount(0)
|
m_byteCount(0),
|
||||||
|
m_mutex(QMutex::Recursive)
|
||||||
{
|
{
|
||||||
setObjectName("FileRecord");
|
setObjectName("FileRecord");
|
||||||
}
|
}
|
||||||
@ -76,7 +78,10 @@ void FileRecord::genUniqueFileName(uint deviceUID, int istream)
|
|||||||
|
|
||||||
void FileRecord::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly)
|
void FileRecord::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly)
|
||||||
{
|
{
|
||||||
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
|
|
||||||
(void) positiveOnly;
|
(void) positiveOnly;
|
||||||
|
|
||||||
// if no recording is active, send the samples to /dev/null
|
// if no recording is active, send the samples to /dev/null
|
||||||
if(!m_recordOn)
|
if(!m_recordOn)
|
||||||
return;
|
return;
|
||||||
@ -105,6 +110,8 @@ void FileRecord::stop()
|
|||||||
|
|
||||||
bool FileRecord::startRecording()
|
bool FileRecord::startRecording()
|
||||||
{
|
{
|
||||||
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
|
|
||||||
if (m_recordOn) {
|
if (m_recordOn) {
|
||||||
stopRecording();
|
stopRecording();
|
||||||
}
|
}
|
||||||
@ -128,6 +135,8 @@ bool FileRecord::startRecording()
|
|||||||
|
|
||||||
bool FileRecord::stopRecording()
|
bool FileRecord::stopRecording()
|
||||||
{
|
{
|
||||||
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
|
|
||||||
if (m_sampleFile.is_open())
|
if (m_sampleFile.is_open())
|
||||||
{
|
{
|
||||||
qDebug() << "FileRecord::stopRecording";
|
qDebug() << "FileRecord::stopRecording";
|
||||||
|
@ -77,6 +77,7 @@ private:
|
|||||||
QString m_curentFileName;
|
QString m_curentFileName;
|
||||||
quint64 m_byteCount;
|
quint64 m_byteCount;
|
||||||
int m_msShift;
|
int m_msShift;
|
||||||
|
QMutex m_mutex;
|
||||||
|
|
||||||
void writeHeader();
|
void writeHeader();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user