SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
sdrbase
dsp
filerecord.h
Go to the documentation of this file.
1
// Copyright (C) 2015-2018 Edouard Griffiths, F4EXB //
3
// //
4
// This program is free software; you can redistribute it and/or modify //
5
// it under the terms of the GNU General Public License as published by //
6
// the Free Software Foundation as version 3 of the License, or //
7
// (at your option) any later version. //
8
// //
9
// This program is distributed in the hope that it will be useful, //
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12
// GNU General Public License V3 for more details. //
13
// //
14
// You should have received a copy of the GNU General Public License //
15
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
17
18
#ifndef INCLUDE_FILERECORD_H
19
#define INCLUDE_FILERECORD_H
20
21
#include <
dsp/basebandsamplesink.h
>
22
#include <string>
23
#include <iostream>
24
#include <fstream>
25
26
#include <ctime>
27
#include "
export.h
"
28
29
class
Message
;
30
31
class
SDRBASE_API
FileRecord
:
public
BasebandSampleSink
{
32
public
:
33
34
#pragma pack(push, 1)
35
struct
Header
36
{
37
quint32
sampleRate
;
38
quint64
centerFrequency
;
39
quint64
startTimeStamp
;
40
quint32
sampleSize
;
41
quint32
filler
;
42
quint32
crc32
;
43
};
44
#pragma pack(pop)
45
46
FileRecord
();
47
FileRecord
(
const
QString& filename);
48
virtual
~
FileRecord
();
49
50
quint64
getByteCount
()
const
{
return
m_byteCount; }
51
52
void
setFileName(
const
QString& filename);
53
void
genUniqueFileName(uint deviceUID,
int
istream = -1);
54
55
virtual
void
feed(
const
SampleVector::const_iterator& begin,
const
SampleVector::const_iterator& end,
bool
positiveOnly);
56
virtual
void
start();
57
virtual
void
stop();
58
virtual
bool
handleMessage(
const
Message
& message);
59
void
startRecording();
60
void
stopRecording();
61
bool
isRecording
()
const
{
return
m_recordOn; }
62
static
bool
readHeader(std::ifstream& samplefile,
Header
& header);
63
static
void
writeHeader(std::ofstream& samplefile,
Header
& header);
64
65
private
:
66
QString
m_fileName
;
67
quint32
m_sampleRate
;
68
quint64
m_centerFrequency
;
69
bool
m_recordOn
;
70
bool
m_recordStart
;
71
std::ofstream
m_sampleFile
;
72
quint64
m_byteCount
;
73
74
void
handleConfigure(
const
QString& fileName);
75
void
writeHeader();
76
};
77
78
#endif // INCLUDE_FILERECORD_H
FileRecord::m_byteCount
quint64 m_byteCount
Definition:
filerecord.h:72
FileRecord::m_recordStart
bool m_recordStart
Definition:
filerecord.h:70
Message
Definition:
message.h:25
FileRecord::m_sampleRate
quint32 m_sampleRate
Definition:
filerecord.h:67
export.h
FileRecord::Header::crc32
quint32 crc32
Definition:
filerecord.h:42
FileRecord::Header::centerFrequency
quint64 centerFrequency
Definition:
filerecord.h:38
FileRecord
Definition:
filerecord.h:31
FileRecord::Header
Definition:
filerecord.h:35
FileRecord::m_centerFrequency
quint64 m_centerFrequency
Definition:
filerecord.h:68
basebandsamplesink.h
FileRecord::m_sampleFile
std::ofstream m_sampleFile
Definition:
filerecord.h:71
BasebandSampleSink
Definition:
basebandsamplesink.h:30
FileRecord::Header::sampleRate
quint32 sampleRate
Definition:
filerecord.h:37
FileRecord::Header::filler
quint32 filler
Definition:
filerecord.h:41
FileRecord::Header::sampleSize
quint32 sampleSize
Definition:
filerecord.h:40
FileRecord::isRecording
bool isRecording() const
Definition:
filerecord.h:61
FileRecord::m_recordOn
bool m_recordOn
Definition:
filerecord.h:69
SDRBASE_API
#define SDRBASE_API
Definition:
export.h:40
FileRecord::m_fileName
QString m_fileName
Definition:
filerecord.h:66
FileRecord::getByteCount
quint64 getByteCount() const
Definition:
filerecord.h:50
FileRecord::Header::startTimeStamp
quint64 startTimeStamp
Definition:
filerecord.h:39
Generated on Fri Aug 2 2019 17:56:33 for SDRAngel by
1.8.13