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.
remoteoutputplugin.cpp
Go to the documentation of this file.
1 // Copyright (C) 2017 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 "remoteoutput.h"
25 #else
26 #include "remoteoutputgui.h"
27 #endif
28 #include "remoteoutputplugin.h"
29 
31  QString("Remote device output"),
32  QString("4.5.2"),
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 RemoteOutputPlugin::m_hardwareID = "RemoteOutput";
41 
43  QObject(parent)
44 {
45 }
46 
48 {
49  return m_pluginDescriptor;
50 }
51 
53 {
54  pluginAPI->registerSampleSink(m_deviceTypeID, this);
55 }
56 
58 {
59  SamplingDevices result;
60 
61  result.append(SamplingDevice(
62  "RemoteOutput",
65  QString::null,
66  0,
69  1,
70  0));
71 
72  return result;
73 }
74 
75 #ifdef SERVER_MODE
77  const QString& sinkId,
78  QWidget **widget,
79  DeviceUISet *deviceUISet)
80 {
81  (void) sinkId;
82  (void) widget;
83  (void) deviceUISet;
84  return 0;
85 }
86 #else
88  const QString& sinkId,
89  QWidget **widget,
90  DeviceUISet *deviceUISet)
91 {
92  if(sinkId == m_deviceTypeID)
93  {
94  RemoteOutputSinkGui* gui = new RemoteOutputSinkGui(deviceUISet);
95  *widget = gui;
96  return gui;
97  }
98  else
99  {
100  return 0;
101  }
102 }
103 #endif
104 
106 {
107  if(sinkId == m_deviceTypeID)
108  {
109  RemoteOutput* output = new RemoteOutput(deviceAPI);
110  return output;
111  }
112  else
113  {
114  return 0;
115  }
116 
117 }
RemoteOutputPlugin(QObject *parent=NULL)
void registerSampleSink(const QString &sinkName, PluginInterface *plugin)
Definition: pluginapi.cpp:24
const PluginDescriptor & getPluginDescriptor() const
virtual SamplingDevices enumSampleSinks()
static const QString m_hardwareID
Exposes a single output stream that can be one of the streams of a physical device.
void initPlugin(PluginAPI *pluginAPI)
virtual PluginInstanceGUI * createSampleSinkPluginInstanceGUI(const QString &sinkId, QWidget **widget, DeviceUISet *deviceUISet)
#define REMOTEOUTPUT_DEVICE_TYPE_ID
static const QString m_deviceTypeID
static const PluginDescriptor m_pluginDescriptor
virtual DeviceSampleSink * createSampleSinkPluginInstance(const QString &sinkId, DeviceAPI *deviceAPI)
QList< SamplingDevice > SamplingDevices