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.
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
WFMDemodSettings Struct Reference

#include <wfmdemodsettings.h>

+ Collaboration diagram for WFMDemodSettings:

Public Member Functions

 WFMDemodSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

qint64 m_inputFrequencyOffset
 
Real m_rfBandwidth
 
Real m_afBandwidth
 
Real m_volume
 
Real m_squelch
 
bool m_audioMute
 
quint32 m_rgbColor
 
QString m_title
 
QString m_audioDeviceName
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 

Static Public Attributes

static const int m_rfBWMin = 10000
 
static const int m_rfBWMax = 300000
 
static const int m_rfBWDigits = 6
 

Detailed Description

Definition at line 26 of file wfmdemodsettings.h.

Constructor & Destructor Documentation

◆ WFMDemodSettings()

WFMDemodSettings::WFMDemodSettings ( )

Definition at line 31 of file wfmdemodsettings.cpp.

References resetToDefaults().

31  :
33 {
35 }
Serializable * m_channelMarker
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool WFMDemodSettings::deserialize ( const QByteArray &  data)

Definition at line 80 of file wfmdemodsettings.cpp.

References Serializable::deserialize(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_afBandwidth, m_audioDeviceName, m_channelMarker, AudioDeviceManager::m_defaultDeviceName, m_inputFrequencyOffset, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rfBWMax, m_rgbColor, m_squelch, m_title, m_useReverseAPI, m_volume, SimpleDeserializer::readBlob(), SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by WFMDemodGUI::deserialize(), WFMDemod::deserialize(), and setChannelMarker().

81 {
82  SimpleDeserializer d(data);
83 
84  if(!d.isValid())
85  {
87  return false;
88  }
89 
90  if(d.getVersion() == 1)
91  {
92  QByteArray bytetmp;
93  qint32 tmp;
94  uint32_t utmp;
95  QString strtmp;
96 
97  d.readS32(1, &tmp, 0);
99  d.readS32(2, &tmp, 4);
100  m_rfBandwidth = tmp < m_rfBWMin ? m_rfBWMin : tmp > m_rfBWMax ? m_rfBWMax : tmp;
101  d.readS32(3, &tmp, 3);
102  m_afBandwidth = tmp * 1000.0;
103  d.readS32(4, &tmp, 20);
104  m_volume = tmp * 0.1;
105  d.readS32(5, &tmp, -60);
106  m_squelch = tmp;
107  d.readU32(7, &m_rgbColor);
108  d.readString(8, &m_title, "WFM Demodulator");
110 
111  d.readBlob(11, &bytetmp);
112 
113  if (m_channelMarker) {
114  m_channelMarker->deserialize(bytetmp);
115  }
116 
117  d.readBool(12, &m_useReverseAPI, false);
118  d.readString(13, &m_reverseAPIAddress, "127.0.0.1");
119  d.readU32(14, &utmp, 0);
120 
121  if ((utmp > 1023) && (utmp < 65535)) {
122  m_reverseAPIPort = utmp;
123  } else {
124  m_reverseAPIPort = 8888;
125  }
126 
127  d.readU32(15, &utmp, 0);
128  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
129  d.readU32(16, &utmp, 0);
130  m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
131 
132  return true;
133  }
134  else
135  {
136  resetToDefaults();
137  return false;
138  }
139 }
static const QString m_defaultDeviceName
qint64 m_inputFrequencyOffset
Serializable * m_channelMarker
uint16_t m_reverseAPIPort
uint16_t m_reverseAPIChannelIndex
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint16_t m_reverseAPIDeviceIndex
QString m_reverseAPIAddress
virtual bool deserialize(const QByteArray &data)=0
static const int m_rfBWMax
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void WFMDemodSettings::resetToDefaults ( )

Definition at line 37 of file wfmdemodsettings.cpp.

References m_afBandwidth, m_audioDeviceName, m_audioMute, AudioDeviceManager::m_defaultDeviceName, m_inputFrequencyOffset, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_squelch, m_title, m_useReverseAPI, and m_volume.

Referenced by deserialize(), WFMDemod::deserialize(), WFMDemodGUI::resetToDefaults(), and WFMDemodSettings().

38 {
40  m_rfBandwidth = 80000;
41  m_afBandwidth = 15000;
42  m_volume = 2.0;
43  m_squelch = -60.0;
44  m_audioMute = false;
45  m_rgbColor = QColor(0, 0, 255).rgb();
46  m_title = "WFM Demodulator";
48  m_useReverseAPI = false;
49  m_reverseAPIAddress = "127.0.0.1";
50  m_reverseAPIPort = 8888;
53 }
static const QString m_defaultDeviceName
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIPort
uint16_t m_reverseAPIChannelIndex
uint16_t m_reverseAPIDeviceIndex
QString m_reverseAPIAddress
+ Here is the caller graph for this function:

◆ serialize()

QByteArray WFMDemodSettings::serialize ( ) const

Definition at line 55 of file wfmdemodsettings.cpp.

References SimpleSerializer::final(), m_afBandwidth, m_audioDeviceName, m_channelMarker, m_inputFrequencyOffset, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_squelch, m_title, m_useReverseAPI, m_volume, Serializable::serialize(), SimpleSerializer::writeBlob(), SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by WFMDemodGUI::serialize(), WFMDemod::serialize(), and setChannelMarker().

56 {
57  SimpleSerializer s(1);
58  s.writeS32(1, m_inputFrequencyOffset);
59  s.writeS32(2, m_rfBandwidth);
60  s.writeS32(3, m_afBandwidth/1000.0);
61  s.writeS32(4, m_volume*10.0);
62  s.writeS32(5, m_squelch);
63  s.writeU32(7, m_rgbColor);
64  s.writeString(8, m_title);
65  s.writeString(9, m_audioDeviceName);
66 
67  if (m_channelMarker) {
68  s.writeBlob(11, m_channelMarker->serialize());
69  }
70 
71  s.writeBool(12, m_useReverseAPI);
72  s.writeString(13, m_reverseAPIAddress);
73  s.writeU32(14, m_reverseAPIPort);
74  s.writeU32(15, m_reverseAPIDeviceIndex);
75  s.writeU32(16, m_reverseAPIChannelIndex);
76 
77  return s.final();
78 }
qint64 m_inputFrequencyOffset
Serializable * m_channelMarker
uint16_t m_reverseAPIPort
uint16_t m_reverseAPIChannelIndex
uint16_t m_reverseAPIDeviceIndex
QString m_reverseAPIAddress
virtual QByteArray serialize() const =0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void WFMDemodSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 51 of file wfmdemodsettings.h.

References deserialize(), and serialize().

Referenced by WFMDemodGUI::WFMDemodGUI().

51 { m_channelMarker = channelMarker; }
Serializable * m_channelMarker
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_afBandwidth

Real WFMDemodSettings::m_afBandwidth

◆ m_audioDeviceName

QString WFMDemodSettings::m_audioDeviceName

◆ m_audioMute

bool WFMDemodSettings::m_audioMute

◆ m_channelMarker

Serializable* WFMDemodSettings::m_channelMarker

Definition at line 43 of file wfmdemodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_inputFrequencyOffset

qint64 WFMDemodSettings::m_inputFrequencyOffset

◆ m_reverseAPIAddress

QString WFMDemodSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t WFMDemodSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t WFMDemodSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t WFMDemodSettings::m_reverseAPIPort

◆ m_rfBandwidth

Real WFMDemodSettings::m_rfBandwidth

◆ m_rfBWDigits

const int WFMDemodSettings::m_rfBWDigits = 6
static

Definition at line 47 of file wfmdemodsettings.h.

Referenced by WFMDemodGUI::WFMDemodGUI().

◆ m_rfBWMax

const int WFMDemodSettings::m_rfBWMax = 300000
static

Definition at line 46 of file wfmdemodsettings.h.

Referenced by deserialize(), and WFMDemodGUI::WFMDemodGUI().

◆ m_rfBWMin

const int WFMDemodSettings::m_rfBWMin = 10000
static

Definition at line 45 of file wfmdemodsettings.h.

Referenced by WFMDemodGUI::WFMDemodGUI().

◆ m_rgbColor

quint32 WFMDemodSettings::m_rgbColor

◆ m_squelch

Real WFMDemodSettings::m_squelch

◆ m_title

QString WFMDemodSettings::m_title

◆ m_useReverseAPI

bool WFMDemodSettings::m_useReverseAPI

◆ m_volume

Real WFMDemodSettings::m_volume

The documentation for this struct was generated from the following files: