1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-16 05:11:49 -05:00

Removed GLSpectrum getter from DeviceSinkAPI

This commit is contained in:
f4exb 2017-10-30 01:11:35 +01:00
parent da3e6dcdfb
commit 35391e0d66
28 changed files with 138 additions and 52 deletions

View File

@ -25,13 +25,15 @@
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include "device/devicesinkapi.h" #include "device/devicesinkapi.h"
#include "device/deviceuiset.h"
#include "bladerfoutputgui.h" #include "bladerfoutputgui.h"
#include "bladerf/devicebladerfvalues.h" #include "bladerf/devicebladerfvalues.h"
BladerfOutputGui::BladerfOutputGui(DeviceSinkAPI *deviceAPI, QWidget* parent) : BladerfOutputGui::BladerfOutputGui(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::BladerfOutputGui), ui(new Ui::BladerfOutputGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true), m_forceSettings(true),
m_settings(), m_settings(),
m_deviceSampleSink(NULL), m_deviceSampleSink(NULL),
@ -166,8 +168,8 @@ void BladerfOutputGui::handleInputMessages()
void BladerfOutputGui::updateSampleRateAndFrequency() void BladerfOutputGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateLabel->setText(QString("%1k").arg(QString::number(m_sampleRate/1000.0, 'g', 5))); ui->deviceRateLabel->setText(QString("%1k").arg(QString::number(m_sampleRate/1000.0, 'g', 5)));
} }

View File

@ -27,6 +27,7 @@
class DeviceSinkAPI; class DeviceSinkAPI;
class DeviceSampleSink; class DeviceSampleSink;
class DeviceUISet;
namespace Ui { namespace Ui {
class BladerfOutputGui; class BladerfOutputGui;
@ -36,7 +37,7 @@ class BladerfOutputGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit BladerfOutputGui(DeviceSinkAPI *deviceAPI, QWidget* parent = NULL); explicit BladerfOutputGui(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~BladerfOutputGui(); virtual ~BladerfOutputGui();
virtual void destroy(); virtual void destroy();
@ -55,6 +56,7 @@ private:
Ui::BladerfOutputGui* ui; Ui::BladerfOutputGui* ui;
DeviceSinkAPI* m_deviceAPI; DeviceSinkAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings; bool m_forceSettings;
BladeRFOutputSettings m_settings; BladeRFOutputSettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -77,11 +77,15 @@ PluginInterface::SamplingDevices BladerfOutputPlugin::enumSampleSinks()
return result; return result;
} }
PluginInstanceGUI* BladerfOutputPlugin::createSampleSinkPluginInstanceGUI(const QString& sinkId,QWidget **widget, DeviceSinkAPI *deviceAPI) PluginInstanceGUI* BladerfOutputPlugin::createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sinkId == m_deviceTypeID) if(sinkId == m_deviceTypeID)
{ {
BladerfOutputGui* gui = new BladerfOutputGui(deviceAPI); BladerfOutputGui* gui = new BladerfOutputGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,13 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks(); virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI);
virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI); virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -32,12 +32,14 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "device/devicesinkapi.h" #include "device/devicesinkapi.h"
#include "device/deviceuiset.h"
#include "filesinkgui.h" #include "filesinkgui.h"
FileSinkGui::FileSinkGui(DeviceSinkAPI *deviceAPI, QWidget* parent) : FileSinkGui::FileSinkGui(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::FileSinkGui), ui(new Ui::FileSinkGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true), m_forceSettings(true),
m_settings(), m_settings(),
m_fileName("./test.sdriq"), m_fileName("./test.sdriq"),
@ -177,8 +179,8 @@ void FileSinkGui::handleInputMessages()
void FileSinkGui::updateSampleRateAndFrequency() void FileSinkGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(tr("%1k").arg((float)(m_sampleRate*(1<<m_settings.m_log2Interp)) / 1000)); ui->deviceRateText->setText(tr("%1k").arg((float)(m_sampleRate*(1<<m_settings.m_log2Interp)) / 1000));
} }

View File

@ -29,6 +29,7 @@
class DeviceSinkAPI; class DeviceSinkAPI;
class DeviceSampleSink; class DeviceSampleSink;
class DeviceUISet;
namespace Ui { namespace Ui {
class FileSinkGui; class FileSinkGui;
@ -38,7 +39,7 @@ class FileSinkGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit FileSinkGui(DeviceSinkAPI *deviceAPI, QWidget* parent = NULL); explicit FileSinkGui(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~FileSinkGui(); virtual ~FileSinkGui();
virtual void destroy(); virtual void destroy();
@ -57,6 +58,7 @@ private:
Ui::FileSinkGui* ui; Ui::FileSinkGui* ui;
DeviceSinkAPI* m_deviceAPI; DeviceSinkAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings; bool m_forceSettings;
FileSinkSettings m_settings; FileSinkSettings m_settings;
QString m_fileName; QString m_fileName;

View File

@ -69,11 +69,15 @@ PluginInterface::SamplingDevices FileSinkPlugin::enumSampleSinks()
return result; return result;
} }
PluginInstanceGUI* FileSinkPlugin::createSampleSinkPluginInstanceGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI) PluginInstanceGUI* FileSinkPlugin::createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sinkId == m_deviceTypeID) if(sinkId == m_deviceTypeID)
{ {
FileSinkGui* gui = new FileSinkGui(deviceAPI); FileSinkGui* gui = new FileSinkGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -37,7 +37,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks(); virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI); virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -27,15 +27,17 @@
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include "device/devicesinkapi.h" #include "device/devicesinkapi.h"
#include "device/devicesourceapi.h" #include "device/devicesourceapi.h"
#include "device/deviceuiset.h"
#include "hackrf/devicehackrfvalues.h" #include "hackrf/devicehackrfvalues.h"
#include "hackrf/devicehackrfshared.h" #include "hackrf/devicehackrfshared.h"
#include "ui_hackrfoutputgui.h" #include "ui_hackrfoutputgui.h"
HackRFOutputGui::HackRFOutputGui(DeviceSinkAPI *deviceAPI, QWidget* parent) : HackRFOutputGui::HackRFOutputGui(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::HackRFOutputGui), ui(new Ui::HackRFOutputGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true), m_forceSettings(true),
m_settings(), m_settings(),
m_deviceSampleSink(0), m_deviceSampleSink(0),
@ -180,8 +182,8 @@ void HackRFOutputGui::handleInputMessages()
void HackRFOutputGui::updateSampleRateAndFrequency() void HackRFOutputGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(QString("%1k").arg(QString::number(m_sampleRate/1000.0, 'g', 5))); ui->deviceRateText->setText(QString("%1k").arg(QString::number(m_sampleRate/1000.0, 'g', 5)));
} }

View File

@ -29,6 +29,7 @@
class DeviceSinkAPI; class DeviceSinkAPI;
class DeviceSampleSink; class DeviceSampleSink;
class DeviceUISet;
namespace Ui { namespace Ui {
class HackRFOutputGui; class HackRFOutputGui;
@ -46,7 +47,7 @@ public:
HACKRF_IMGREJ_NB HACKRF_IMGREJ_NB
} HackRFImgRejValue; } HackRFImgRejValue;
explicit HackRFOutputGui(DeviceSinkAPI *deviceAPI, QWidget* parent = NULL); explicit HackRFOutputGui(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~HackRFOutputGui(); virtual ~HackRFOutputGui();
virtual void destroy(); virtual void destroy();
@ -65,6 +66,7 @@ private:
Ui::HackRFOutputGui* ui; Ui::HackRFOutputGui* ui;
DeviceSinkAPI* m_deviceAPI; DeviceSinkAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings; bool m_forceSettings;
HackRFOutputSettings m_settings; HackRFOutputSettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -116,11 +116,15 @@ PluginInterface::SamplingDevices HackRFOutputPlugin::enumSampleSinks()
return result; return result;
} }
PluginInstanceGUI* HackRFOutputPlugin::createSampleSinkPluginInstanceGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI) PluginInstanceGUI* HackRFOutputPlugin::createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sinkId == m_deviceTypeID) if(sinkId == m_deviceTypeID)
{ {
HackRFOutputGui* gui = new HackRFOutputGui(deviceAPI); HackRFOutputGui* gui = new HackRFOutputGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks(); virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI); virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -23,12 +23,14 @@
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include "device/devicesinkapi.h" #include "device/devicesinkapi.h"
#include "device/deviceuiset.h"
#include "limesdroutputgui.h" #include "limesdroutputgui.h"
LimeSDROutputGUI::LimeSDROutputGUI(DeviceSinkAPI *deviceAPI, QWidget* parent) : LimeSDROutputGUI::LimeSDROutputGUI(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::LimeSDROutputGUI), ui(new Ui::LimeSDROutputGUI),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(), m_settings(),
m_sampleRate(0), m_sampleRate(0),
m_lastEngineState((DSPDeviceSinkEngine::State)-1), m_lastEngineState((DSPDeviceSinkEngine::State)-1),
@ -238,8 +240,8 @@ void LimeSDROutputGUI::handleInputMessages()
void LimeSDROutputGUI::updateSampleRateAndFrequency() void LimeSDROutputGUI::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5))); ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5)));
} }

View File

@ -27,6 +27,7 @@
class DeviceSinkAPI; class DeviceSinkAPI;
class DeviceSampleSink; class DeviceSampleSink;
class DeviceUISet;
namespace Ui { namespace Ui {
class LimeSDROutputGUI; class LimeSDROutputGUI;
@ -36,7 +37,7 @@ class LimeSDROutputGUI : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit LimeSDROutputGUI(DeviceSinkAPI *deviceAPI, QWidget* parent = 0); explicit LimeSDROutputGUI(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~LimeSDROutputGUI(); virtual ~LimeSDROutputGUI();
virtual void destroy(); virtual void destroy();
@ -55,6 +56,7 @@ private:
Ui::LimeSDROutputGUI* ui; Ui::LimeSDROutputGUI* ui;
DeviceSinkAPI* m_deviceAPI; DeviceSinkAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
LimeSDROutput* m_limeSDROutput; //!< Same object as above but gives easy access to LimeSDROutput methods and attributes that are used intensively LimeSDROutput* m_limeSDROutput; //!< Same object as above but gives easy access to LimeSDROutput methods and attributes that are used intensively
LimeSDROutputSettings m_settings; LimeSDROutputSettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -96,11 +96,15 @@ PluginInterface::SamplingDevices LimeSDROutputPlugin::enumSampleSinks()
return result; return result;
} }
PluginInstanceGUI* LimeSDROutputPlugin::createSampleSinkPluginInstanceGUI(const QString& sinkId,QWidget **widget, DeviceSinkAPI *deviceAPI) PluginInstanceGUI* LimeSDROutputPlugin::createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sinkId == m_deviceTypeID) if(sinkId == m_deviceTypeID)
{ {
LimeSDROutputGUI* gui = new LimeSDROutputGUI(deviceAPI); LimeSDROutputGUI* gui = new LimeSDROutputGUI(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks(); virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI); virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -22,15 +22,17 @@
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include "gui/glspectrum.h" #include "gui/glspectrum.h"
#include "device/devicesinkapi.h" #include "device/devicesinkapi.h"
#include "device/deviceuiset.h"
#include "plutosdr/deviceplutosdr.h" #include "plutosdr/deviceplutosdr.h"
#include "plutosdroutput.h" #include "plutosdroutput.h"
#include "plutosdroutputgui.h" #include "plutosdroutputgui.h"
#include "ui_plutosdroutputgui.h" #include "ui_plutosdroutputgui.h"
PlutoSDROutputGUI::PlutoSDROutputGUI(DeviceSinkAPI *deviceAPI, QWidget* parent) : PlutoSDROutputGUI::PlutoSDROutputGUI(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::PlutoSDROutputGUI), ui(new Ui::PlutoSDROutputGUI),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(), m_settings(),
m_forceSettings(true), m_forceSettings(true),
m_sampleSink(0), m_sampleSink(0),
@ -421,7 +423,7 @@ void PlutoSDROutputGUI::handleInputMessages()
void PlutoSDROutputGUI::updateSampleRateAndFrequency() void PlutoSDROutputGUI::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5))); ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5)));
} }

View File

@ -28,6 +28,7 @@
class DeviceSinkAPI; class DeviceSinkAPI;
class DeviceSampleSink; class DeviceSampleSink;
class DeviceUISet;
namespace Ui { namespace Ui {
class PlutoSDROutputGUI; class PlutoSDROutputGUI;
@ -37,7 +38,7 @@ class PlutoSDROutputGUI : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit PlutoSDROutputGUI(DeviceSinkAPI *deviceAPI, QWidget* parent = 0); explicit PlutoSDROutputGUI(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~PlutoSDROutputGUI(); virtual ~PlutoSDROutputGUI();
virtual void destroy(); virtual void destroy();
@ -54,6 +55,7 @@ public:
private: private:
Ui::PlutoSDROutputGUI* ui; Ui::PlutoSDROutputGUI* ui;
DeviceSinkAPI* m_deviceAPI; DeviceSinkAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
PlutoSDROutputSettings m_settings; PlutoSDROutputSettings m_settings;
bool m_forceSettings; bool m_forceSettings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -81,11 +81,15 @@ PluginInterface::SamplingDevices PlutoSDROutputPlugin::enumSampleSinks()
return result; return result;
} }
PluginInstanceGUI* PlutoSDROutputPlugin::createSampleSinkPluginInstanceGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI) PluginInstanceGUI* PlutoSDROutputPlugin::createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sinkId == m_deviceTypeID) if(sinkId == m_deviceTypeID)
{ {
PlutoSDROutputGUI* gui = new PlutoSDROutputGUI(deviceAPI); PlutoSDROutputGUI* gui = new PlutoSDROutputGUI(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks(); virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI); virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -38,12 +38,14 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "device/devicesinkapi.h" #include "device/devicesinkapi.h"
#include "device/deviceuiset.h"
#include "sdrdaemonsinkgui.h" #include "sdrdaemonsinkgui.h"
SDRdaemonSinkGui::SDRdaemonSinkGui(DeviceSinkAPI *deviceAPI, QWidget* parent) : SDRdaemonSinkGui::SDRdaemonSinkGui(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SDRdaemonSinkGui), ui(new Ui::SDRdaemonSinkGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(), m_settings(),
m_deviceSampleSink(0), m_deviceSampleSink(0),
m_sampleRate(0), m_sampleRate(0),
@ -211,8 +213,8 @@ void SDRdaemonSinkGui::handleInputMessages()
void SDRdaemonSinkGui::updateSampleRateAndFrequency() void SDRdaemonSinkGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(tr("%1k").arg((float)(m_sampleRate*(1<<m_settings.m_log2Interp)) / 1000)); ui->deviceRateText->setText(tr("%1k").arg((float)(m_sampleRate*(1<<m_settings.m_log2Interp)) / 1000));
} }

View File

@ -30,6 +30,7 @@
class DeviceSinkAPI; class DeviceSinkAPI;
class DeviceSampleSink; class DeviceSampleSink;
class DeviceUISet;
namespace Ui { namespace Ui {
class SDRdaemonSinkGui; class SDRdaemonSinkGui;
@ -39,7 +40,7 @@ class SDRdaemonSinkGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit SDRdaemonSinkGui(DeviceSinkAPI *deviceAPI, QWidget* parent = NULL); explicit SDRdaemonSinkGui(DeviceSinkAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~SDRdaemonSinkGui(); virtual ~SDRdaemonSinkGui();
virtual void destroy(); virtual void destroy();
@ -58,6 +59,7 @@ private:
Ui::SDRdaemonSinkGui* ui; Ui::SDRdaemonSinkGui* ui;
DeviceSinkAPI* m_deviceAPI; DeviceSinkAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
SDRdaemonSinkSettings m_settings; //!< current settings SDRdaemonSinkSettings m_settings; //!< current settings
SDRdaemonSinkSettings m_controlSettings; //!< settings last sent to device via control port SDRdaemonSinkSettings m_controlSettings; //!< settings last sent to device via control port
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -70,11 +70,15 @@ PluginInterface::SamplingDevices SDRdaemonSinkPlugin::enumSampleSinks()
return result; return result;
} }
PluginInstanceGUI* SDRdaemonSinkPlugin::createSampleSinkPluginInstanceGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI) PluginInstanceGUI* SDRdaemonSinkPlugin::createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sinkId == m_deviceTypeID) if(sinkId == m_deviceTypeID)
{ {
SDRdaemonSinkGui* gui = new SDRdaemonSinkGui(deviceAPI); SDRdaemonSinkGui* gui = new SDRdaemonSinkGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -37,7 +37,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSinks(); virtual SamplingDevices enumSampleSinks();
virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(
const QString& sinkId,
QWidget **widget,
DeviceSinkAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI); virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId, DeviceSinkAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -136,11 +136,6 @@ MessageQueue *DeviceSinkAPI::getSampleSinkGUIMessageQueue()
return getSampleSink()->getMessageQueueToGUI(); return getSampleSink()->getMessageQueueToGUI();
} }
GLSpectrum *DeviceSinkAPI::getSpectrum()
{
return m_spectrum;
}
void DeviceSinkAPI::addChannelMarker(ChannelMarker* channelMarker) void DeviceSinkAPI::addChannelMarker(ChannelMarker* channelMarker)
{ {
m_spectrum->addChannelMarker(channelMarker); m_spectrum->addChannelMarker(channelMarker);

View File

@ -66,8 +66,8 @@ public:
MessageQueue *getDeviceEngineInputMessageQueue(); MessageQueue *getDeviceEngineInputMessageQueue();
MessageQueue *getSampleSinkInputMessageQueue(); MessageQueue *getSampleSinkInputMessageQueue();
MessageQueue *getSampleSinkGUIMessageQueue(); MessageQueue *getSampleSinkGUIMessageQueue();
// device related stuff // device related stuff
GLSpectrum *getSpectrum(); //!< Direct spectrum getter
void addChannelMarker(ChannelMarker* channelMarker); //!< Add channel marker to spectrum void addChannelMarker(ChannelMarker* channelMarker); //!< Add channel marker to spectrum
void addRollupWidget(QWidget *widget); //!< Add rollup widget to channel window void addRollupWidget(QWidget *widget); //!< Add rollup widget to channel window

View File

@ -296,7 +296,10 @@ void MainWindow::addSinkDevice()
m_deviceUIs.back()->m_deviceSinkAPI->setSampleSink(sink); m_deviceUIs.back()->m_deviceSinkAPI->setSampleSink(sink);
QWidget *gui; QWidget *gui;
PluginInstanceGUI *pluginUI = m_deviceUIs.back()->m_deviceSinkAPI->getPluginInterface()->createSampleSinkPluginInstanceGUI( PluginInstanceGUI *pluginUI = m_deviceUIs.back()->m_deviceSinkAPI->getPluginInterface()->createSampleSinkPluginInstanceGUI(
m_deviceUIs.back()->m_deviceSinkAPI->getSampleSinkId(), &gui, m_deviceUIs.back()->m_deviceSinkAPI); m_deviceUIs.back()->m_deviceSinkAPI->getSampleSinkId(),
&gui,
m_deviceUIs.back()->m_deviceSinkAPI,
m_deviceUIs.back());
m_deviceUIs.back()->m_deviceSinkAPI->getSampleSink()->setMessageQueueToGUI(pluginUI->getInputMessageQueue()); m_deviceUIs.back()->m_deviceSinkAPI->getSampleSink()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
m_deviceUIs.back()->m_deviceSinkAPI->setSampleSinkPluginInstanceUI(pluginUI); m_deviceUIs.back()->m_deviceSinkAPI->setSampleSinkPluginInstanceUI(pluginUI);
setDeviceGUI(deviceTabIndex, gui, m_deviceUIs.back()->m_deviceSinkAPI->getSampleSinkDisplayName(), false); setDeviceGUI(deviceTabIndex, gui, m_deviceUIs.back()->m_deviceSinkAPI->getSampleSinkDisplayName(), false);
@ -986,7 +989,10 @@ void MainWindow::on_sampleSink_confirmClicked(bool checked __attribute__((unused
deviceUI->m_deviceSinkAPI->setSampleSink(sink); deviceUI->m_deviceSinkAPI->setSampleSink(sink);
QWidget *gui; QWidget *gui;
PluginInstanceGUI *pluginUI = deviceUI->m_deviceSinkAPI->getPluginInterface()->createSampleSinkPluginInstanceGUI( PluginInstanceGUI *pluginUI = deviceUI->m_deviceSinkAPI->getPluginInterface()->createSampleSinkPluginInstanceGUI(
deviceUI->m_deviceSinkAPI->getSampleSinkId(), &gui, deviceUI->m_deviceSinkAPI); deviceUI->m_deviceSinkAPI->getSampleSinkId(),
&gui,
deviceUI->m_deviceSinkAPI,
deviceUI);
deviceUI->m_deviceSinkAPI->getSampleSink()->setMessageQueueToGUI(pluginUI->getInputMessageQueue()); deviceUI->m_deviceSinkAPI->getSampleSink()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
deviceUI->m_deviceSinkAPI->setSampleSinkPluginInstanceUI(pluginUI); deviceUI->m_deviceSinkAPI->setSampleSinkPluginInstanceUI(pluginUI);
setDeviceGUI(currentSinkTabIndex, gui, deviceUI->m_deviceSinkAPI->getSampleSinkDisplayName(), false); setDeviceGUI(currentSinkTabIndex, gui, deviceUI->m_deviceSinkAPI->getSampleSinkDisplayName(), false);

View File

@ -53,12 +53,15 @@ public:
virtual void initPlugin(PluginAPI* pluginAPI) = 0; virtual void initPlugin(PluginAPI* pluginAPI) = 0;
// channel Rx plugins // channel Rx plugins
virtual PluginInstanceGUI* createRxChannel(const QString& channelName __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused)) ) { return 0; } virtual PluginInstanceGUI* createRxChannel(const QString& channelName __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused)) ) { return 0; }
// channel Tx plugins // channel Tx plugins
virtual PluginInstanceGUI* createTxChannel(const QString& channelName __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused)) ) { return 0; } virtual PluginInstanceGUI* createTxChannel(const QString& channelName __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused)) ) { return 0; }
// device source plugins only // device source plugins only
virtual SamplingDevices enumSampleSources() { return SamplingDevices(); } virtual SamplingDevices enumSampleSources() { return SamplingDevices(); }
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI( virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
@ -72,8 +75,16 @@ public:
virtual void deleteSampleSourcePluginInstanceInput(DeviceSampleSource *source); virtual void deleteSampleSourcePluginInstanceInput(DeviceSampleSource *source);
// device sink plugins only // device sink plugins only
virtual SamplingDevices enumSampleSinks() { return SamplingDevices(); } virtual SamplingDevices enumSampleSinks() { return SamplingDevices(); }
virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(const QString& sinkId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused))) { return 0; }
virtual PluginInstanceGUI* createSampleSinkPluginInstanceGUI(
const QString& sinkId __attribute__((unused)),
QWidget **widget __attribute__((unused)),
DeviceSinkAPI *deviceAPI __attribute__((unused)),
DeviceUISet *deviceUISet __attribute__((unused)))
{ return 0; }
virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused))) { return 0; } // creates the output "core" virtual DeviceSampleSink* createSampleSinkPluginInstanceOutput(const QString& sinkId __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused))) { return 0; } // creates the output "core"
virtual void deleteSampleSinkPluginInstanceGUI(PluginInstanceGUI *ui); virtual void deleteSampleSinkPluginInstanceGUI(PluginInstanceGUI *ui);
virtual void deleteSampleSinkPluginInstanceOutput(DeviceSampleSink *sink); virtual void deleteSampleSinkPluginInstanceOutput(DeviceSampleSink *sink);