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.
deviceuserargs.h
Go to the documentation of this file.
1 // Copyright (C) 2019 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef SDRBASE_DEVICE_DEVICEUSERARGS_H_
19 #define SDRBASE_DEVICE_DEVICEUSERARGS_H_
20 
21 #include <QList>
22 #include <QString>
23 #include <QByteArray>
24 
25 #include "export.h"
26 
28 {
29 public:
30  struct Args {
31  QString m_id;
33  QString m_args;
34 
35  Args() :
36  m_id(""),
37  m_sequence(0),
38  m_args("")
39  {}
40 
41  Args(const QString id, int sequence, const QString& args) :
42  m_id(id),
43  m_sequence(sequence),
44  m_args(args)
45  {}
46 
47  friend QDataStream &operator << (QDataStream &ds, const Args &inObj);
48  friend QDataStream &operator >> (QDataStream &ds, Args &outObj);
49  };
50 
51  QByteArray serialize() const;
52  bool deserialize(const QByteArray& data);
53  QString findUserArgs(const QString& id, int sequence);
54  void addDeviceArgs(const QString& id, int sequence, const QString& args);
55  void addOrUpdateDeviceArgs(const QString& id, int sequence, const QString& args);
56  void updateDeviceArgs(const QString& id, int sequence, const QString& args);
57  void deleteDeviceArgs(const QString& id, int sequence);
58  const QList<Args>& getArgsByDevice() const { return m_argsByDevice; }
59 
60  QList<Args> m_argsByDevice;
61 };
62 
63 
64 #endif // SDRBASE_DEVICE_DEVICEUSERARGS_H_
QList< Args > m_argsByDevice
args corresponding to a device
const QList< Args > & getArgsByDevice() const
QDataStream & operator>>(QDataStream &ds, AudioDeviceManager::InputDeviceInfo &info)
QDataStream & operator<<(QDataStream &ds, const AudioDeviceManager::InputDeviceInfo &info)
#define SDRBASE_API
Definition: export.h:40
Args(const QString id, int sequence, const QString &args)