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
WFMModSettings Struct Reference

#include <wfmmodsettings.h>

+ Collaboration diagram for WFMModSettings:

Public Types

enum  WFMModInputAF {
  WFMModInputNone, WFMModInputTone, WFMModInputFile, WFMModInputAudio,
  WFMModInputCWTone
}
 

Public Member Functions

 WFMModSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
void setCWKeyerGUI (Serializable *cwKeyerGUI)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Static Public Member Functions

static int getRFBW (int index)
 
static int getRFBWIndex (int rfbw)
 

Public Attributes

qint64 m_inputFrequencyOffset
 
Real m_rfBandwidth
 
Real m_afBandwidth
 
float m_fmDeviation
 
float m_toneFrequency
 
float m_volumeFactor
 
bool m_channelMute
 
bool m_playLoop
 
quint32 m_rgbColor
 
QString m_title
 
WFMModInputAF m_modAFInput
 
QString m_audioDeviceName
 This is the audio device you get the audio samples from. More...
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 
Serializablem_cwKeyerGUI
 

Static Public Attributes

static const int m_nbRfBW = 14
 
static const int m_rfBW []
 

Detailed Description

Definition at line 25 of file wfmmodsettings.h.

Member Enumeration Documentation

◆ WFMModInputAF

Enumerator
WFMModInputNone 
WFMModInputTone 
WFMModInputFile 
WFMModInputAudio 
WFMModInputCWTone 

Definition at line 27 of file wfmmodsettings.h.

Constructor & Destructor Documentation

◆ WFMModSettings()

WFMModSettings::WFMModSettings ( )

Definition at line 32 of file wfmmodsettings.cpp.

References resetToDefaults().

32  :
33  m_channelMarker(0),
34  m_cwKeyerGUI(0)
35 {
37 }
Serializable * m_cwKeyerGUI
Serializable * m_channelMarker
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool WFMModSettings::deserialize ( const QByteArray &  data)

Definition at line 92 of file wfmmodsettings.cpp.

References Serializable::deserialize(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_afBandwidth, m_audioDeviceName, m_channelMarker, m_cwKeyerGUI, AudioDeviceManager::m_defaultDeviceName, m_fmDeviation, m_inputFrequencyOffset, m_modAFInput, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_title, m_toneFrequency, m_useReverseAPI, m_volumeFactor, SimpleDeserializer::readBlob(), SimpleDeserializer::readBool(), SimpleDeserializer::readReal(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), resetToDefaults(), and WFMModInputNone.

Referenced by WFMModGUI::deserialize(), WFMMod::deserialize(), and setCWKeyerGUI().

93 {
94  SimpleDeserializer d(data);
95 
96  if(!d.isValid())
97  {
99  return false;
100  }
101 
102  if(d.getVersion() == 1)
103  {
104  QByteArray bytetmp;
105  qint32 tmp;
106  uint32_t utmp;
107 
108  d.readS32(1, &tmp, 0);
110  d.readReal(2, &m_rfBandwidth, 125000.0);
111  d.readReal(3, &m_afBandwidth, 15000.0);
112  d.readReal(4, &m_fmDeviation, 50000.0);
113  d.readU32(5, &m_rgbColor);
114  d.readReal(6, &m_toneFrequency, 1000.0);
115  d.readReal(7, &m_volumeFactor, 1.0);
116 
117  if (m_cwKeyerGUI) {
118  d.readBlob(8, &bytetmp);
119  m_cwKeyerGUI->deserialize(bytetmp);
120  }
121 
122  if (m_channelMarker) {
123  d.readBlob(9, &bytetmp);
124  m_channelMarker->deserialize(bytetmp);
125  }
126 
127  d.readString(10, &m_title, "WFM Modulator");
129 
130  d.readS32(12, &tmp, 0);
131  if ((tmp < 0) || (tmp > (int) WFMModInputAF::WFMModInputTone)) {
133  } else {
134  m_modAFInput = (WFMModInputAF) tmp;
135  }
136 
137  d.readBool(13, &m_useReverseAPI, false);
138  d.readString(14, &m_reverseAPIAddress, "127.0.0.1");
139  d.readU32(15, &utmp, 0);
140 
141  if ((utmp > 1023) && (utmp < 65535)) {
142  m_reverseAPIPort = utmp;
143  } else {
144  m_reverseAPIPort = 8888;
145  }
146 
147  d.readU32(16, &utmp, 0);
148  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
149  d.readU32(17, &utmp, 0);
150  m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
151 
152  return true;
153  }
154  else
155  {
156  qDebug() << "WFMModSettings::deserialize: ERROR";
157  resetToDefaults();
158  return false;
159  }
160 }
static const QString m_defaultDeviceName
Serializable * m_cwKeyerGUI
uint16_t m_reverseAPIChannelIndex
WFMModInputAF m_modAFInput
quint32 m_rgbColor
unsigned int uint32_t
Definition: rtptypes_win.h:46
QString m_audioDeviceName
This is the audio device you get the audio samples from.
virtual bool deserialize(const QByteArray &data)=0
uint16_t m_reverseAPIPort
QString m_reverseAPIAddress
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIDeviceIndex
Serializable * m_channelMarker
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRFBW()

int WFMModSettings::getRFBW ( int  index)
static

Definition at line 162 of file wfmmodsettings.cpp.

References m_nbRfBW, and m_rfBW.

Referenced by WFMModGUI::applySettings(), WFMModGUI::on_rfBW_currentIndexChanged(), setCWKeyerGUI(), and WFMModGUI::WFMModGUI().

163 {
164  if (index < 0) {
165  return m_rfBW[0];
166  } else if (index < m_nbRfBW) {
167  return m_rfBW[index];
168  } else {
169  return m_rfBW[m_nbRfBW-1];
170  }
171 }
static const int m_nbRfBW
static const int m_rfBW[]
+ Here is the caller graph for this function:

◆ getRFBWIndex()

int WFMModSettings::getRFBWIndex ( int  rfbw)
static

Definition at line 173 of file wfmmodsettings.cpp.

References i, m_nbRfBW, and m_rfBW.

Referenced by WFMModGUI::displaySettings(), and setCWKeyerGUI().

174 {
175  for (int i = 0; i < m_nbRfBW; i++)
176  {
177  if (rfbw <= m_rfBW[i])
178  {
179  return i;
180  }
181  }
182 
183  return m_nbRfBW-1;
184 }
static const int m_nbRfBW
static const int m_rfBW[]
int32_t i
Definition: decimators.h:244
+ Here is the caller graph for this function:

◆ resetToDefaults()

void WFMModSettings::resetToDefaults ( )

Definition at line 39 of file wfmmodsettings.cpp.

References m_afBandwidth, m_audioDeviceName, m_channelMute, AudioDeviceManager::m_defaultDeviceName, m_fmDeviation, m_inputFrequencyOffset, m_modAFInput, m_playLoop, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_title, m_toneFrequency, m_useReverseAPI, m_volumeFactor, and WFMModInputNone.

Referenced by deserialize(), WFMMod::deserialize(), WFMModGUI::resetToDefaults(), and WFMModSettings().

40 {
42  m_rfBandwidth = 125000.0f;
43  m_afBandwidth = 15000.0f;
44  m_fmDeviation = 50000.0f;
45  m_toneFrequency = 1000.0f;
46  m_volumeFactor = 1.0f;
47  m_channelMute = false;
48  m_playLoop = false;
49  m_rgbColor = QColor(0, 0, 255).rgb();
50  m_title = "WFM Modulator";
53  m_useReverseAPI = false;
54  m_reverseAPIAddress = "127.0.0.1";
55  m_reverseAPIPort = 8888;
58 }
static const QString m_defaultDeviceName
uint16_t m_reverseAPIChannelIndex
WFMModInputAF m_modAFInput
quint32 m_rgbColor
QString m_audioDeviceName
This is the audio device you get the audio samples from.
uint16_t m_reverseAPIPort
QString m_reverseAPIAddress
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIDeviceIndex
+ Here is the caller graph for this function:

◆ serialize()

QByteArray WFMModSettings::serialize ( ) const

Definition at line 60 of file wfmmodsettings.cpp.

References SimpleSerializer::final(), m_afBandwidth, m_audioDeviceName, m_channelMarker, m_cwKeyerGUI, m_fmDeviation, m_inputFrequencyOffset, m_modAFInput, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_title, m_toneFrequency, m_useReverseAPI, m_volumeFactor, Serializable::serialize(), SimpleSerializer::writeBlob(), SimpleSerializer::writeBool(), SimpleSerializer::writeReal(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by WFMModGUI::serialize(), WFMMod::serialize(), and setCWKeyerGUI().

61 {
62  SimpleSerializer s(1);
63 
64  s.writeS32(1, m_inputFrequencyOffset);
65  s.writeReal(2, m_rfBandwidth);
66  s.writeReal(3, m_afBandwidth);
67  s.writeReal(4, m_fmDeviation);
68  s.writeU32(5, m_rgbColor);
69  s.writeReal(6, m_toneFrequency);
70  s.writeReal(7, m_volumeFactor);
71 
72  if (m_cwKeyerGUI) {
73  s.writeBlob(8, m_cwKeyerGUI->serialize());
74  }
75 
76  if (m_channelMarker) {
77  s.writeBlob(9, m_channelMarker->serialize());
78  }
79 
80  s.writeString(10, m_title);
81  s.writeString(11, m_audioDeviceName);
82  s.writeS32(12, (int) m_modAFInput);
83  s.writeBool(13, m_useReverseAPI);
84  s.writeString(14, m_reverseAPIAddress);
85  s.writeU32(15, m_reverseAPIPort);
86  s.writeU32(16, m_reverseAPIDeviceIndex);
87  s.writeU32(17, m_reverseAPIChannelIndex);
88 
89  return s.final();
90 }
Serializable * m_cwKeyerGUI
uint16_t m_reverseAPIChannelIndex
WFMModInputAF m_modAFInput
quint32 m_rgbColor
QString m_audioDeviceName
This is the audio device you get the audio samples from.
uint16_t m_reverseAPIPort
virtual QByteArray serialize() const =0
QString m_reverseAPIAddress
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIDeviceIndex
Serializable * m_channelMarker
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void WFMModSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 62 of file wfmmodsettings.h.

Referenced by WFMModGUI::WFMModGUI().

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

◆ setCWKeyerGUI()

void WFMModSettings::setCWKeyerGUI ( Serializable cwKeyerGUI)
inline

Definition at line 63 of file wfmmodsettings.h.

References deserialize(), getRFBW(), getRFBWIndex(), and serialize().

Referenced by WFMModGUI::WFMModGUI().

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

Member Data Documentation

◆ m_afBandwidth

Real WFMModSettings::m_afBandwidth

◆ m_audioDeviceName

QString WFMModSettings::m_audioDeviceName

This is the audio device you get the audio samples from.

Definition at line 50 of file wfmmodsettings.h.

Referenced by WFMMod::applySettings(), WFMModGUI::audioSelect(), deserialize(), resetToDefaults(), serialize(), WFMMod::webapiFormatChannelSettings(), and WFMMod::webapiReverseSendSettings().

◆ m_channelMarker

Serializable* WFMModSettings::m_channelMarker

Definition at line 57 of file wfmmodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_channelMute

bool WFMModSettings::m_channelMute

◆ m_cwKeyerGUI

Serializable* WFMModSettings::m_cwKeyerGUI

Definition at line 58 of file wfmmodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_fmDeviation

float WFMModSettings::m_fmDeviation

◆ m_inputFrequencyOffset

qint64 WFMModSettings::m_inputFrequencyOffset

◆ m_modAFInput

WFMModInputAF WFMModSettings::m_modAFInput

◆ m_nbRfBW

const int WFMModSettings::m_nbRfBW = 14
static

Definition at line 36 of file wfmmodsettings.h.

Referenced by getRFBW(), getRFBWIndex(), and WFMModGUI::WFMModGUI().

◆ m_playLoop

bool WFMModSettings::m_playLoop

◆ m_reverseAPIAddress

QString WFMModSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t WFMModSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t WFMModSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t WFMModSettings::m_reverseAPIPort

◆ m_rfBandwidth

Real WFMModSettings::m_rfBandwidth

◆ m_rfBW

const int WFMModSettings::m_rfBW
static
Initial value:
= {
12500, 25000, 40000, 60000, 75000, 80000, 100000, 125000, 140000, 160000, 180000, 200000, 220000, 250000
}

Definition at line 37 of file wfmmodsettings.h.

Referenced by getRFBW(), and getRFBWIndex().

◆ m_rgbColor

quint32 WFMModSettings::m_rgbColor

◆ m_title

QString WFMModSettings::m_title

◆ m_toneFrequency

float WFMModSettings::m_toneFrequency

◆ m_useReverseAPI

bool WFMModSettings::m_useReverseAPI

◆ m_volumeFactor

float WFMModSettings::m_volumeFactor

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