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

#include <freedvdemodsettings.h>

+ Collaboration diagram for FreeDVDemodSettings:

Public Types

enum  FreeDVMode {
  FreeDVMode2400A, FreeDVMode1600, FreeDVMode800XA, FreeDVMode700C,
  FreeDVMode700D
}
 

Public Member Functions

 FreeDVDemodSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
void setSpectrumGUI (Serializable *spectrumGUI)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Static Public Member Functions

static int getHiCutoff (FreeDVMode freeDVMode)
 
static int getLowCutoff (FreeDVMode freeDVMode)
 
static int getModSampleRate (FreeDVMode freeDVMode)
 

Public Attributes

qint32 m_inputFrequencyOffset
 
Real m_volume
 
Real m_volumeIn
 
int m_spanLog2
 
bool m_audioMute
 
bool m_agc
 
quint32 m_rgbColor
 
QString m_title
 
QString m_audioDeviceName
 
FreeDVMode m_freeDVMode
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 
Serializablem_spectrumGUI
 

Static Public Attributes

static const int m_minPowerThresholdDB = -100
 
static const float m_mminPowerThresholdDBf = 100.0f
 

Detailed Description

Definition at line 27 of file freedvdemodsettings.h.

Member Enumeration Documentation

◆ FreeDVMode

Constructor & Destructor Documentation

◆ FreeDVDemodSettings()

FreeDVDemodSettings::FreeDVDemodSettings ( )

Definition at line 33 of file freedvdemodsettings.cpp.

References resetToDefaults().

33  :
34  m_channelMarker(0),
35  m_spectrumGUI(0)
36 {
38 }
Serializable * m_spectrumGUI
Serializable * m_channelMarker
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool FreeDVDemodSettings::deserialize ( const QByteArray &  data)

Definition at line 85 of file freedvdemodsettings.cpp.

References Serializable::deserialize(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_agc, m_audioDeviceName, AudioDeviceManager::m_defaultDeviceName, m_freeDVMode, m_inputFrequencyOffset, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_spanLog2, m_spectrumGUI, m_title, m_useReverseAPI, m_volume, m_volumeIn, SimpleDeserializer::readBlob(), SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by FreeDVDemodGUI::deserialize(), FreeDVDemod::deserialize(), and setSpectrumGUI().

86 {
87  SimpleDeserializer d(data);
88 
89  if(!d.isValid())
90  {
92  return false;
93  }
94 
95  if(d.getVersion() == 1)
96  {
97  QByteArray bytetmp;
98  qint32 tmp;
99  uint32_t utmp;
100  QString strtmp;
101 
102  d.readS32(1, &m_inputFrequencyOffset, 0);
103  d.readS32(2, &tmp, 30);
104  d.readS32(3, &tmp, 30);
105  m_volume = tmp / 10.0;
106 
107  if (m_spectrumGUI) {
108  d.readBlob(4, &bytetmp);
109  m_spectrumGUI->deserialize(bytetmp);
110  }
111 
112  d.readU32(5, &m_rgbColor);
113  d.readS32(6, &tmp, 10);
114  m_volumeIn = tmp / 10.0;
115  d.readS32(7, &m_spanLog2, 3);
116  d.readBool(11, &m_agc, false);
117  d.readString(16, &m_title, "SSB Demodulator");
119  d.readBool(18, &m_useReverseAPI, false);
120  d.readString(19, &m_reverseAPIAddress, "127.0.0.1");
121  d.readU32(20, &utmp, 0);
122 
123  if ((utmp > 1023) && (utmp < 65535)) {
124  m_reverseAPIPort = utmp;
125  } else {
126  m_reverseAPIPort = 8888;
127  }
128 
129  d.readU32(21, &utmp, 0);
130  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
131  d.readU32(22, &utmp, 0);
132  m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
133 
134  d.readS32(23, &tmp, 0);
135  if ((tmp < 0) || (tmp > (int) FreeDVMode::FreeDVMode700D)) {
136  m_freeDVMode = FreeDVMode::FreeDVMode2400A;
137  } else {
138  m_freeDVMode = (FreeDVMode) tmp;
139  }
140 
141  return true;
142  }
143  else
144  {
145  resetToDefaults();
146  return false;
147  }
148 }
static const QString m_defaultDeviceName
Serializable * m_spectrumGUI
unsigned int uint32_t
Definition: rtptypes_win.h:46
virtual bool deserialize(const QByteArray &data)=0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHiCutoff()

int FreeDVDemodSettings::getHiCutoff ( FreeDVMode  freeDVMode)
static

Definition at line 150 of file freedvdemodsettings.cpp.

References FreeDVMode1600, FreeDVMode2400A, FreeDVMode700C, FreeDVMode700D, and FreeDVMode800XA.

Referenced by FreeDVDemod::applyFreeDVMode(), FreeDVDemodGUI::displaySettings(), and FreeDVDemodGUI::on_freeDVMode_currentIndexChanged().

151 {
152  switch(freeDVMode)
153  {
154  case FreeDVMode800XA: // C4FM NB
155  case FreeDVMode700C: // OFDM
156  case FreeDVMode700D: // OFDM
157  case FreeDVMode1600: // OFDM
158  return 2400.0;
159  break;
160  case FreeDVMode2400A: // C4FM WB
161  default:
162  return 6000.0;
163  break;
164  }
165 }
+ Here is the caller graph for this function:

◆ getLowCutoff()

int FreeDVDemodSettings::getLowCutoff ( FreeDVMode  freeDVMode)
static

Definition at line 167 of file freedvdemodsettings.cpp.

References FreeDVMode1600, FreeDVMode2400A, FreeDVMode700C, FreeDVMode700D, and FreeDVMode800XA.

Referenced by FreeDVDemod::applyFreeDVMode(), FreeDVDemodGUI::displaySettings(), and FreeDVDemodGUI::on_freeDVMode_currentIndexChanged().

168 {
169  switch(freeDVMode)
170  {
171  case FreeDVMode800XA: // C4FM NB
172  return 400.0;
173  break;
174  case FreeDVMode700C: // OFDM
175  case FreeDVMode700D: // OFDM
176  case FreeDVMode1600: // OFDM
177  return 600.0;
178  break;
179  case FreeDVMode2400A: // C4FM WB
180  default:
181  return 0.0;
182  break;
183  }
184 }
+ Here is the caller graph for this function:

◆ getModSampleRate()

int FreeDVDemodSettings::getModSampleRate ( FreeDVMode  freeDVMode)
static

Definition at line 186 of file freedvdemodsettings.cpp.

References FreeDVMode2400A.

Referenced by FreeDVDemod::applyFreeDVMode().

187 {
188  if (freeDVMode == FreeDVMode2400A) {
189  return 48000;
190  } else {
191  return 8000;
192  }
193 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void FreeDVDemodSettings::resetToDefaults ( )

Definition at line 40 of file freedvdemodsettings.cpp.

References FreeDVMode2400A, m_agc, m_audioDeviceName, m_audioMute, AudioDeviceManager::m_defaultDeviceName, m_freeDVMode, m_inputFrequencyOffset, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_spanLog2, m_title, m_useReverseAPI, m_volume, and m_volumeIn.

Referenced by FreeDVDemodGUI::deserialize(), deserialize(), FreeDVDemod::deserialize(), FreeDVDemodSettings(), and FreeDVDemodGUI::resetToDefaults().

41 {
42  m_audioMute = false;
43  m_agc = true;
44  m_volume = 3.0;
45  m_volumeIn = 1.0;
46  m_spanLog2 = 3;
48  m_rgbColor = QColor(0, 255, 204).rgb();
49  m_title = "FreeDV Demodulator";
52  m_useReverseAPI = false;
53  m_reverseAPIAddress = "127.0.0.1";
54  m_reverseAPIPort = 8888;
57 }
static const QString m_defaultDeviceName
+ Here is the caller graph for this function:

◆ serialize()

QByteArray FreeDVDemodSettings::serialize ( ) const

Definition at line 59 of file freedvdemodsettings.cpp.

References SimpleSerializer::final(), m_agc, m_audioDeviceName, m_freeDVMode, m_inputFrequencyOffset, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_spanLog2, m_spectrumGUI, m_title, m_useReverseAPI, m_volume, m_volumeIn, Serializable::serialize(), SimpleSerializer::writeBlob(), SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by FreeDVDemodGUI::serialize(), FreeDVDemod::serialize(), and setSpectrumGUI().

60 {
61  SimpleSerializer s(1);
62  s.writeS32(1, m_inputFrequencyOffset);
63  s.writeS32(3, m_volume * 10.0);
64 
65  if (m_spectrumGUI) {
66  s.writeBlob(4, m_spectrumGUI->serialize());
67  }
68 
69  s.writeU32(5, m_rgbColor);
70  s.writeS32(6, m_volumeIn * 10.0);
71  s.writeS32(7, m_spanLog2);
72  s.writeBool(11, m_agc);
73  s.writeString(16, m_title);
74  s.writeString(17, m_audioDeviceName);
75  s.writeBool(18, m_useReverseAPI);
76  s.writeString(19, m_reverseAPIAddress);
77  s.writeU32(20, m_reverseAPIPort);
78  s.writeU32(21, m_reverseAPIDeviceIndex);
79  s.writeU32(22, m_reverseAPIChannelIndex);
80  s.writeS32(23, (int) m_freeDVMode);
81 
82  return s.final();
83 }
Serializable * m_spectrumGUI
virtual QByteArray serialize() const =0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void FreeDVDemodSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 59 of file freedvdemodsettings.h.

Referenced by FreeDVDemodGUI::FreeDVDemodGUI().

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

◆ setSpectrumGUI()

void FreeDVDemodSettings::setSpectrumGUI ( Serializable spectrumGUI)
inline

Definition at line 60 of file freedvdemodsettings.h.

References deserialize(), and serialize().

Referenced by FreeDVDemodGUI::FreeDVDemodGUI().

60 { m_spectrumGUI = spectrumGUI; }
Serializable * m_spectrumGUI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_agc

bool FreeDVDemodSettings::m_agc

◆ m_audioDeviceName

QString FreeDVDemodSettings::m_audioDeviceName

◆ m_audioMute

bool FreeDVDemodSettings::m_audioMute

◆ m_channelMarker

Serializable* FreeDVDemodSettings::m_channelMarker

Definition at line 54 of file freedvdemodsettings.h.

◆ m_freeDVMode

FreeDVMode FreeDVDemodSettings::m_freeDVMode

◆ m_inputFrequencyOffset

qint32 FreeDVDemodSettings::m_inputFrequencyOffset

◆ m_minPowerThresholdDB

const int FreeDVDemodSettings::m_minPowerThresholdDB = -100
static

Definition at line 64 of file freedvdemodsettings.h.

◆ m_mminPowerThresholdDBf

const float FreeDVDemodSettings::m_mminPowerThresholdDBf = 100.0f
static

Definition at line 65 of file freedvdemodsettings.h.

Referenced by FreeDVDemodGUI::tick().

◆ m_reverseAPIAddress

QString FreeDVDemodSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t FreeDVDemodSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t FreeDVDemodSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t FreeDVDemodSettings::m_reverseAPIPort

◆ m_rgbColor

quint32 FreeDVDemodSettings::m_rgbColor

◆ m_spanLog2

int FreeDVDemodSettings::m_spanLog2

◆ m_spectrumGUI

Serializable* FreeDVDemodSettings::m_spectrumGUI

Definition at line 55 of file freedvdemodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_title

QString FreeDVDemodSettings::m_title

◆ m_useReverseAPI

bool FreeDVDemodSettings::m_useReverseAPI

◆ m_volume

Real FreeDVDemodSettings::m_volume

◆ m_volumeIn

Real FreeDVDemodSettings::m_volumeIn

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