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.
fcdproplugin.cpp
Go to the documentation of this file.
1 // Copyright (C) 2015 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 #include "plugin/pluginapi.h"
20 #include "util/simpleserializer.h"
21 #include "fcdproplugin.h"
22 
23 #ifdef SERVER_MODE
24 #include "fcdproinput.h"
25 #else
26 #include "fcdprogui.h"
27 #endif
28 #include "fcdtraits.h"
29 
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 FCDProPlugin::FCDProPlugin(QObject* parent) :
40  QObject(parent)
41 {
42 }
43 
45 {
46  return m_pluginDescriptor;
47 }
48 
50 {
52 }
53 
55 {
56  SamplingDevices result;
57 
58  int i = 0;
60 
61  while (device_info != 0)
62  {
63  QString serialNumber = QString::fromWCharArray(device_info->serial_number);
64  QString displayedName(QString("%1[%2] %3").arg(fcd_traits<Pro>::displayedName).arg(i).arg(serialNumber));
65 
66  result.append(SamplingDevice(displayedName,
69  serialNumber,
70  i,
73  1,
74  0));
75 
76  device_info = device_info->next;
77  i++;
78  }
79 
80  return result;
81 }
82 
83 #ifdef SERVER_MODE
85  const QString& sourceId,
86  QWidget **widget,
87  DeviceUISet *deviceUISet)
88 {
89  (void) sourceId;
90  (void) widget;
91  (void) deviceUISet;
92  return 0;
93 }
94 #else
96  const QString& sourceId,
97  QWidget **widget,
98  DeviceUISet *deviceUISet)
99 {
100  if(sourceId == fcd_traits<Pro>::interfaceIID)
101  {
102  FCDProGui* gui = new FCDProGui(deviceUISet);
103  *widget = gui;
104  return gui;
105  }
106  else
107  {
108  return 0;
109  }
110 }
111 #endif
112 
114 {
115  if (sourceId == fcd_traits<Pro>::interfaceIID)
116  {
117  FCDProInput* input = new FCDProInput(deviceAPI);
118  return input;
119  }
120  else
121  {
122  return 0;
123  }
124 }
void initPlugin(PluginAPI *pluginAPI)
void registerSampleSource(const QString &sourceName, PluginInterface *plugin)
Definition: pluginapi.cpp:9
virtual PluginInstanceGUI * createSampleSourcePluginInstanceGUI(const QString &sourceId, QWidget **widget, DeviceUISet *deviceUISet)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
struct hid_device_info * next
Definition: hidapi.h:78
virtual DeviceSampleSource * createSampleSourcePluginInstance(const QString &sourceId, DeviceAPI *deviceAPI)
FCDProPlugin(QObject *parent=NULL)
wchar_t * serial_number
Definition: hidapi.h:57
int32_t i
Definition: decimators.h:244
struct hid_device_info HID_API_EXPORT * hid_enumerate(unsigned short vendor_id, unsigned short product_id)
Enumerate the HID Devices.
Definition: hid-libusb.c:444
const PluginDescriptor & getPluginDescriptor() const
virtual SamplingDevices enumSampleSources()
Exposes a single input stream that can be one of the streams of a physical device.
static const PluginDescriptor m_pluginDescriptor
Definition: fcdproplugin.h:30
QList< SamplingDevice > SamplingDevices