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

#include <ammodsettings.h>

+ Collaboration diagram for AMModSettings:

Public Types

enum  AMModInputAF {
  AMModInputNone, AMModInputTone, AMModInputFile, AMModInputAudio,
  AMModInputCWTone
}
 

Public Member Functions

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

Public Attributes

qint64 m_inputFrequencyOffset
 
Real m_rfBandwidth
 
float m_modFactor
 
float m_toneFrequency
 
float m_volumeFactor
 
bool m_channelMute
 
bool m_playLoop
 
quint32 m_rgbColor
 
QString m_title
 
AMModInputAF 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_cwKeyerGUI
 

Detailed Description

Definition at line 25 of file ammodsettings.h.

Member Enumeration Documentation

◆ AMModInputAF

Enumerator
AMModInputNone 
AMModInputTone 
AMModInputFile 
AMModInputAudio 
AMModInputCWTone 

Definition at line 27 of file ammodsettings.h.

Constructor & Destructor Documentation

◆ AMModSettings()

AMModSettings::AMModSettings ( )

Definition at line 25 of file ammodsettings.cpp.

References resetToDefaults().

25  :
26  m_channelMarker(0),
27  m_cwKeyerGUI(0)
28 {
30 }
Serializable * m_cwKeyerGUI
Definition: ammodsettings.h:57
Serializable * m_channelMarker
Definition: ammodsettings.h:56
void resetToDefaults()
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool AMModSettings::deserialize ( const QByteArray &  data)

Definition at line 89 of file ammodsettings.cpp.

References AMModInputNone, Serializable::deserialize(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_audioDeviceName, m_channelMarker, m_cwKeyerGUI, AudioDeviceManager::m_defaultDeviceName, m_feedbackAudioDeviceName, m_feedbackAudioEnable, m_feedbackVolumeFactor, m_inputFrequencyOffset, m_modAFInput, m_modFactor, 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(), and resetToDefaults().

Referenced by AMModGUI::deserialize(), AMMod::deserialize(), and setCWKeyerGUI().

90 {
91  SimpleDeserializer d(data);
92 
93  if(!d.isValid())
94  {
96  return false;
97  }
98 
99  if(d.getVersion() == 1)
100  {
101  QByteArray bytetmp;
102  qint32 tmp;
103  uint32_t utmp;
104 
105  d.readS32(1, &tmp, 0);
107  d.readReal(2, &m_rfBandwidth, 12500.0);
108  d.readReal(3, &m_toneFrequency, 1000.0);
109  d.readReal(4, &m_modFactor, 0.2f);
110  d.readU32(5, &m_rgbColor);
111  d.readReal(6, &m_volumeFactor, 1.0);
112 
113  if (m_cwKeyerGUI) {
114  d.readBlob(7, &bytetmp);
115  m_cwKeyerGUI->deserialize(bytetmp);
116  }
117 
118  if (m_channelMarker) {
119  d.readBlob(8, &bytetmp);
120  m_channelMarker->deserialize(bytetmp);
121  }
122 
123  d.readString(9, &m_title, "AM Modulator");
125 
126  d.readS32(11, &tmp, 0);
127  if ((tmp < 0) || (tmp > (int) AMModInputAF::AMModInputTone)) {
129  } else {
130  m_modAFInput = (AMModInputAF) tmp;
131  }
132 
133  d.readBool(12, &m_useReverseAPI, false);
134  d.readString(13, &m_reverseAPIAddress, "127.0.0.1");
135  d.readU32(14, &utmp, 0);
136 
137  if ((utmp > 1023) && (utmp < 65535)) {
138  m_reverseAPIPort = utmp;
139  } else {
140  m_reverseAPIPort = 8888;
141  }
142 
143  d.readU32(15, &utmp, 0);
144  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
145  d.readU32(16, &utmp, 0);
146  m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
148  d.readReal(18, &m_feedbackVolumeFactor, 1.0);
149  d.readBool(19, &m_feedbackAudioEnable, false);
150 
151  return true;
152  }
153  else
154  {
155  resetToDefaults();
156  return false;
157  }
158 }
static const QString m_defaultDeviceName
float m_feedbackVolumeFactor
Definition: ammodsettings.h:48
bool m_feedbackAudioEnable
Definition: ammodsettings.h:49
uint16_t m_reverseAPIDeviceIndex
Definition: ammodsettings.h:53
QString m_reverseAPIAddress
Definition: ammodsettings.h:51
Serializable * m_cwKeyerGUI
Definition: ammodsettings.h:57
Serializable * m_channelMarker
Definition: ammodsettings.h:56
unsigned int uint32_t
Definition: rtptypes_win.h:46
float m_volumeFactor
Definition: ammodsettings.h:40
void resetToDefaults()
quint32 m_rgbColor
Definition: ammodsettings.h:43
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
Definition: ammodsettings.h:47
virtual bool deserialize(const QByteArray &data)=0
uint16_t m_reverseAPIChannelIndex
Definition: ammodsettings.h:54
QString m_title
Definition: ammodsettings.h:44
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
QString m_audioDeviceName
This is the audio device you get the audio samples from.
Definition: ammodsettings.h:46
bool m_useReverseAPI
Definition: ammodsettings.h:50
float m_toneFrequency
Definition: ammodsettings.h:39
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
uint16_t m_reverseAPIPort
Definition: ammodsettings.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void AMModSettings::resetToDefaults ( )

Definition at line 32 of file ammodsettings.cpp.

References m_audioDeviceName, m_channelMute, AudioDeviceManager::m_defaultDeviceName, m_feedbackAudioDeviceName, m_feedbackAudioEnable, m_feedbackVolumeFactor, m_inputFrequencyOffset, m_modAFInput, m_modFactor, m_playLoop, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_title, m_toneFrequency, m_useReverseAPI, and m_volumeFactor.

Referenced by AMModSettings(), deserialize(), AMMod::deserialize(), and AMModGUI::resetToDefaults().

33 {
35  m_rfBandwidth = 12500.0;
36  m_modFactor = 0.2f;
37  m_toneFrequency = 1000.0f;
38  m_volumeFactor = 1.0f;
39  m_channelMute = false;
40  m_playLoop = false;
41  m_rgbColor = QColor(255, 255, 0).rgb();
42  m_title = "AM Modulator";
43  m_modAFInput = AMModInputAF::AMModInputNone;
47  m_feedbackAudioEnable = false;
48  m_useReverseAPI = false;
49  m_reverseAPIAddress = "127.0.0.1";
50  m_reverseAPIPort = 8888;
53 }
static const QString m_defaultDeviceName
float m_feedbackVolumeFactor
Definition: ammodsettings.h:48
bool m_feedbackAudioEnable
Definition: ammodsettings.h:49
uint16_t m_reverseAPIDeviceIndex
Definition: ammodsettings.h:53
QString m_reverseAPIAddress
Definition: ammodsettings.h:51
float m_volumeFactor
Definition: ammodsettings.h:40
quint32 m_rgbColor
Definition: ammodsettings.h:43
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
Definition: ammodsettings.h:47
uint16_t m_reverseAPIChannelIndex
Definition: ammodsettings.h:54
QString m_title
Definition: ammodsettings.h:44
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
QString m_audioDeviceName
This is the audio device you get the audio samples from.
Definition: ammodsettings.h:46
bool m_useReverseAPI
Definition: ammodsettings.h:50
float m_toneFrequency
Definition: ammodsettings.h:39
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
uint16_t m_reverseAPIPort
Definition: ammodsettings.h:52
+ Here is the caller graph for this function:

◆ serialize()

QByteArray AMModSettings::serialize ( ) const

Definition at line 55 of file ammodsettings.cpp.

References SimpleSerializer::final(), m_audioDeviceName, m_channelMarker, m_cwKeyerGUI, m_feedbackAudioDeviceName, m_feedbackAudioEnable, m_feedbackVolumeFactor, m_inputFrequencyOffset, m_modAFInput, m_modFactor, 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 AMModGUI::serialize(), AMMod::serialize(), and setCWKeyerGUI().

56 {
57  SimpleSerializer s(1);
58 
59  s.writeS32(1, m_inputFrequencyOffset);
60  s.writeReal(2, m_rfBandwidth);
61  s.writeReal(3, m_toneFrequency);
62  s.writeReal(4, m_modFactor);
63  s.writeU32(5, m_rgbColor);
64  s.writeReal(6, m_volumeFactor);
65 
66  if (m_cwKeyerGUI) {
67  s.writeBlob(7, m_cwKeyerGUI->serialize());
68  }
69 
70  if (m_channelMarker) {
71  s.writeBlob(8, m_channelMarker->serialize());
72  }
73 
74  s.writeString(9, m_title);
75  s.writeString(10, m_audioDeviceName);
76  s.writeS32(11, (int) m_modAFInput);
77  s.writeBool(12, m_useReverseAPI);
78  s.writeString(13, m_reverseAPIAddress);
79  s.writeU32(14, m_reverseAPIPort);
80  s.writeU32(15, m_reverseAPIDeviceIndex);
81  s.writeU32(16, m_reverseAPIChannelIndex);
82  s.writeString(17, m_feedbackAudioDeviceName);
83  s.writeReal(18, m_feedbackVolumeFactor);
84  s.writeBool(19, m_feedbackAudioEnable);
85 
86  return s.final();
87 }
float m_feedbackVolumeFactor
Definition: ammodsettings.h:48
bool m_feedbackAudioEnable
Definition: ammodsettings.h:49
uint16_t m_reverseAPIDeviceIndex
Definition: ammodsettings.h:53
QString m_reverseAPIAddress
Definition: ammodsettings.h:51
Serializable * m_cwKeyerGUI
Definition: ammodsettings.h:57
Serializable * m_channelMarker
Definition: ammodsettings.h:56
float m_volumeFactor
Definition: ammodsettings.h:40
quint32 m_rgbColor
Definition: ammodsettings.h:43
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
Definition: ammodsettings.h:47
uint16_t m_reverseAPIChannelIndex
Definition: ammodsettings.h:54
QString m_title
Definition: ammodsettings.h:44
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
QString m_audioDeviceName
This is the audio device you get the audio samples from.
Definition: ammodsettings.h:46
virtual QByteArray serialize() const =0
bool m_useReverseAPI
Definition: ammodsettings.h:50
float m_toneFrequency
Definition: ammodsettings.h:39
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
uint16_t m_reverseAPIPort
Definition: ammodsettings.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void AMModSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 61 of file ammodsettings.h.

Referenced by AMModGUI::AMModGUI().

61 { m_channelMarker = channelMarker; }
Serializable * m_channelMarker
Definition: ammodsettings.h:56
+ Here is the caller graph for this function:

◆ setCWKeyerGUI()

void AMModSettings::setCWKeyerGUI ( Serializable cwKeyerGUI)
inline

Definition at line 62 of file ammodsettings.h.

References deserialize(), and serialize().

Referenced by AMModGUI::AMModGUI().

62 { m_cwKeyerGUI = cwKeyerGUI; }
Serializable * m_cwKeyerGUI
Definition: ammodsettings.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_audioDeviceName

QString AMModSettings::m_audioDeviceName

◆ m_channelMarker

Serializable* AMModSettings::m_channelMarker

Definition at line 56 of file ammodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_channelMute

bool AMModSettings::m_channelMute

◆ m_cwKeyerGUI

Serializable* AMModSettings::m_cwKeyerGUI

Definition at line 57 of file ammodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_feedbackAudioDeviceName

QString AMModSettings::m_feedbackAudioDeviceName

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

Definition at line 47 of file ammodsettings.h.

Referenced by AMMod::applySettings(), AMModGUI::audioFeedbackSelect(), deserialize(), resetToDefaults(), and serialize().

◆ m_feedbackAudioEnable

bool AMModSettings::m_feedbackAudioEnable

◆ m_feedbackVolumeFactor

float AMModSettings::m_feedbackVolumeFactor

◆ m_inputFrequencyOffset

qint64 AMModSettings::m_inputFrequencyOffset

◆ m_modAFInput

AMModInputAF AMModSettings::m_modAFInput

◆ m_modFactor

float AMModSettings::m_modFactor

◆ m_playLoop

bool AMModSettings::m_playLoop

◆ m_reverseAPIAddress

QString AMModSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t AMModSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t AMModSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t AMModSettings::m_reverseAPIPort

◆ m_rfBandwidth

Real AMModSettings::m_rfBandwidth

◆ m_rgbColor

quint32 AMModSettings::m_rgbColor

◆ m_title

QString AMModSettings::m_title

◆ m_toneFrequency

float AMModSettings::m_toneFrequency

◆ m_useReverseAPI

bool AMModSettings::m_useReverseAPI

◆ m_volumeFactor

float AMModSettings::m_volumeFactor

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