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 | Private Attributes | List of all members
SWGSDRangel::SWGAudioInputDevice Class Reference

#include <SWGAudioInputDevice.h>

+ Inheritance diagram for SWGSDRangel::SWGAudioInputDevice:
+ Collaboration diagram for SWGSDRangel::SWGAudioInputDevice:

Public Member Functions

 SWGAudioInputDevice ()
 
 SWGAudioInputDevice (QString *json)
 
virtual ~SWGAudioInputDevice ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGAudioInputDevicefromJson (QString &jsonString) override
 
QString * getName ()
 
void setName (QString *name)
 
qint32 getIndex ()
 
void setIndex (qint32 index)
 
qint32 getSampleRate ()
 
void setSampleRate (qint32 sample_rate)
 
qint32 getIsSystemDefault ()
 
void setIsSystemDefault (qint32 is_system_default)
 
qint32 getDefaultUnregistered ()
 
void setDefaultUnregistered (qint32 default_unregistered)
 
float getVolume ()
 
void setVolume (float volume)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * name
 
bool m_name_isSet
 
qint32 index
 
bool m_index_isSet
 
qint32 sample_rate
 
bool m_sample_rate_isSet
 
qint32 is_system_default
 
bool m_is_system_default_isSet
 
qint32 default_unregistered
 
bool m_default_unregistered_isSet
 
float volume
 
bool m_volume_isSet
 

Detailed Description

Definition at line 32 of file SWGAudioInputDevice.h.

Constructor & Destructor Documentation

◆ SWGAudioInputDevice() [1/2]

SWGSDRangel::SWGAudioInputDevice::SWGAudioInputDevice ( )

Definition at line 30 of file SWGAudioInputDevice.cpp.

References default_unregistered, index, is_system_default, m_default_unregistered_isSet, m_index_isSet, m_is_system_default_isSet, m_name_isSet, m_sample_rate_isSet, m_volume_isSet, name, sample_rate, and volume.

30  {
31  name = nullptr;
32  m_name_isSet = false;
33  index = 0;
34  m_index_isSet = false;
35  sample_rate = 0;
36  m_sample_rate_isSet = false;
41  volume = 0.0f;
42  m_volume_isSet = false;
43 }

◆ SWGAudioInputDevice() [2/2]

SWGSDRangel::SWGAudioInputDevice::SWGAudioInputDevice ( QString *  json)

Definition at line 25 of file SWGAudioInputDevice.cpp.

References fromJson(), and init().

25  {
26  init();
27  this->fromJson(*json);
28 }
virtual SWGAudioInputDevice * fromJson(QString &jsonString) override
+ Here is the call graph for this function:

◆ ~SWGAudioInputDevice()

SWGSDRangel::SWGAudioInputDevice::~SWGAudioInputDevice ( )
virtual

Definition at line 45 of file SWGAudioInputDevice.cpp.

References cleanup().

45  {
46  this->cleanup();
47 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGAudioInputDevice::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 103 of file SWGAudioInputDevice.cpp.

References asJsonObject().

Referenced by SWGSDRangel::SWGInstanceApi::instanceAudioInputDelete(), WebAPIRequestMapper::instanceAudioInputParametersService(), and SWGSDRangel::SWGInstanceApi::instanceAudioInputPatch().

104 {
105  QJsonObject* obj = this->asJsonObject();
106 
107  QJsonDocument doc(*obj);
108  QByteArray bytes = doc.toJson();
109  delete obj;
110  return QString(bytes);
111 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asJsonObject()

QJsonObject * SWGSDRangel::SWGAudioInputDevice::asJsonObject ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 114 of file SWGAudioInputDevice.cpp.

References default_unregistered, index, is_system_default, m_default_unregistered_isSet, m_index_isSet, m_is_system_default_isSet, m_sample_rate_isSet, m_volume_isSet, name, sample_rate, SWGSDRangel::toJsonValue(), and volume.

Referenced by asJson().

114  {
115  QJsonObject* obj = new QJsonObject();
116  if(name != nullptr && *name != QString("")){
117  toJsonValue(QString("name"), name, obj, QString("QString"));
118  }
119  if(m_index_isSet){
120  obj->insert("index", QJsonValue(index));
121  }
123  obj->insert("sampleRate", QJsonValue(sample_rate));
124  }
126  obj->insert("isSystemDefault", QJsonValue(is_system_default));
127  }
129  obj->insert("defaultUnregistered", QJsonValue(default_unregistered));
130  }
131  if(m_volume_isSet){
132  obj->insert("volume", QJsonValue(volume));
133  }
134 
135  return obj;
136 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGAudioInputDevice::cleanup ( )

Definition at line 66 of file SWGAudioInputDevice.cpp.

References name.

Referenced by WebAPIRequestMapper::resetAudioInputDevice(), and ~SWGAudioInputDevice().

66  {
67  if(name != nullptr) {
68  delete name;
69  }
70 
71 
72 
73 
74 
75 }
+ Here is the caller graph for this function:

◆ fromJson()

SWGAudioInputDevice * SWGSDRangel::SWGAudioInputDevice::fromJson ( QString &  jsonString)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 78 of file SWGAudioInputDevice.cpp.

References fromJsonObject().

Referenced by SWGAudioInputDevice().

78  {
79  QByteArray array (json.toStdString().c_str());
80  QJsonDocument doc = QJsonDocument::fromJson(array);
81  QJsonObject jsonObject = doc.object();
82  this->fromJsonObject(jsonObject);
83  return this;
84 }
virtual void fromJsonObject(QJsonObject &json) override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

void SWGSDRangel::SWGAudioInputDevice::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 87 of file SWGAudioInputDevice.cpp.

References default_unregistered, index, is_system_default, name, sample_rate, SWGSDRangel::setValue(), and volume.

Referenced by fromJson().

87  {
88  ::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
89 
90  ::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
91 
92  ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
93 
94  ::SWGSDRangel::setValue(&is_system_default, pJson["isSystemDefault"], "qint32", "");
95 
96  ::SWGSDRangel::setValue(&default_unregistered, pJson["defaultUnregistered"], "qint32", "");
97 
98  ::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
99 
100 }
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultUnregistered()

qint32 SWGSDRangel::SWGAudioInputDevice::getDefaultUnregistered ( )

Definition at line 179 of file SWGAudioInputDevice.cpp.

References default_unregistered.

179  {
180  return default_unregistered;
181 }

◆ getIndex()

qint32 SWGSDRangel::SWGAudioInputDevice::getIndex ( )

◆ getIsSystemDefault()

qint32 SWGSDRangel::SWGAudioInputDevice::getIsSystemDefault ( )

Definition at line 169 of file SWGAudioInputDevice.cpp.

References is_system_default.

169  {
170  return is_system_default;
171 }

◆ getName()

QString * SWGSDRangel::SWGAudioInputDevice::getName ( )

Definition at line 139 of file SWGAudioInputDevice.cpp.

References name.

139  {
140  return name;
141 }

◆ getSampleRate()

qint32 SWGSDRangel::SWGAudioInputDevice::getSampleRate ( )

Definition at line 159 of file SWGAudioInputDevice.cpp.

References sample_rate.

Referenced by WebAPIAdapterGUI::instanceAudioInputPatch(), and WebAPIAdapterSrv::instanceAudioInputPatch().

159  {
160  return sample_rate;
161 }
+ Here is the caller graph for this function:

◆ getVolume()

float SWGSDRangel::SWGAudioInputDevice::getVolume ( )

Definition at line 189 of file SWGAudioInputDevice.cpp.

References volume.

Referenced by WebAPIAdapterGUI::instanceAudioInputPatch(), and WebAPIAdapterSrv::instanceAudioInputPatch().

189  {
190  return volume;
191 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGAudioInputDevice::init ( )

Definition at line 50 of file SWGAudioInputDevice.cpp.

References default_unregistered, index, is_system_default, m_default_unregistered_isSet, m_index_isSet, m_is_system_default_isSet, m_name_isSet, m_sample_rate_isSet, m_volume_isSet, name, sample_rate, and volume.

Referenced by SWGAudioInputDevice().

50  {
51  name = new QString("");
52  m_name_isSet = false;
53  index = 0;
54  m_index_isSet = false;
55  sample_rate = 0;
56  m_sample_rate_isSet = false;
61  volume = 0.0f;
62  m_volume_isSet = false;
63 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGAudioInputDevice::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 200 of file SWGAudioInputDevice.cpp.

References m_default_unregistered_isSet, m_index_isSet, m_is_system_default_isSet, m_sample_rate_isSet, m_volume_isSet, and name.

200  {
201  bool isObjectUpdated = false;
202  do{
203  if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;}
204  if(m_index_isSet){ isObjectUpdated = true; break;}
205  if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
206  if(m_is_system_default_isSet){ isObjectUpdated = true; break;}
207  if(m_default_unregistered_isSet){ isObjectUpdated = true; break;}
208  if(m_volume_isSet){ isObjectUpdated = true; break;}
209  }while(false);
210  return isObjectUpdated;
211 }

◆ setDefaultUnregistered()

void SWGSDRangel::SWGAudioInputDevice::setDefaultUnregistered ( qint32  default_unregistered)

◆ setIndex()

void SWGSDRangel::SWGAudioInputDevice::setIndex ( qint32  index)

Definition at line 153 of file SWGAudioInputDevice.cpp.

References index, and m_index_isSet.

Referenced by WebAPIRequestMapper::validateAudioInputDevice().

153  {
154  this->index = index;
155  this->m_index_isSet = true;
156 }
+ Here is the caller graph for this function:

◆ setIsSystemDefault()

void SWGSDRangel::SWGAudioInputDevice::setIsSystemDefault ( qint32  is_system_default)

◆ setName()

void SWGSDRangel::SWGAudioInputDevice::setName ( QString *  name)

Definition at line 143 of file SWGAudioInputDevice.cpp.

References m_name_isSet, and name.

Referenced by WebAPIRequestMapper::resetAudioInputDevice().

143  {
144  this->name = name;
145  this->m_name_isSet = true;
146 }
+ Here is the caller graph for this function:

◆ setSampleRate()

void SWGSDRangel::SWGAudioInputDevice::setSampleRate ( qint32  sample_rate)

◆ setVolume()

void SWGSDRangel::SWGAudioInputDevice::setVolume ( float  volume)

Member Data Documentation

◆ default_unregistered

qint32 SWGSDRangel::SWGAudioInputDevice::default_unregistered
private

◆ index

qint32 SWGSDRangel::SWGAudioInputDevice::index
private

◆ is_system_default

qint32 SWGSDRangel::SWGAudioInputDevice::is_system_default
private

◆ m_default_unregistered_isSet

bool SWGSDRangel::SWGAudioInputDevice::m_default_unregistered_isSet
private

◆ m_index_isSet

bool SWGSDRangel::SWGAudioInputDevice::m_index_isSet
private

Definition at line 71 of file SWGAudioInputDevice.h.

Referenced by asJsonObject(), init(), isSet(), setIndex(), and SWGAudioInputDevice().

◆ m_is_system_default_isSet

bool SWGSDRangel::SWGAudioInputDevice::m_is_system_default_isSet
private

◆ m_name_isSet

bool SWGSDRangel::SWGAudioInputDevice::m_name_isSet
private

Definition at line 68 of file SWGAudioInputDevice.h.

Referenced by init(), setName(), and SWGAudioInputDevice().

◆ m_sample_rate_isSet

bool SWGSDRangel::SWGAudioInputDevice::m_sample_rate_isSet
private

Definition at line 74 of file SWGAudioInputDevice.h.

Referenced by asJsonObject(), init(), isSet(), setSampleRate(), and SWGAudioInputDevice().

◆ m_volume_isSet

bool SWGSDRangel::SWGAudioInputDevice::m_volume_isSet
private

Definition at line 83 of file SWGAudioInputDevice.h.

Referenced by asJsonObject(), init(), isSet(), setVolume(), and SWGAudioInputDevice().

◆ name

QString* SWGSDRangel::SWGAudioInputDevice::name
private

◆ sample_rate

qint32 SWGSDRangel::SWGAudioInputDevice::sample_rate
private

◆ volume

float SWGSDRangel::SWGAudioInputDevice::volume
private

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