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.
testmiplugin.cpp
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 #include <QtPlugin>
19 
20 #include "plugin/pluginapi.h"
21 #include "util/simpleserializer.h"
22 
23 #ifdef SERVER_MODE
24 #include "testmi.h"
25 #else
26 #include "testmigui.h"
27 #endif
28 #include "testmiplugin.h"
29 
31  QString("Test Multiple Input"),
32  QString("4.8.1"),
33  QString("(c) Edouard Griffiths, F4EXB"),
34  QString("https://github.com/f4exb/sdrangel"),
35  true,
36  QString("https://github.com/f4exb/sdrangel")
37 };
38 
39 const QString TestMIPlugin::m_hardwareID = "TestMI";
41 
42 TestMIPlugin::TestMIPlugin(QObject* parent) :
43  QObject(parent)
44 {
45 }
46 
48 {
49  return m_pluginDescriptor;
50 }
51 
53 {
54  pluginAPI->registerSampleMIMO(m_deviceTypeID, this);
55 }
56 
58 {
59  SamplingDevices result;
60 
61  result.append(SamplingDevice(
62  "TestMI",
65  QString::null,
66  0,
69  1,
70  0));
71 
72  return result;
73 }
74 
75 #ifdef SERVER_MODE
77  const QString& sourceId,
78  QWidget **widget,
79  DeviceUISet *deviceUISet)
80 {
81  (void) sourceId;
82  (void) widget;
83  (void) deviceUISet;
84  return 0;
85 }
86 #else
88  const QString& sourceId,
89  QWidget **widget,
90  DeviceUISet *deviceUISet)
91 {
92  if (sourceId == m_deviceTypeID) {
93  TestMIGui* gui = new TestMIGui(deviceUISet);
94  *widget = gui;
95  return gui;
96  } else {
97  return nullptr;
98  }
99 }
100 #endif
101 
103 {
104  if (mimoId == m_deviceTypeID)
105  {
106  TestMI* input = new TestMI(deviceAPI);
107  return input;
108  }
109  else
110  {
111  return nullptr;
112  }
113 }
114 
static const QString m_deviceTypeID
Definition: testmiplugin.h:47
Definition: testmi.h:35
May expose any number of input and/or output streams.
virtual PluginInstanceGUI * createSampleMIMOPluginInstanceGUI(const QString &sourceId, QWidget **widget, DeviceUISet *deviceUISet)
virtual DeviceSampleMIMO * createSampleMIMOPluginInstance(const QString &sourceId, DeviceAPI *deviceAPI)
void registerSampleMIMO(const QString &sinkName, PluginInterface *plugin)
Definition: pluginapi.cpp:29
static const QString m_hardwareID
Definition: testmiplugin.h:46
TestMIPlugin(QObject *parent=NULL)
static const PluginDescriptor m_pluginDescriptor
Definition: testmiplugin.h:50
#define TESTMI_DEVICE_TYPE_ID
Definition: testmiplugin.h:26
void initPlugin(PluginAPI *pluginAPI)
const PluginDescriptor & getPluginDescriptor() const
QList< SamplingDevice > SamplingDevices
virtual SamplingDevices enumSampleMIMO()