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 | Public Attributes | Static Public Attributes | List of all members
SSBModSettings Struct Reference

#include <ssbmodsettings.h>

+ Collaboration diagram for SSBModSettings:

Public Types

enum  SSBModInputAF {
  SSBModInputNone, SSBModInputTone, SSBModInputFile, SSBModInputAudio,
  SSBModInputCWTone
}
 

Public Member Functions

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

Public Attributes

qint64 m_inputFrequencyOffset
 
Real m_bandwidth
 
Real m_lowCutoff
 
bool m_usb
 
float m_toneFrequency
 
float m_volumeFactor
 
int m_spanLog2
 
bool m_audioBinaural
 
bool m_audioFlipChannels
 
bool m_dsb
 
bool m_audioMute
 
bool m_playLoop
 
bool m_agc
 
quint32 m_rgbColor
 
QString m_title
 
SSBModInputAF m_modAFInput
 
QString m_audioDeviceName
 This is the audio device you get the audio samples from. More...
 
QString m_feedbackAudioDeviceName
 This is the audio device you send the audio samples to for audio feedback. More...
 
float m_feedbackVolumeFactor
 
bool m_feedbackAudioEnable
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 
Serializablem_spectrumGUI
 
Serializablem_cwKeyerGUI
 

Static Public Attributes

static const int m_nbAGCTimeConstants = 10
 
static const int m_agcTimeConstant []
 

Detailed Description

Definition at line 27 of file ssbmodsettings.h.

Member Enumeration Documentation

◆ SSBModInputAF

Enumerator
SSBModInputNone 
SSBModInputTone 
SSBModInputFile 
SSBModInputAudio 
SSBModInputCWTone 

Definition at line 29 of file ssbmodsettings.h.

Constructor & Destructor Documentation

◆ SSBModSettings()

SSBModSettings::SSBModSettings ( )

Definition at line 39 of file ssbmodsettings.cpp.

References resetToDefaults().

39  :
40  m_channelMarker(0),
41  m_spectrumGUI(0),
42  m_cwKeyerGUI(0)
43 {
45 }
Serializable * m_channelMarker
Serializable * m_spectrumGUI
Serializable * m_cwKeyerGUI
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool SSBModSettings::deserialize ( const QByteArray &  data)

Definition at line 120 of file ssbmodsettings.cpp.

References Serializable::deserialize(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_agc, m_audioBinaural, m_audioDeviceName, m_audioFlipChannels, m_bandwidth, m_channelMarker, m_cwKeyerGUI, AudioDeviceManager::m_defaultDeviceName, m_dsb, m_feedbackAudioDeviceName, m_feedbackAudioEnable, m_feedbackVolumeFactor, m_inputFrequencyOffset, m_lowCutoff, 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::readReal(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), resetToDefaults(), and SSBModInputNone.

Referenced by SSBModGUI::deserialize(), SSBMod::deserialize(), and setCWKeyerGUI().

121 {
122  SimpleDeserializer d(data);
123 
124  if(!d.isValid())
125  {
126  resetToDefaults();
127  return false;
128  }
129 
130  if(d.getVersion() == 1)
131  {
132  QByteArray bytetmp;
133  qint32 tmp;
134  uint32_t utmp;
135 
136  d.readS32(1, &tmp, 0);
138 
139  d.readS32(2, &tmp, 30);
140  m_bandwidth = tmp * 100.0;
141 
142  d.readS32(3, &tmp, 100);
143  m_toneFrequency = tmp * 10.0;
144 
145  if (m_spectrumGUI)
146  {
147  d.readBlob(4, &bytetmp);
148  m_spectrumGUI->deserialize(bytetmp);
149  }
150 
151  d.readU32(5, &m_rgbColor);
152 
153  if (m_cwKeyerGUI) {
154  d.readBlob(6, &bytetmp);
155  m_cwKeyerGUI->deserialize(bytetmp);
156  }
157 
158  d.readS32(7, &tmp, 3);
159  m_lowCutoff = tmp * 100.0;
160 
161  d.readS32(8, &m_spanLog2, 3);
162  d.readBool(9, &m_audioBinaural, false);
163  d.readBool(10, &m_audioFlipChannels, false);
164  d.readBool(11, &m_dsb, false);
165  d.readBool(12, &m_agc, false);
166  d.readS32(13, &tmp, 7);
167 
168  if (m_channelMarker) {
169  d.readBlob(18, &bytetmp);
170  m_channelMarker->deserialize(bytetmp);
171  }
172 
173  d.readString(19, &m_title, "SSB Modulator");
175 
176  d.readS32(21, &tmp, 0);
177  if ((tmp < 0) || (tmp > (int) SSBModInputAF::SSBModInputTone)) {
179  } else {
180  m_modAFInput = (SSBModInputAF) tmp;
181  }
182 
183  d.readBool(22, &m_useReverseAPI, false);
184  d.readString(23, &m_reverseAPIAddress, "127.0.0.1");
185  d.readU32(24, &utmp, 0);
186 
187  if ((utmp > 1023) && (utmp < 65535)) {
188  m_reverseAPIPort = utmp;
189  } else {
190  m_reverseAPIPort = 8888;
191  }
192 
193  d.readU32(25, &utmp, 0);
194  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
195  d.readU32(26, &utmp, 0);
196  m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
198  d.readReal(28, &m_feedbackVolumeFactor, 1.0);
199  d.readBool(29, &m_feedbackAudioEnable, false);
200 
201  return true;
202  }
203  else
204  {
205  resetToDefaults();
206  return false;
207  }
208 }
static const QString m_defaultDeviceName
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIChannelIndex
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
unsigned int uint32_t
Definition: rtptypes_win.h:46
float m_feedbackVolumeFactor
Serializable * m_channelMarker
QString m_audioDeviceName
This is the audio device you get the audio samples from.
SSBModInputAF m_modAFInput
uint16_t m_reverseAPIDeviceIndex
bool m_audioFlipChannels
Serializable * m_spectrumGUI
virtual bool deserialize(const QByteArray &data)=0
uint16_t m_reverseAPIPort
Serializable * m_cwKeyerGUI
QString m_reverseAPIAddress
quint32 m_rgbColor
bool m_feedbackAudioEnable
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void SSBModSettings::resetToDefaults ( )

Definition at line 47 of file ssbmodsettings.cpp.

References m_agc, m_audioBinaural, m_audioDeviceName, m_audioFlipChannels, m_audioMute, m_bandwidth, AudioDeviceManager::m_defaultDeviceName, m_dsb, m_feedbackAudioDeviceName, m_feedbackAudioEnable, m_feedbackVolumeFactor, m_inputFrequencyOffset, m_lowCutoff, m_modAFInput, m_playLoop, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_spanLog2, m_title, m_toneFrequency, m_usb, m_useReverseAPI, and m_volumeFactor.

Referenced by SSBModGUI::deserialize(), deserialize(), SSBMod::deserialize(), SSBModGUI::resetToDefaults(), and SSBModSettings().

48 {
50  m_bandwidth = 3000.0;
51  m_lowCutoff = 300.0;
52  m_usb = true;
53  m_toneFrequency = 1000.0;
54  m_volumeFactor = 1.0;
55  m_spanLog2 = 3;
56  m_audioBinaural = false;
57  m_audioFlipChannels = false;
58  m_dsb = false;
59  m_audioMute = false;
60  m_playLoop = false;
61  m_agc = false;
62  m_rgbColor = QColor(0, 255, 0).rgb();
63  m_title = "SSB Modulator";
64  m_modAFInput = SSBModInputAF::SSBModInputNone;
68  m_feedbackAudioEnable = false;
69  m_useReverseAPI = false;
70  m_reverseAPIAddress = "127.0.0.1";
71  m_reverseAPIPort = 8888;
74 }
static const QString m_defaultDeviceName
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIChannelIndex
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
float m_feedbackVolumeFactor
QString m_audioDeviceName
This is the audio device you get the audio samples from.
SSBModInputAF m_modAFInput
uint16_t m_reverseAPIDeviceIndex
bool m_audioFlipChannels
uint16_t m_reverseAPIPort
QString m_reverseAPIAddress
quint32 m_rgbColor
bool m_feedbackAudioEnable
+ Here is the caller graph for this function:

◆ serialize()

QByteArray SSBModSettings::serialize ( ) const

Definition at line 76 of file ssbmodsettings.cpp.

References SimpleSerializer::final(), m_agc, m_audioBinaural, m_audioDeviceName, m_audioFlipChannels, m_bandwidth, m_channelMarker, m_cwKeyerGUI, m_dsb, m_feedbackAudioDeviceName, m_feedbackAudioEnable, m_feedbackVolumeFactor, m_inputFrequencyOffset, m_lowCutoff, 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::writeReal(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by SSBModGUI::serialize(), SSBMod::serialize(), and setCWKeyerGUI().

77 {
78  SimpleSerializer s(1);
79 
80  s.writeS32(1, m_inputFrequencyOffset);
81  s.writeS32(2, roundf(m_bandwidth / 100.0));
82  s.writeS32(3, roundf(m_toneFrequency / 10.0));
83 
84  if (m_spectrumGUI) {
85  s.writeBlob(4, m_spectrumGUI->serialize());
86  }
87 
88  s.writeU32(5, m_rgbColor);
89 
90  if (m_cwKeyerGUI) {
91  s.writeBlob(6, m_cwKeyerGUI->serialize());
92  }
93 
94  s.writeS32(7, roundf(m_lowCutoff / 100.0));
95  s.writeS32(8, m_spanLog2);
96  s.writeBool(9, m_audioBinaural);
97  s.writeBool(10, m_audioFlipChannels);
98  s.writeBool(11, m_dsb);
99  s.writeBool(12, m_agc);
100 
101  if (m_channelMarker) {
102  s.writeBlob(18, m_channelMarker->serialize());
103  }
104 
105  s.writeString(19, m_title);
106  s.writeString(20, m_audioDeviceName);
107  s.writeS32(21, (int) m_modAFInput);
108  s.writeBool(22, m_useReverseAPI);
109  s.writeString(23, m_reverseAPIAddress);
110  s.writeU32(24, m_reverseAPIPort);
111  s.writeU32(25, m_reverseAPIDeviceIndex);
112  s.writeU32(26, m_reverseAPIChannelIndex);
113  s.writeString(27, m_feedbackAudioDeviceName);
114  s.writeReal(28, m_feedbackVolumeFactor);
115  s.writeBool(29, m_feedbackAudioEnable);
116 
117  return s.final();
118 }
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIChannelIndex
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
float m_feedbackVolumeFactor
Serializable * m_channelMarker
QString m_audioDeviceName
This is the audio device you get the audio samples from.
SSBModInputAF m_modAFInput
uint16_t m_reverseAPIDeviceIndex
bool m_audioFlipChannels
Serializable * m_spectrumGUI
uint16_t m_reverseAPIPort
Serializable * m_cwKeyerGUI
virtual QByteArray serialize() const =0
QString m_reverseAPIAddress
quint32 m_rgbColor
bool m_feedbackAudioEnable
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void SSBModSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 75 of file ssbmodsettings.h.

Referenced by SSBModGUI::SSBModGUI().

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

◆ setCWKeyerGUI()

void SSBModSettings::setCWKeyerGUI ( Serializable cwKeyerGUI)
inline

Definition at line 77 of file ssbmodsettings.h.

References deserialize(), and serialize().

Referenced by SSBModGUI::SSBModGUI().

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

◆ setSpectrumGUI()

void SSBModSettings::setSpectrumGUI ( Serializable spectrumGUI)
inline

Definition at line 76 of file ssbmodsettings.h.

Referenced by SSBModGUI::SSBModGUI().

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

Member Data Documentation

◆ m_agc

bool SSBModSettings::m_agc

◆ m_agcTimeConstant

const int SSBModSettings::m_agcTimeConstant
static
Initial value:
= {
1,
2,
5,
10,
20,
50,
100,
200,
500,
990}

Definition at line 39 of file ssbmodsettings.h.

◆ m_audioBinaural

bool SSBModSettings::m_audioBinaural

◆ m_audioDeviceName

QString SSBModSettings::m_audioDeviceName

◆ m_audioFlipChannels

bool SSBModSettings::m_audioFlipChannels

◆ m_audioMute

bool SSBModSettings::m_audioMute

◆ m_bandwidth

Real SSBModSettings::m_bandwidth

◆ m_channelMarker

Serializable* SSBModSettings::m_channelMarker

Definition at line 69 of file ssbmodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_cwKeyerGUI

Serializable* SSBModSettings::m_cwKeyerGUI

Definition at line 71 of file ssbmodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_dsb

bool SSBModSettings::m_dsb

◆ m_feedbackAudioDeviceName

QString SSBModSettings::m_feedbackAudioDeviceName

This is the audio device you send the audio samples to for audio feedback.

Definition at line 59 of file ssbmodsettings.h.

Referenced by SSBMod::applySettings(), SSBModGUI::audioFeedbackSelect(), deserialize(), resetToDefaults(), and serialize().

◆ m_feedbackAudioEnable

bool SSBModSettings::m_feedbackAudioEnable

◆ m_feedbackVolumeFactor

float SSBModSettings::m_feedbackVolumeFactor

◆ m_inputFrequencyOffset

qint64 SSBModSettings::m_inputFrequencyOffset

◆ m_lowCutoff

Real SSBModSettings::m_lowCutoff

◆ m_modAFInput

SSBModInputAF SSBModSettings::m_modAFInput

◆ m_nbAGCTimeConstants

const int SSBModSettings::m_nbAGCTimeConstants = 10
static

Definition at line 38 of file ssbmodsettings.h.

◆ m_playLoop

bool SSBModSettings::m_playLoop

◆ m_reverseAPIAddress

QString SSBModSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t SSBModSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t SSBModSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t SSBModSettings::m_reverseAPIPort

◆ m_rgbColor

quint32 SSBModSettings::m_rgbColor

◆ m_spanLog2

int SSBModSettings::m_spanLog2

◆ m_spectrumGUI

Serializable* SSBModSettings::m_spectrumGUI

Definition at line 70 of file ssbmodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_title

QString SSBModSettings::m_title

◆ m_toneFrequency

float SSBModSettings::m_toneFrequency

◆ m_usb

bool SSBModSettings::m_usb

◆ m_useReverseAPI

bool SSBModSettings::m_useReverseAPI

◆ m_volumeFactor

float SSBModSettings::m_volumeFactor

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