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.
kiwisdrplugin.cpp
Go to the documentation of this file.
1 // Copyright (C) 2019 Vort //
3 // Copyright (C) 2019 Edouard Griffiths, F4EXB //
4 // //
5 // This program is free software; you can redistribute it and/or modify //
6 // it under the terms of the GNU General Public License as published by //
7 // the Free Software Foundation as version 3 of the License, or //
8 // (at your option) any later version. //
9 // //
10 // This program is distributed in the hope that it will be useful, //
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
13 // GNU General Public License V3 for more details. //
14 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
18 
19 #include <QtPlugin>
20 
21 #include "plugin/pluginapi.h"
22 #include "util/simpleserializer.h"
23 
24 #ifdef SERVER_MODE
25 #include "kiwisdrinput.h"
26 #else
27 #include "kiwisdrgui.h"
28 #endif
29 #include "kiwisdrplugin.h"
30 
32  QString("KiwiSDR input"),
33  QString("4.10.0"),
34  QString("(c) Vort (c) Edouard Griffiths, F4EXB"),
35  QString("https://github.com/f4exb/sdrangel"),
36  true,
37  QString("https://github.com/f4exb/sdrangel")
38 };
39 
40 const QString KiwiSDRPlugin::m_hardwareID = "KiwiSDR";
42 
43 KiwiSDRPlugin::KiwiSDRPlugin(QObject* parent) :
44  QObject(parent)
45 {
46 }
47 
49 {
50  return m_pluginDescriptor;
51 }
52 
54 {
55  pluginAPI->registerSampleSource(m_deviceTypeID, this);
56 }
57 
59 {
60  SamplingDevices result;
61 
62  result.append(SamplingDevice(
63  "KiwiSDR",
66  QString::null,
67  0,
70  1,
71  0));
72 
73  return result;
74 }
75 
76 #ifdef SERVER_MODE
78  const QString& sourceId,
79  QWidget **widget,
80  DeviceUISet *deviceUISet)
81 {
82  (void) sourceId;
83  (void) widget;
84  (void) deviceUISet;
85  return 0;
86 }
87 #else
89  const QString& sourceId,
90  QWidget **widget,
91  DeviceUISet *deviceUISet)
92 {
93  if(sourceId == m_deviceTypeID) {
94  KiwiSDRGui* gui = new KiwiSDRGui(deviceUISet);
95  *widget = gui;
96  return gui;
97  } else {
98  return 0;
99  }
100 }
101 #endif
102 
104 {
105  if (sourceId == m_deviceTypeID)
106  {
107  KiwiSDRInput* input = new KiwiSDRInput(deviceAPI);
108  return input;
109  }
110  else
111  {
112  return 0;
113  }
114 }
115 
const PluginDescriptor & getPluginDescriptor() const
virtual PluginInstanceGUI * createSampleSourcePluginInstanceGUI(const QString &sourceId, QWidget **widget, DeviceUISet *deviceUISet)
void registerSampleSource(const QString &sourceName, PluginInterface *plugin)
Definition: pluginapi.cpp:9
static const QString m_hardwareID
Definition: kiwisdrplugin.h:47
virtual SamplingDevices enumSampleSources()
void initPlugin(PluginAPI *pluginAPI)
static const QString m_deviceTypeID
Definition: kiwisdrplugin.h:48
KiwiSDRPlugin(QObject *parent=NULL)
Exposes a single input stream that can be one of the streams of a physical device.
#define KIWISDR_DEVICE_TYPE_ID
Definition: kiwisdrplugin.h:27
virtual DeviceSampleSource * createSampleSourcePluginInstance(const QString &sourceId, DeviceAPI *deviceAPI)
QList< SamplingDevice > SamplingDevices
static const PluginDescriptor m_pluginDescriptor
Definition: kiwisdrplugin.h:51