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

#include <udpsinksettings.h>

+ Collaboration diagram for UDPSinkSettings:

Public Types

enum  SampleFormat {
  FormatIQ16, FormatIQ24, FormatNFM, FormatNFMMono,
  FormatLSB, FormatUSB, FormatLSBMono, FormatUSBMono,
  FormatAMMono, FormatAMNoDCMono, FormatAMBPFMono, FormatNone
}
 

Public Member Functions

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

Public Attributes

float m_outputSampleRate
 
SampleFormat m_sampleFormat
 
int64_t m_inputFrequencyOffset
 
float m_rfBandwidth
 
int m_fmDeviation
 
bool m_channelMute
 
float m_gain
 
int m_squelchdB
 power dB More...
 
int m_squelchGate
 100ths seconds More...
 
bool m_squelchEnabled
 
bool m_agc
 
bool m_audioActive
 
bool m_audioStereo
 
int m_volume
 
quint32 m_rgbColor
 
QString m_udpAddress
 
uint16_t m_udpPort
 
uint16_t m_audioPort
 
QString m_title
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 
Serializablem_spectrumGUI
 

Detailed Description

Definition at line 27 of file udpsinksettings.h.

Member Enumeration Documentation

◆ SampleFormat

Constructor & Destructor Documentation

◆ UDPSinkSettings()

UDPSinkSettings::UDPSinkSettings ( )

Definition at line 25 of file udpsinksettings.cpp.

References resetToDefaults().

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

Member Function Documentation

◆ deserialize()

bool UDPSinkSettings::deserialize ( const QByteArray &  data)

Definition at line 99 of file udpsinksettings.cpp.

References Serializable::deserialize(), FormatIQ16, FormatNone, SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_agc, m_audioActive, m_audioPort, m_audioStereo, m_channelMarker, m_fmDeviation, m_gain, m_inputFrequencyOffset, m_outputSampleRate, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_sampleFormat, m_spectrumGUI, m_squelchdB, m_squelchGate, m_title, m_udpAddress, m_udpPort, m_useReverseAPI, m_volume, SimpleDeserializer::readBlob(), SimpleDeserializer::readBool(), SimpleDeserializer::readReal(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by UDPSinkGUI::deserialize(), UDPSink::deserialize(), and setSpectrumGUI().

100 {
101  SimpleDeserializer d(data);
102 
103  if (!d.isValid())
104  {
105  resetToDefaults();
106  return false;
107  }
108 
109  if (d.getVersion() == 1)
110  {
111  QByteArray bytetmp;
112  QString strtmp;
113  int32_t s32tmp;
114  quint32 u32tmp;
115 
116  if (m_channelMarker) {
117  d.readBlob(6, &bytetmp);
118  m_channelMarker->deserialize(bytetmp);
119  }
120 
121  d.readS32(2, &s32tmp, 0);
122  m_inputFrequencyOffset = s32tmp;
123 
124  d.readS32(3, &s32tmp, FormatIQ16);
125 
126  if ((s32tmp >= 0) && (s32tmp < (int) FormatNone)) {
127  m_sampleFormat = (SampleFormat) s32tmp;
128  } else {
130  }
131 
132  d.readReal(4, &m_outputSampleRate, 48000.0);
133  d.readReal(5, &m_rfBandwidth, 32000.0);
134 
135  if (m_spectrumGUI) {
136  d.readBlob(7, &bytetmp);
137  m_spectrumGUI->deserialize(bytetmp);
138  }
139 
140  d.readS32(8, &s32tmp, 10);
141  m_gain = s32tmp / 10.0;
142  d.readU32(9, &m_rgbColor);
143  d.readBool(11, &m_audioActive, false);
144  d.readS32(12, &m_volume, 20);
145  d.readBool(14, &m_audioStereo, false);
146  d.readS32(15, &m_fmDeviation, 2500);
147  d.readS32(16, &m_squelchdB, -60);
148  d.readS32(17, &m_squelchGate, 5);
149  d.readBool(18, &m_agc, false);
150  d.readString(19, &m_title, "UDP Sample Source");
151  d.readString(20, &m_udpAddress, "127.0.0.1");
152 
153  d.readU32(21, &u32tmp, 9998);
154 
155  if ((u32tmp > 1024) & (u32tmp < 65538)) {
156  m_udpPort = u32tmp;
157  } else {
158  m_udpPort = 9998;
159  }
160 
161  d.readU32(22, &u32tmp, 9997);
162 
163  if ((u32tmp > 1024) & (u32tmp < 65538)) {
164  m_audioPort = u32tmp;
165  } else {
166  m_audioPort = 9997;
167  }
168 
169  d.readBool(23, &m_useReverseAPI, false);
170  d.readString(24, &m_reverseAPIAddress, "127.0.0.1");
171  d.readU32(25, &u32tmp, 0);
172 
173  if ((u32tmp > 1023) && (u32tmp < 65535)) {
174  m_reverseAPIPort = u32tmp;
175  } else {
176  m_reverseAPIPort = 8888;
177  }
178 
179  d.readU32(26, &u32tmp, 0);
180  m_reverseAPIDeviceIndex = u32tmp > 99 ? 99 : u32tmp;
181  d.readU32(27, &u32tmp, 0);
182  m_reverseAPIChannelIndex = u32tmp > 99 ? 99 : u32tmp;
183 
184  return true;
185  }
186  else
187  {
188  resetToDefaults();
189  return false;
190  }
191 }
int m_squelchdB
power dB
Serializable * m_spectrumGUI
Serializable * m_channelMarker
uint16_t m_reverseAPIPort
int m_squelchGate
100ths seconds
uint16_t m_reverseAPIDeviceIndex
int int32_t
Definition: rtptypes_win.h:45
virtual bool deserialize(const QByteArray &data)=0
uint16_t m_reverseAPIChannelIndex
SampleFormat m_sampleFormat
uint16_t m_audioPort
int64_t m_inputFrequencyOffset
QString m_reverseAPIAddress
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void UDPSinkSettings::resetToDefaults ( )

Definition at line 32 of file udpsinksettings.cpp.

References FormatIQ16, m_agc, m_audioActive, m_audioPort, m_audioStereo, m_channelMute, m_fmDeviation, m_gain, m_inputFrequencyOffset, m_outputSampleRate, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_sampleFormat, m_squelchdB, m_squelchEnabled, m_squelchGate, m_title, m_udpAddress, m_udpPort, m_useReverseAPI, and m_volume.

Referenced by deserialize(), UDPSink::deserialize(), UDPSinkGUI::resetToDefaults(), and UDPSinkSettings().

33 {
34  m_outputSampleRate = 48000;
37  m_rfBandwidth = 12500;
38  m_fmDeviation = 2500;
39  m_channelMute = false;
40  m_gain = 1.0;
41  m_squelchdB = -60;
42  m_squelchGate = 0.0;
43  m_squelchEnabled = true;
44  m_agc = false;
45  m_audioActive = false;
46  m_audioStereo = false;
47  m_volume = 20;
48  m_udpAddress = "127.0.0.1";
49  m_udpPort = 9998;
50  m_audioPort = 9997;
51  m_rgbColor = QColor(225, 25, 99).rgb();
52  m_title = "UDP Sample Sink";
53  m_useReverseAPI = false;
54  m_reverseAPIAddress = "127.0.0.1";
55  m_reverseAPIPort = 8888;
58 }
int m_squelchdB
power dB
uint16_t m_reverseAPIPort
int m_squelchGate
100ths seconds
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIChannelIndex
SampleFormat m_sampleFormat
uint16_t m_audioPort
int64_t m_inputFrequencyOffset
QString m_reverseAPIAddress
+ Here is the caller graph for this function:

◆ serialize()

QByteArray UDPSinkSettings::serialize ( ) const

Definition at line 60 of file udpsinksettings.cpp.

References SimpleSerializer::final(), m_agc, m_audioActive, m_audioPort, m_audioStereo, m_channelMarker, m_fmDeviation, m_gain, m_inputFrequencyOffset, m_outputSampleRate, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_sampleFormat, m_spectrumGUI, m_squelchdB, m_squelchGate, m_title, m_udpAddress, m_udpPort, m_useReverseAPI, m_volume, Serializable::serialize(), SimpleSerializer::writeBlob(), SimpleSerializer::writeBool(), SimpleSerializer::writeReal(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by UDPSinkGUI::serialize(), UDPSink::serialize(), and setSpectrumGUI().

61 {
62  SimpleSerializer s(1);
63  s.writeS32(2, m_inputFrequencyOffset);
64  s.writeS32(3, (int) m_sampleFormat);
65  s.writeReal(4, m_outputSampleRate);
66  s.writeReal(5, m_rfBandwidth);
67 
68  if (m_channelMarker) {
69  s.writeBlob(6, m_channelMarker->serialize());
70  }
71 
72  if (m_spectrumGUI) {
73  s.writeBlob(7, m_spectrumGUI->serialize());
74  }
75 
76  s.writeS32(8, m_gain*10.0);
77  s.writeU32(9, m_rgbColor);
78  s.writeBool(11, m_audioActive);
79  s.writeS32(12, m_volume);
80  s.writeBool(14, m_audioStereo);
81  s.writeS32(15, m_fmDeviation);
82  s.writeS32(16, m_squelchdB);
83  s.writeS32(17, m_squelchGate);
84  s.writeBool(18, m_agc);
85  s.writeString(19, m_title);
86  s.writeString(20, m_udpAddress);
87  s.writeU32(21, m_udpPort);
88  s.writeU32(22, m_audioPort);
89  s.writeBool(23, m_useReverseAPI);
90  s.writeString(24, m_reverseAPIAddress);
91  s.writeU32(25, m_reverseAPIPort);
92  s.writeU32(26, m_reverseAPIDeviceIndex);
93  s.writeU32(27, m_reverseAPIChannelIndex);
94 
95  return s.final();
96 
97 }
int m_squelchdB
power dB
Serializable * m_spectrumGUI
Serializable * m_channelMarker
uint16_t m_reverseAPIPort
int m_squelchGate
100ths seconds
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIChannelIndex
SampleFormat m_sampleFormat
virtual QByteArray serialize() const =0
uint16_t m_audioPort
int64_t m_inputFrequencyOffset
QString m_reverseAPIAddress
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void UDPSinkSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 77 of file udpsinksettings.h.

Referenced by UDPSinkGUI::UDPSinkGUI().

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

◆ setSpectrumGUI()

void UDPSinkSettings::setSpectrumGUI ( Serializable spectrumGUI)
inline

Definition at line 78 of file udpsinksettings.h.

References deserialize(), and serialize().

Referenced by UDPSinkGUI::UDPSinkGUI().

78 { 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 UDPSinkSettings::m_agc

◆ m_audioActive

bool UDPSinkSettings::m_audioActive

◆ m_audioPort

uint16_t UDPSinkSettings::m_audioPort

◆ m_audioStereo

bool UDPSinkSettings::m_audioStereo

◆ m_channelMarker

Serializable* UDPSinkSettings::m_channelMarker

Definition at line 72 of file udpsinksettings.h.

Referenced by deserialize(), and serialize().

◆ m_channelMute

bool UDPSinkSettings::m_channelMute

◆ m_fmDeviation

int UDPSinkSettings::m_fmDeviation

◆ m_gain

float UDPSinkSettings::m_gain

◆ m_inputFrequencyOffset

int64_t UDPSinkSettings::m_inputFrequencyOffset

◆ m_outputSampleRate

float UDPSinkSettings::m_outputSampleRate

◆ m_reverseAPIAddress

QString UDPSinkSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t UDPSinkSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t UDPSinkSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t UDPSinkSettings::m_reverseAPIPort

◆ m_rfBandwidth

float UDPSinkSettings::m_rfBandwidth

◆ m_rgbColor

quint32 UDPSinkSettings::m_rgbColor

◆ m_sampleFormat

SampleFormat UDPSinkSettings::m_sampleFormat

◆ m_spectrumGUI

Serializable* UDPSinkSettings::m_spectrumGUI

Definition at line 73 of file udpsinksettings.h.

Referenced by deserialize(), and serialize().

◆ m_squelchdB

int UDPSinkSettings::m_squelchdB

◆ m_squelchEnabled

bool UDPSinkSettings::m_squelchEnabled

◆ m_squelchGate

int UDPSinkSettings::m_squelchGate

◆ m_title

QString UDPSinkSettings::m_title

◆ m_udpAddress

QString UDPSinkSettings::m_udpAddress

◆ m_udpPort

uint16_t UDPSinkSettings::m_udpPort

◆ m_useReverseAPI

bool UDPSinkSettings::m_useReverseAPI

◆ m_volume

int UDPSinkSettings::m_volume

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