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.
fcdproplusplugin.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 "fcdproplusplugin.h"
22 
23 #ifdef SERVER_MODE
24 #include "fcdproplusinput.h"
25 #else
26 #include "fcdproplusgui.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 
40 
42  QObject(parent)
43 {
44 }
45 
47 {
48  return m_pluginDescriptor;
49 }
50 
52 {
54 }
55 
57 {
58  SamplingDevices result;
59 
60  int i = 0;
62 
63  while (device_info != 0)
64  {
65  QString serialNumber = QString::fromWCharArray(device_info->serial_number);
66  QString displayedName(QString("%1[%2] %3").arg(fcd_traits<ProPlus>::displayedName).arg(i).arg(serialNumber));
67 
68  result.append(SamplingDevice(displayedName,
71  serialNumber,
72  i,
75  1,
76  0));
77 
78  device_info = device_info->next;
79  i++;
80  }
81 
82  return result;
83 }
84 
85 #ifdef SERVER_MODE
87  const QString& sourceId,
88  QWidget **widget,
89  DeviceUISet *deviceUISet)
90 {
91  (void) sourceId;
92  (void) widget;
93  (void) deviceUISet;
94  return 0;
95 }
96 #else
98  const QString& sourceId,
99  QWidget **widget,
100  DeviceUISet *deviceUISet)
101 {
102  if(sourceId == fcd_traits<ProPlus>::interfaceIID)
103  {
104  FCDProPlusGui* gui = new FCDProPlusGui(deviceUISet);
105  *widget = gui;
106  return gui;
107  }
108  else
109  {
110  return 0;
111  }
112 }
113 #endif
114 
116 {
117  if(sourceId == fcd_traits<ProPlus>::interfaceIID)
118  {
119  FCDProPlusInput* input = new FCDProPlusInput(deviceAPI);
120  return input;
121  }
122  else
123  {
124  return 0;
125  }
126 }
#define FCDPROPLUS_DEVICE_TYPE_ID
void registerSampleSource(const QString &sourceName, PluginInterface *plugin)
Definition: pluginapi.cpp:9
virtual SamplingDevices enumSampleSources()
static const PluginDescriptor m_pluginDescriptor
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
virtual PluginInstanceGUI * createSampleSourcePluginInstanceGUI(const QString &sourceId, QWidget **widget, DeviceUISet *deviceUISet)
struct hid_device_info * next
Definition: hidapi.h:78
static const QString m_deviceTypeID
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
virtual DeviceSampleSource * createSampleSourcePluginInstance(const QString &sourceId, DeviceAPI *deviceAPI)
FCDProPlusPlugin(QObject *parent=NULL)
Exposes a single input stream that can be one of the streams of a physical device.
void initPlugin(PluginAPI *pluginAPI)
const PluginDescriptor & getPluginDescriptor() const
QList< SamplingDevice > SamplingDevices