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 | List of all members
FreeDVModSettings Struct Reference

#include <freedvmodsettings.h>

+ Collaboration diagram for FreeDVModSettings:

Public Types

enum  FreeDVModInputAF {
  FreeDVModInputNone, FreeDVModInputTone, FreeDVModInputFile, FreeDVModInputAudio,
  FreeDVModInputCWTone
}
 
enum  FreeDVMode {
  FreeDVMode2400A, FreeDVMode1600, FreeDVMode800XA, FreeDVMode700C,
  FreeDVMode700D
}
 

Public Member Functions

 FreeDVModSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
void setSpectrumGUI (Serializable *spectrumGUI)
 
void setCWKeyerGUI (Serializable *cwKeyerGUI)
 
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

qint64 m_inputFrequencyOffset
 
float m_toneFrequency
 
float m_volumeFactor
 
int m_spanLog2
 
bool m_audioMute
 
bool m_playLoop
 
quint32 m_rgbColor
 
QString m_title
 
FreeDVModInputAF m_modAFInput
 
QString m_audioDeviceName
 
FreeDVMode m_freeDVMode
 
bool m_gaugeInputElseModem
 Volume gauge shows speech input level else modem level. More...
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 
Serializablem_spectrumGUI
 
Serializablem_cwKeyerGUI
 

Detailed Description

Definition at line 27 of file freedvmodsettings.h.

Member Enumeration Documentation

◆ FreeDVMode

◆ FreeDVModInputAF

Constructor & Destructor Documentation

◆ FreeDVModSettings()

FreeDVModSettings::FreeDVModSettings ( )

Definition at line 25 of file freedvmodsettings.cpp.

References resetToDefaults().

25  :
26  m_channelMarker(0),
27  m_spectrumGUI(0),
28  m_cwKeyerGUI(0)
29 {
31 }
Serializable * m_spectrumGUI
Serializable * m_cwKeyerGUI
Serializable * m_channelMarker
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool FreeDVModSettings::deserialize ( const QByteArray &  data)

Definition at line 91 of file freedvmodsettings.cpp.

References Serializable::deserialize(), FreeDVModInputNone, SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_audioDeviceName, m_channelMarker, m_cwKeyerGUI, AudioDeviceManager::m_defaultDeviceName, m_freeDVMode, m_gaugeInputElseModem, m_inputFrequencyOffset, m_modAFInput, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_spanLog2, m_spectrumGUI, m_title, m_toneFrequency, m_useReverseAPI, SimpleDeserializer::readBlob(), SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by FreeDVModGUI::deserialize(), FreeDVMod::deserialize(), and setCWKeyerGUI().

92 {
93  SimpleDeserializer d(data);
94 
95  if(!d.isValid())
96  {
98  return false;
99  }
100 
101  if(d.getVersion() == 1)
102  {
103  QByteArray bytetmp;
104  qint32 tmp;
105  uint32_t utmp;
106 
107  d.readS32(1, &tmp, 0);
109 
110  d.readS32(3, &tmp, 100);
111  m_toneFrequency = tmp * 10.0;
112 
113  if (m_spectrumGUI)
114  {
115  d.readBlob(4, &bytetmp);
116  m_spectrumGUI->deserialize(bytetmp);
117  }
118 
119  d.readU32(5, &m_rgbColor);
120 
121  if (m_cwKeyerGUI) {
122  d.readBlob(6, &bytetmp);
123  m_cwKeyerGUI->deserialize(bytetmp);
124  }
125 
126  d.readBool(7, &m_gaugeInputElseModem, false);
127  d.readS32(8, &m_spanLog2, 3);
128 
129  d.readS32(10, &tmp, 0);
130  if ((tmp < 0) || (tmp > (int) FreeDVMode::FreeDVMode700D)) {
131  m_freeDVMode = FreeDVMode::FreeDVMode2400A;
132  } else {
133  m_freeDVMode = (FreeDVMode) tmp;
134  }
135 
136  if (m_channelMarker) {
137  d.readBlob(18, &bytetmp);
138  m_channelMarker->deserialize(bytetmp);
139  }
140 
141  d.readString(19, &m_title, "FreeDV Modulator");
143 
144  d.readS32(21, &tmp, 0);
145  if ((tmp < 0) || (tmp > (int) FreeDVModInputAF::FreeDVModInputTone)) {
147  } else {
149  }
150 
151  d.readBool(22, &m_useReverseAPI, false);
152  d.readString(23, &m_reverseAPIAddress, "127.0.0.1");
153  d.readU32(24, &utmp, 0);
154 
155  if ((utmp > 1023) && (utmp < 65535)) {
156  m_reverseAPIPort = utmp;
157  } else {
158  m_reverseAPIPort = 8888;
159  }
160 
161  d.readU32(25, &utmp, 0);
162  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
163  d.readU32(26, &utmp, 0);
164  m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
165 
166  return true;
167  }
168  else
169  {
170  resetToDefaults();
171  return false;
172  }
173 }
static const QString m_defaultDeviceName
uint16_t m_reverseAPIDeviceIndex
Serializable * m_spectrumGUI
Serializable * m_cwKeyerGUI
Serializable * m_channelMarker
bool m_gaugeInputElseModem
Volume gauge shows speech input level else modem level.
unsigned int uint32_t
Definition: rtptypes_win.h:46
FreeDVModInputAF m_modAFInput
virtual bool deserialize(const QByteArray &data)=0
uint16_t m_reverseAPIChannelIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHiCutoff()

int FreeDVModSettings::getHiCutoff ( FreeDVMode  freeDVMode)
static

◆ getLowCutoff()

int FreeDVModSettings::getLowCutoff ( FreeDVMode  freeDVMode)
static

Definition at line 192 of file freedvmodsettings.cpp.

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

Referenced by FreeDVMod::applyFreeDVMode(), FreeDVModGUI::displaySettings(), FreeDVModGUI::on_freeDVMode_currentIndexChanged(), and setCWKeyerGUI().

193 {
194  switch(freeDVMode)
195  {
196  case FreeDVModSettings::FreeDVMode800XA: // C4FM NB
197  return 400.0;
198  break;
202  return 600.0;
203  break;
204  case FreeDVModSettings::FreeDVMode2400A: // C4FM WB
205  default:
206  return 0.0;
207  break;
208  }
209 }
+ Here is the caller graph for this function:

◆ getModSampleRate()

int FreeDVModSettings::getModSampleRate ( FreeDVMode  freeDVMode)
static

Definition at line 211 of file freedvmodsettings.cpp.

References FreeDVMode2400A.

Referenced by FreeDVMod::applyFreeDVMode(), and setCWKeyerGUI().

212 {
213  if (freeDVMode == FreeDVModSettings::FreeDVMode2400A) {
214  return 48000;
215  } else {
216  return 8000;
217  }
218 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void FreeDVModSettings::resetToDefaults ( )

Definition at line 33 of file freedvmodsettings.cpp.

References m_audioDeviceName, m_audioMute, AudioDeviceManager::m_defaultDeviceName, m_freeDVMode, m_gaugeInputElseModem, m_inputFrequencyOffset, m_modAFInput, m_playLoop, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_spanLog2, m_title, m_toneFrequency, m_useReverseAPI, and m_volumeFactor.

Referenced by FreeDVModGUI::deserialize(), deserialize(), FreeDVMod::deserialize(), FreeDVModSettings(), and FreeDVModGUI::resetToDefaults().

34 {
36  m_toneFrequency = 1000.0;
37  m_volumeFactor = 1.0;
38  m_spanLog2 = 3;
39  m_audioMute = false;
40  m_playLoop = false;
41  m_rgbColor = QColor(0, 255, 204).rgb();
42  m_title = "FreeDV Modulator";
43  m_modAFInput = FreeDVModInputAF::FreeDVModInputNone;
45  m_freeDVMode = FreeDVMode::FreeDVMode2400A;
46  m_gaugeInputElseModem = false;
47  m_useReverseAPI = false;
48  m_reverseAPIAddress = "127.0.0.1";
49  m_reverseAPIPort = 8888;
52 }
static const QString m_defaultDeviceName
uint16_t m_reverseAPIDeviceIndex
bool m_gaugeInputElseModem
Volume gauge shows speech input level else modem level.
FreeDVModInputAF m_modAFInput
uint16_t m_reverseAPIChannelIndex
+ Here is the caller graph for this function:

◆ serialize()

QByteArray FreeDVModSettings::serialize ( ) const

Definition at line 54 of file freedvmodsettings.cpp.

References SimpleSerializer::final(), m_audioDeviceName, m_channelMarker, m_cwKeyerGUI, m_freeDVMode, m_gaugeInputElseModem, m_inputFrequencyOffset, m_modAFInput, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_spanLog2, m_spectrumGUI, m_title, m_toneFrequency, m_useReverseAPI, Serializable::serialize(), SimpleSerializer::writeBlob(), SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by FreeDVModGUI::serialize(), FreeDVMod::serialize(), and setCWKeyerGUI().

55 {
56  SimpleSerializer s(1);
57 
58  s.writeS32(1, m_inputFrequencyOffset);
59  s.writeS32(3, roundf(m_toneFrequency / 10.0));
60 
61  if (m_spectrumGUI) {
62  s.writeBlob(4, m_spectrumGUI->serialize());
63  }
64 
65  s.writeU32(5, m_rgbColor);
66 
67  if (m_cwKeyerGUI) {
68  s.writeBlob(6, m_cwKeyerGUI->serialize());
69  }
70 
71  s.writeBool(7, m_gaugeInputElseModem);
72  s.writeS32(8, m_spanLog2);
73  s.writeS32(10, (int) m_freeDVMode);
74 
75  if (m_channelMarker) {
76  s.writeBlob(18, m_channelMarker->serialize());
77  }
78 
79  s.writeString(19, m_title);
80  s.writeString(20, m_audioDeviceName);
81  s.writeS32(21, (int) m_modAFInput);
82  s.writeBool(22, m_useReverseAPI);
83  s.writeString(23, m_reverseAPIAddress);
84  s.writeU32(24, m_reverseAPIPort);
85  s.writeU32(25, m_reverseAPIDeviceIndex);
86  s.writeU32(26, m_reverseAPIChannelIndex);
87 
88  return s.final();
89 }
uint16_t m_reverseAPIDeviceIndex
Serializable * m_spectrumGUI
Serializable * m_cwKeyerGUI
Serializable * m_channelMarker
bool m_gaugeInputElseModem
Volume gauge shows speech input level else modem level.
FreeDVModInputAF m_modAFInput
virtual QByteArray serialize() const =0
uint16_t m_reverseAPIChannelIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void FreeDVModSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 73 of file freedvmodsettings.h.

Referenced by FreeDVModGUI::FreeDVModGUI().

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

◆ setCWKeyerGUI()

void FreeDVModSettings::setCWKeyerGUI ( Serializable cwKeyerGUI)
inline

Definition at line 75 of file freedvmodsettings.h.

References deserialize(), getHiCutoff(), getLowCutoff(), getModSampleRate(), and serialize().

Referenced by FreeDVModGUI::FreeDVModGUI().

75 { m_cwKeyerGUI = cwKeyerGUI; }
Serializable * m_cwKeyerGUI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSpectrumGUI()

void FreeDVModSettings::setSpectrumGUI ( Serializable spectrumGUI)
inline

Definition at line 74 of file freedvmodsettings.h.

Referenced by FreeDVModGUI::FreeDVModGUI().

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

Member Data Documentation

◆ m_audioDeviceName

QString FreeDVModSettings::m_audioDeviceName

◆ m_audioMute

bool FreeDVModSettings::m_audioMute

◆ m_channelMarker

Serializable* FreeDVModSettings::m_channelMarker

Definition at line 67 of file freedvmodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_cwKeyerGUI

Serializable* FreeDVModSettings::m_cwKeyerGUI

Definition at line 69 of file freedvmodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_freeDVMode

FreeDVMode FreeDVModSettings::m_freeDVMode

◆ m_gaugeInputElseModem

bool FreeDVModSettings::m_gaugeInputElseModem

◆ m_inputFrequencyOffset

qint64 FreeDVModSettings::m_inputFrequencyOffset

◆ m_modAFInput

FreeDVModInputAF FreeDVModSettings::m_modAFInput

◆ m_playLoop

bool FreeDVModSettings::m_playLoop

◆ m_reverseAPIAddress

QString FreeDVModSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t FreeDVModSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t FreeDVModSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t FreeDVModSettings::m_reverseAPIPort

◆ m_rgbColor

quint32 FreeDVModSettings::m_rgbColor

◆ m_spanLog2

int FreeDVModSettings::m_spanLog2

◆ m_spectrumGUI

Serializable* FreeDVModSettings::m_spectrumGUI

Definition at line 68 of file freedvmodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_title

QString FreeDVModSettings::m_title

◆ m_toneFrequency

float FreeDVModSettings::m_toneFrequency

◆ m_useReverseAPI

bool FreeDVModSettings::m_useReverseAPI

◆ m_volumeFactor

float FreeDVModSettings::m_volumeFactor

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