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

#include <amdemodsettings.h>

+ Collaboration diagram for AMDemodSettings:

Public Types

enum  SyncAMOperation { SyncAMDSB, SyncAMUSB, SyncAMLSB }
 

Public Member Functions

 AMDemodSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

qint32 m_inputFrequencyOffset
 
Real m_rfBandwidth
 
Real m_squelch
 
Real m_volume
 
bool m_audioMute
 
bool m_bandpassEnable
 
quint32 m_rgbColor
 
QString m_title
 
Serializablem_channelMarker
 
QString m_audioDeviceName
 
bool m_pll
 
SyncAMOperation m_syncAMOperation
 
int m_streamIndex
 MIMO channel. Not relevant when connected to SI (single Rx). More...
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 

Detailed Description

Definition at line 25 of file amdemodsettings.h.

Member Enumeration Documentation

◆ SyncAMOperation

Enumerator
SyncAMDSB 
SyncAMUSB 
SyncAMLSB 

Definition at line 27 of file amdemodsettings.h.

Constructor & Destructor Documentation

◆ AMDemodSettings()

AMDemodSettings::AMDemodSettings ( )

Definition at line 25 of file amdemodsettings.cpp.

References resetToDefaults().

25  :
27 {
29 }
Serializable * m_channelMarker
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool AMDemodSettings::deserialize ( const QByteArray &  data)

Definition at line 80 of file amdemodsettings.cpp.

References Serializable::deserialize(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_audioDeviceName, m_bandpassEnable, m_channelMarker, AudioDeviceManager::m_defaultDeviceName, m_inputFrequencyOffset, m_pll, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_squelch, m_streamIndex, m_syncAMOperation, m_title, m_useReverseAPI, m_volume, SimpleDeserializer::readBlob(), SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), resetToDefaults(), and SyncAMDSB.

Referenced by AMDemodGUI::deserialize(), AMDemod::deserialize(), and setChannelMarker().

81 {
82  SimpleDeserializer d(data);
83 
84  if(!d.isValid())
85  {
87  return false;
88  }
89 
90  if(d.getVersion() == 1)
91  {
92  QByteArray bytetmp;
93  qint32 tmp;
94  uint32_t utmp;
95  QString strtmp;
96 
97  d.readS32(1, &m_inputFrequencyOffset, 0);
98  d.readS32(2, &tmp, 4);
99  m_rfBandwidth = 100 * tmp;
100  d.readS32(3, &m_streamIndex, 0);
101  d.readS32(4, &tmp, 20);
102  m_volume = tmp * 0.1;
103  d.readS32(5, &tmp, -40);
104  m_squelch = tmp;
105  d.readBlob(6, &bytetmp);
106 
107  if (m_channelMarker) {
108  m_channelMarker->deserialize(bytetmp);
109  }
110 
111  d.readU32(7, &m_rgbColor);
112  d.readBool(8, &m_bandpassEnable, false);
113  d.readString(9, &m_title, "AM Demodulator");
115  d.readBool(12, &m_pll, false);
116  d.readS32(13, &tmp, 0);
117  m_syncAMOperation = tmp < 0 ? SyncAMDSB : tmp > 2 ? SyncAMDSB : (SyncAMOperation) tmp;
118  d.readBool(14, &m_useReverseAPI, false);
119  d.readString(15, &m_reverseAPIAddress, "127.0.0.1");
120  d.readU32(16, &utmp, 0);
121 
122  if ((utmp > 1023) && (utmp < 65535)) {
123  m_reverseAPIPort = utmp;
124  } else {
125  m_reverseAPIPort = 8888;
126  }
127 
128  d.readU32(17, &utmp, 0);
129  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
130  d.readU32(18, &utmp, 0);
131  m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
132 
133  return true;
134  }
135  else
136  {
137  resetToDefaults();
138  return false;
139  }
140 }
static const QString m_defaultDeviceName
uint16_t m_reverseAPIChannelIndex
Serializable * m_channelMarker
unsigned int uint32_t
Definition: rtptypes_win.h:46
int m_streamIndex
MIMO channel. Not relevant when connected to SI (single Rx).
uint16_t m_reverseAPIDeviceIndex
SyncAMOperation m_syncAMOperation
QString m_audioDeviceName
virtual bool deserialize(const QByteArray &data)=0
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
qint32 m_inputFrequencyOffset
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void AMDemodSettings::resetToDefaults ( )

Definition at line 31 of file amdemodsettings.cpp.

References m_audioDeviceName, m_audioMute, m_bandpassEnable, AudioDeviceManager::m_defaultDeviceName, m_inputFrequencyOffset, m_pll, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_squelch, m_streamIndex, m_syncAMOperation, m_title, m_useReverseAPI, m_volume, and SyncAMDSB.

Referenced by AMDemodSettings(), deserialize(), AMDemod::deserialize(), and AMDemodGUI::resetToDefaults().

32 {
34  m_rfBandwidth = 5000;
35  m_squelch = -40.0;
36  m_volume = 2.0;
37  m_audioMute = false;
38  m_bandpassEnable = false;
39  m_rgbColor = QColor(255, 255, 0).rgb();
40  m_title = "AM Demodulator";
42  m_pll = false;
44  m_streamIndex = 0;
45  m_useReverseAPI = false;
46  m_reverseAPIAddress = "127.0.0.1";
47  m_reverseAPIPort = 8888;
50 }
static const QString m_defaultDeviceName
uint16_t m_reverseAPIChannelIndex
int m_streamIndex
MIMO channel. Not relevant when connected to SI (single Rx).
uint16_t m_reverseAPIDeviceIndex
SyncAMOperation m_syncAMOperation
QString m_audioDeviceName
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
qint32 m_inputFrequencyOffset
+ Here is the caller graph for this function:

◆ serialize()

QByteArray AMDemodSettings::serialize ( ) const

Definition at line 52 of file amdemodsettings.cpp.

References SimpleSerializer::final(), m_audioDeviceName, m_bandpassEnable, m_channelMarker, m_inputFrequencyOffset, m_pll, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rfBandwidth, m_rgbColor, m_squelch, m_streamIndex, m_syncAMOperation, m_title, m_useReverseAPI, m_volume, Serializable::serialize(), SimpleSerializer::writeBlob(), SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by AMDemodGUI::serialize(), AMDemod::serialize(), and setChannelMarker().

53 {
54  SimpleSerializer s(1);
55  s.writeS32(1, m_inputFrequencyOffset);
56  s.writeS32(2, m_rfBandwidth/100);
57  s.writeS32(3, m_streamIndex);
58  s.writeS32(4, m_volume*10);
59  s.writeS32(5, m_squelch);
60 
61  if (m_channelMarker) {
62  s.writeBlob(6, m_channelMarker->serialize());
63  }
64 
65  s.writeU32(7, m_rgbColor);
66  s.writeBool(8, m_bandpassEnable);
67  s.writeString(9, m_title);
68  s.writeString(11, m_audioDeviceName);
69  s.writeBool(12, m_pll);
70  s.writeS32(13, (int) m_syncAMOperation);
71  s.writeBool(14, m_useReverseAPI);
72  s.writeString(15, m_reverseAPIAddress);
73  s.writeU32(16, m_reverseAPIPort);
74  s.writeU32(17, m_reverseAPIDeviceIndex);
75  s.writeU32(18, m_reverseAPIChannelIndex);
76 
77  return s.final();
78 }
uint16_t m_reverseAPIChannelIndex
Serializable * m_channelMarker
int m_streamIndex
MIMO channel. Not relevant when connected to SI (single Rx).
uint16_t m_reverseAPIDeviceIndex
SyncAMOperation m_syncAMOperation
QString m_audioDeviceName
virtual QByteArray serialize() const =0
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
qint32 m_inputFrequencyOffset
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void AMDemodSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 55 of file amdemodsettings.h.

References deserialize(), and serialize().

Referenced by AMDemodGUI::AMDemodGUI().

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

Member Data Documentation

◆ m_audioDeviceName

QString AMDemodSettings::m_audioDeviceName

◆ m_audioMute

bool AMDemodSettings::m_audioMute

◆ m_bandpassEnable

bool AMDemodSettings::m_bandpassEnable

◆ m_channelMarker

Serializable* AMDemodSettings::m_channelMarker

Definition at line 42 of file amdemodsettings.h.

Referenced by deserialize(), and serialize().

◆ m_inputFrequencyOffset

qint32 AMDemodSettings::m_inputFrequencyOffset

◆ m_pll

bool AMDemodSettings::m_pll

◆ m_reverseAPIAddress

QString AMDemodSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t AMDemodSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t AMDemodSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t AMDemodSettings::m_reverseAPIPort

◆ m_rfBandwidth

Real AMDemodSettings::m_rfBandwidth

◆ m_rgbColor

quint32 AMDemodSettings::m_rgbColor

◆ m_squelch

Real AMDemodSettings::m_squelch

◆ m_streamIndex

int AMDemodSettings::m_streamIndex

◆ m_syncAMOperation

SyncAMOperation AMDemodSettings::m_syncAMOperation

◆ m_title

QString AMDemodSettings::m_title

◆ m_useReverseAPI

bool AMDemodSettings::m_useReverseAPI

◆ m_volume

Real AMDemodSettings::m_volume

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