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 Member Functions | Public Attributes | List of all members
LocalSourceSettings Struct Reference

#include <localsourcesettings.h>

+ Collaboration diagram for LocalSourceSettings:

Public Member Functions

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

Public Attributes

uint32_t m_localDeviceIndex
 
quint32 m_rgbColor
 
QString m_title
 
uint32_t m_log2Interp
 
uint32_t m_filterChainHash
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 

Detailed Description

Definition at line 26 of file localsourcesettings.h.

Constructor & Destructor Documentation

◆ LocalSourceSettings()

LocalSourceSettings::LocalSourceSettings ( )

Definition at line 26 of file localsourcesettings.cpp.

References resetToDefaults().

27 {
29 }
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool LocalSourceSettings::deserialize ( const QByteArray &  data)

Definition at line 63 of file localsourcesettings.cpp.

References SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_filterChainHash, m_localDeviceIndex, m_log2Interp, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_title, m_useReverseAPI, SimpleDeserializer::readBool(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by LocalSourceGUI::deserialize(), LocalSource::deserialize(), and setChannelMarker().

64 {
65  SimpleDeserializer d(data);
66 
67  if(!d.isValid())
68  {
70  return false;
71  }
72 
73  if(d.getVersion() == 1)
74  {
75  uint32_t tmp;
76  QString strtmp;
77 
78  d.readU32(1, &m_localDeviceIndex, 0);
79  d.readU32(5, &m_rgbColor, QColor(0, 255, 255).rgb());
80  d.readString(6, &m_title, "Local sink");
81  d.readBool(7, &m_useReverseAPI, false);
82  d.readString(8, &m_reverseAPIAddress, "127.0.0.1");
83  d.readU32(9, &tmp, 0);
84 
85  if ((tmp > 1023) && (tmp < 65535)) {
86  m_reverseAPIPort = tmp;
87  } else {
88  m_reverseAPIPort = 8888;
89  }
90 
91  d.readU32(10, &tmp, 0);
92  m_reverseAPIDeviceIndex = tmp > 99 ? 99 : tmp;
93  d.readU32(11, &tmp, 0);
94  m_reverseAPIChannelIndex = tmp > 99 ? 99 : tmp;
95  d.readU32(12, &tmp, 0);
96  m_log2Interp = tmp > 6 ? 6 : tmp;
97  d.readU32(13, &m_filterChainHash, 0);
98 
99  return true;
100  }
101  else
102  {
103  resetToDefaults();
104  return false;
105  }
106 }
unsigned int uint32_t
Definition: rtptypes_win.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void LocalSourceSettings::resetToDefaults ( )

Definition at line 31 of file localsourcesettings.cpp.

References m_channelMarker, m_filterChainHash, m_localDeviceIndex, m_log2Interp, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_title, and m_useReverseAPI.

Referenced by deserialize(), LocalSource::deserialize(), LocalSourceSettings(), and LocalSourceGUI::resetToDefaults().

32 {
34  m_rgbColor = QColor(140, 4, 4).rgb();
35  m_title = "Local Source";
36  m_log2Interp = 0;
38  m_channelMarker = nullptr;
39  m_useReverseAPI = false;
40  m_reverseAPIAddress = "127.0.0.1";
41  m_reverseAPIPort = 8888;
44 }
Serializable * m_channelMarker
+ Here is the caller graph for this function:

◆ serialize()

QByteArray LocalSourceSettings::serialize ( ) const

Definition at line 46 of file localsourcesettings.cpp.

References SimpleSerializer::final(), m_filterChainHash, m_localDeviceIndex, m_log2Interp, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_title, m_useReverseAPI, SimpleSerializer::writeBool(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by LocalSourceGUI::serialize(), LocalSource::serialize(), and setChannelMarker().

47 {
48  SimpleSerializer s(1);
49  s.writeU32(1, m_localDeviceIndex);
50  s.writeU32(5, m_rgbColor);
51  s.writeString(6, m_title);
52  s.writeBool(7, m_useReverseAPI);
53  s.writeString(8, m_reverseAPIAddress);
54  s.writeU32(9, m_reverseAPIPort);
55  s.writeU32(10, m_reverseAPIDeviceIndex);
56  s.writeU32(11, m_reverseAPIChannelIndex);
57  s.writeU32(12, m_log2Interp);
58  s.writeU32(13, m_filterChainHash);
59 
60  return s.final();
61 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void LocalSourceSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 43 of file localsourcesettings.h.

References deserialize(), and serialize().

Referenced by LocalSourceGUI::LocalSourceGUI().

43 { 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_channelMarker

Serializable* LocalSourceSettings::m_channelMarker

Definition at line 39 of file localsourcesettings.h.

Referenced by resetToDefaults().

◆ m_filterChainHash

uint32_t LocalSourceSettings::m_filterChainHash

◆ m_localDeviceIndex

uint32_t LocalSourceSettings::m_localDeviceIndex

◆ m_log2Interp

uint32_t LocalSourceSettings::m_log2Interp

◆ m_reverseAPIAddress

QString LocalSourceSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t LocalSourceSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t LocalSourceSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t LocalSourceSettings::m_reverseAPIPort

◆ m_rgbColor

quint32 LocalSourceSettings::m_rgbColor

◆ m_title

QString LocalSourceSettings::m_title

◆ m_useReverseAPI

bool LocalSourceSettings::m_useReverseAPI

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