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

#include <filesourcesettings.h>

+ Collaboration diagram for FileSourceSettings:

Public Member Functions

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

Public Attributes

QString m_fileName
 
bool m_loop
 
uint32_t m_log2Interp
 
uint32_t m_filterChainHash
 
int m_gainDB
 
quint32 m_rgbColor
 
QString m_title
 
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 filesourcesettings.h.

Constructor & Destructor Documentation

◆ FileSourceSettings()

FileSourceSettings::FileSourceSettings ( )

Definition at line 26 of file filesourcesettings.cpp.

References resetToDefaults().

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

Member Function Documentation

◆ deserialize()

bool FileSourceSettings::deserialize ( const QByteArray &  data)

Definition at line 67 of file filesourcesettings.cpp.

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

Referenced by FileSourceGUI::deserialize(), FileSource::deserialize(), and setChannelMarker().

68 {
69  SimpleDeserializer d(data);
70 
71  if(!d.isValid())
72  {
74  return false;
75  }
76 
77  if(d.getVersion() == 1)
78  {
79  uint32_t tmp;
80  int itmp;
81  QString strtmp;
82 
83  d.readString(1, &m_fileName, "test.sdriq");
84  d.readBool(2, &m_loop, false);
85  d.readU32(3, &tmp, 0);
86  m_log2Interp = tmp > 6 ? 6 : tmp;
87  d.readU32(4, &m_filterChainHash, 0);
88  d.readS32(5, &itmp, 20);
89  m_gainDB = itmp < -10 ? -10 : itmp > 50 ? 50 : itmp;
90  d.readU32(5, &m_rgbColor, QColor(140, 4, 4).rgb());
91  d.readString(6, &m_title, "File source");
92  d.readBool(7, &m_useReverseAPI, false);
93  d.readString(8, &m_reverseAPIAddress, "127.0.0.1");
94  d.readU32(9, &tmp, 0);
95 
96  if ((tmp > 1023) && (tmp < 65535)) {
97  m_reverseAPIPort = tmp;
98  } else {
99  m_reverseAPIPort = 8888;
100  }
101 
102  d.readU32(10, &tmp, 0);
103  m_reverseAPIDeviceIndex = tmp > 99 ? 99 : tmp;
104  d.readU32(11, &tmp, 0);
105  m_reverseAPIChannelIndex = tmp > 99 ? 99 : tmp;
106 
107  return true;
108  }
109  else
110  {
111  resetToDefaults();
112  return false;
113  }
114 }
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint16_t m_reverseAPIChannelIndex
uint16_t m_reverseAPIDeviceIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void FileSourceSettings::resetToDefaults ( )

Definition at line 31 of file filesourcesettings.cpp.

References m_channelMarker, m_fileName, m_filterChainHash, m_gainDB, m_log2Interp, m_loop, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_title, and m_useReverseAPI.

Referenced by deserialize(), FileSource::deserialize(), FileSourceSettings(), and FileSourceGUI::resetToDefaults().

32 {
33  m_fileName = "test.sdriq";
34  m_loop = false;
35  m_log2Interp = 0;
37  m_gainDB = 0;
38  m_rgbColor = QColor(140, 4, 4).rgb();
39  m_title = "File source";
40  m_channelMarker = nullptr;
41  m_useReverseAPI = false;
42  m_reverseAPIAddress = "127.0.0.1";
43  m_reverseAPIPort = 8888;
46 }
uint16_t m_reverseAPIChannelIndex
uint16_t m_reverseAPIDeviceIndex
Serializable * m_channelMarker
+ Here is the caller graph for this function:

◆ serialize()

QByteArray FileSourceSettings::serialize ( ) const

Definition at line 48 of file filesourcesettings.cpp.

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

Referenced by FileSourceGUI::serialize(), FileSource::serialize(), and setChannelMarker().

49 {
50  SimpleSerializer s(1);
51  s.writeString(1, m_fileName);
52  s.writeBool(2, m_loop);
53  s.writeU32(3, m_log2Interp);
54  s.writeU32(4, m_filterChainHash);
55  s.writeS32(5, m_gainDB);
56  s.writeU32(6, m_rgbColor);
57  s.writeString(7, m_title);
58  s.writeBool(8, m_useReverseAPI);
59  s.writeString(9, m_reverseAPIAddress);
60  s.writeU32(10, m_reverseAPIPort);
61  s.writeU32(11, m_reverseAPIDeviceIndex);
62  s.writeU32(12, m_reverseAPIChannelIndex);
63 
64  return s.final();
65 }
uint16_t m_reverseAPIChannelIndex
uint16_t m_reverseAPIDeviceIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void FileSourceSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 45 of file filesourcesettings.h.

References deserialize(), and serialize().

Referenced by FileSourceGUI::FileSourceGUI().

45 { 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* FileSourceSettings::m_channelMarker

Definition at line 41 of file filesourcesettings.h.

Referenced by resetToDefaults().

◆ m_fileName

QString FileSourceSettings::m_fileName

◆ m_filterChainHash

uint32_t FileSourceSettings::m_filterChainHash

◆ m_gainDB

int FileSourceSettings::m_gainDB

◆ m_log2Interp

uint32_t FileSourceSettings::m_log2Interp

◆ m_loop

bool FileSourceSettings::m_loop

◆ m_reverseAPIAddress

QString FileSourceSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t FileSourceSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t FileSourceSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t FileSourceSettings::m_reverseAPIPort

◆ m_rgbColor

quint32 FileSourceSettings::m_rgbColor

◆ m_title

QString FileSourceSettings::m_title

◆ m_useReverseAPI

bool FileSourceSettings::m_useReverseAPI

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