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.
localinputplugin.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 "localinput.h"
25 #else
26 #include "localinputgui.h"
27 #endif
28 #include "localinputplugin.h"
29 
31  QString("Local device input"),
32  QString("4.6.0"),
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 LocalInputPlugin::m_hardwareID = "LocalInput";
41 
43  QObject(parent)
44 {
45 }
46 
48 {
49  return m_pluginDescriptor;
50 }
51 
53 {
54  pluginAPI->registerSampleSource(m_deviceTypeID, this);
55 }
56 
58 {
59  SamplingDevices result;
60 
61  result.append(SamplingDevice(
62  "LocalInput",
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  {
94  LocalInputGui* gui = new LocalInputGui(deviceUISet);
95  *widget = gui;
96  return gui;
97  }
98  else
99  {
100  return 0;
101  }
102 }
103 #endif
104 
106 {
107  if (sourceId == m_deviceTypeID)
108  {
109  LocalInput* input = new LocalInput(deviceAPI);
110  return input;
111  }
112  else
113  {
114  return 0;
115  }
116 }
virtual PluginInstanceGUI * createSampleSourcePluginInstanceGUI(const QString &sourceId, QWidget **widget, DeviceUISet *deviceUISet)
virtual SamplingDevices enumSampleSources()
void initPlugin(PluginAPI *pluginAPI)
void registerSampleSource(const QString &sourceName, PluginInterface *plugin)
Definition: pluginapi.cpp:9
LocalInputPlugin(QObject *parent=NULL)
virtual DeviceSampleSource * createSampleSourcePluginInstance(const QString &sourceId, DeviceAPI *deviceAPI)
static const PluginDescriptor m_pluginDescriptor
static const QString m_hardwareID
Exposes a single input stream that can be one of the streams of a physical device.
const PluginDescriptor & getPluginDescriptor() const
#define LOCALINPUT_DEVICE_TYPE_ID
QList< SamplingDevice > SamplingDevices
static const QString m_deviceTypeID