1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-15 04:41:55 -05:00

Removed direct reference to the DeviceSourceAPI in the source GUIs

This commit is contained in:
f4exb 2017-10-30 00:45:23 +01:00
parent e520ef5aeb
commit da3e6dcdfb
46 changed files with 105 additions and 153 deletions

View File

@ -31,17 +31,16 @@
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
AirspyGui::AirspyGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
AirspyGui::AirspyGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::AirspyGui),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true),
m_settings(),
m_sampleSource(0),
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
{
m_sampleSource = (AirspyInput*) m_deviceAPI->getSampleSource();
m_sampleSource = (AirspyInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
ui->setupUi(this);
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
@ -343,15 +342,15 @@ void AirspyGui::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}
@ -389,7 +388,7 @@ void AirspyGui::updateHardware()
void AirspyGui::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -406,7 +405,7 @@ void AirspyGui::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;

View File

@ -38,7 +38,7 @@ class AirspyGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit AirspyGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit AirspyGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~AirspyGui();
virtual void destroy();
@ -58,7 +58,6 @@ public:
private:
Ui::AirspyGui* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings;
AirspySettings m_settings;

View File

@ -122,12 +122,11 @@ PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources()
PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if (sourceId == m_deviceTypeID)
{
AirspyGui* gui = new AirspyGui(deviceAPI, deviceUISet);
AirspyGui* gui = new AirspyGui(deviceUISet);
*widget = gui;
return gui;
}

View File

@ -39,7 +39,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -29,10 +29,9 @@
#include <device/devicesourceapi.h>
#include "device/deviceuiset.h"
BladerfInputGui::BladerfInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
BladerfInputGui::BladerfInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::BladerfInputGui),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true),
m_settings(),
@ -40,7 +39,7 @@ BladerfInputGui::BladerfInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *device
m_sampleRate(0),
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
{
m_sampleSource = (BladerfInput*) m_deviceAPI->getSampleSource();
m_sampleSource = (BladerfInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
ui->setupUi(this);
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
@ -335,15 +334,15 @@ void BladerfInputGui::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}
@ -371,7 +370,7 @@ void BladerfInputGui::updateHardware()
void BladerfInputGui::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -388,7 +387,7 @@ void BladerfInputGui::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;

View File

@ -36,7 +36,7 @@ class BladerfInputGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit BladerfInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit BladerfInputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~BladerfInputGui();
virtual void destroy();
@ -54,7 +54,6 @@ public:
private:
Ui::BladerfInputGui* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings;
BladeRFInputSettings m_settings;

View File

@ -81,12 +81,11 @@ PluginInterface::SamplingDevices BlderfInputPlugin::enumSampleSources()
PluginInstanceGUI* BlderfInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if(sourceId == m_deviceTypeID)
{
BladerfInputGui* gui = new BladerfInputGui(deviceAPI, deviceUISet);
BladerfInputGui* gui = new BladerfInputGui(deviceUISet);
*widget = gui;
return gui;
}

View File

@ -41,7 +41,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -28,17 +28,16 @@
#include "fcdproconst.h"
#include "fcdtraits.h"
FCDProGui::FCDProGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
FCDProGui::FCDProGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::FCDProGui),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true),
m_settings(),
m_sampleSource(NULL),
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
{
m_sampleSource = (FCDProInput*) m_deviceAPI->getSampleSource();
m_sampleSource = (FCDProInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
ui->setupUi(this);
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
@ -438,15 +437,15 @@ void FCDProGui::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}
@ -475,7 +474,7 @@ void FCDProGui::on_transverter_clicked()
void FCDProGui::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -492,7 +491,7 @@ void FCDProGui::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;

View File

@ -37,7 +37,7 @@ class FCDProGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit FCDProGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit FCDProGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~FCDProGui();
virtual void destroy();
@ -55,7 +55,6 @@ public:
private:
Ui::FCDProGui* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings;
FCDProSettings m_settings;

View File

@ -77,12 +77,11 @@ PluginInterface::SamplingDevices FCDProPlugin::enumSampleSources()
PluginInstanceGUI* FCDProPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if(sourceId == fcd_traits<Pro>::interfaceIID)
{
FCDProGui* gui = new FCDProGui(deviceAPI, deviceUISet);
FCDProGui* gui = new FCDProGui(deviceUISet);
*widget = gui;
return gui;
}

View File

@ -23,7 +23,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -29,17 +29,16 @@
#include "fcdproplusconst.h"
#include "fcdtraits.h"
FCDProPlusGui::FCDProPlusGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
FCDProPlusGui::FCDProPlusGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::FCDProPlusGui),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true),
m_settings(),
m_sampleSource(NULL),
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
{
m_sampleSource = (FCDProPlusInput*) m_deviceAPI->getSampleSource();
m_sampleSource = (FCDProPlusInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
ui->setupUi(this);
@ -228,7 +227,7 @@ void FCDProPlusGui::updateHardware()
void FCDProPlusGui::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -245,7 +244,7 @@ void FCDProPlusGui::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;
@ -303,15 +302,15 @@ void FCDProPlusGui::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}

View File

@ -36,7 +36,7 @@ class FCDProPlusGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit FCDProPlusGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit FCDProPlusGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~FCDProPlusGui();
virtual void destroy();
@ -54,7 +54,6 @@ public:
private:
Ui::FCDProPlusGui* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings;
FCDProPlusSettings m_settings;

View File

@ -79,12 +79,11 @@ PluginInterface::SamplingDevices FCDProPlusPlugin::enumSampleSources()
PluginInstanceGUI* FCDProPlusPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if(sourceId == fcd_traits<ProPlus>::interfaceIID)
{
FCDProPlusGui* gui = new FCDProPlusGui(deviceAPI, deviceUISet);
FCDProPlusGui* gui = new FCDProPlusGui(deviceUISet);
*widget = gui;
return gui;
}

View File

@ -23,7 +23,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -35,10 +35,9 @@
#include <device/devicesourceapi.h>
#include "device/deviceuiset.h"
FileSourceGui::FileSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
FileSourceGui::FileSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::FileSourceGui),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(),
m_sampleSource(NULL),
@ -58,7 +57,7 @@ FileSourceGui::FileSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISe
ui->centerFrequency->setValueRange(7, 0, pow(10,7));
ui->fileNameText->setText(m_fileName);
connect(&(m_deviceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
connect(&(m_deviceUISet->m_deviceSourceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
m_statusTimer.start(500);
@ -68,7 +67,7 @@ FileSourceGui::FileSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISe
ui->playLoop->setChecked(true); // FIXME: always play in a loop
ui->playLoop->setEnabled(false);
m_sampleSource = m_deviceAPI->getSampleSource();
m_sampleSource = m_deviceUISet->m_deviceSourceAPI->getSampleSource();
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
}
@ -210,22 +209,22 @@ void FileSourceGui::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}
void FileSourceGui::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -242,7 +241,7 @@ void FileSourceGui::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;

View File

@ -36,7 +36,7 @@ class FileSourceGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit FileSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit FileSourceGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~FileSourceGui();
virtual void destroy();
@ -54,7 +54,6 @@ public:
private:
Ui::FileSourceGui* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
FileSourceInput::Settings m_settings;
QTimer m_statusTimer;

View File

@ -72,12 +72,11 @@ PluginInterface::SamplingDevices FileSourcePlugin::enumSampleSources()
PluginInstanceGUI* FileSourcePlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if(sourceId == m_deviceTypeID)
{
FileSourceGui* gui = new FileSourceGui(deviceAPI, deviceUISet);
FileSourceGui* gui = new FileSourceGui(deviceUISet);
*widget = gui;
return gui;
}

View File

@ -39,7 +39,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -32,17 +32,16 @@
#include "ui_hackrfinputgui.h"
HackRFInputGui::HackRFInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
HackRFInputGui::HackRFInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::HackRFInputGui),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(),
m_forceSettings(true),
m_sampleSource(NULL),
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
{
m_sampleSource = (HackRFInput*) m_deviceAPI->getSampleSource();
m_sampleSource = (HackRFInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
ui->setupUi(this);
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
@ -332,21 +331,21 @@ void HackRFInputGui::on_startStop_toggled(bool checked)
if (checked)
{
// forcibly stop the Tx if present before starting
if (m_deviceAPI->getSinkBuddies().size() > 0)
if (m_deviceUISet->m_deviceSourceAPI->getSinkBuddies().size() > 0)
{
DeviceSinkAPI *buddy = m_deviceAPI->getSinkBuddies()[0];
DeviceSinkAPI *buddy = m_deviceUISet->m_deviceSourceAPI->getSinkBuddies()[0];
buddy->stopGeneration();
}
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}
@ -374,7 +373,7 @@ void HackRFInputGui::updateHardware()
void HackRFInputGui::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -392,7 +391,7 @@ void HackRFInputGui::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;

View File

@ -46,7 +46,7 @@ public:
HACKRF_IMGREJ_NB
} HackRFImgRejValue;
explicit HackRFInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit HackRFInputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~HackRFInputGui();
virtual void destroy();
@ -64,7 +64,6 @@ public:
private:
Ui::HackRFInputGui* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
HackRFInputSettings m_settings;
bool m_forceSettings;

View File

@ -120,12 +120,11 @@ PluginInterface::SamplingDevices HackRFInputPlugin::enumSampleSources()
PluginInstanceGUI* HackRFInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if(sourceId == m_deviceTypeID)
{
HackRFInputGui* gui = new HackRFInputGui(deviceAPI, deviceUISet);
HackRFInputGui* gui = new HackRFInputGui(deviceUISet);
*widget = gui;
return gui;
}

View File

@ -39,7 +39,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -29,10 +29,9 @@
#include "device/devicesourceapi.h"
#include "device/deviceuiset.h"
LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
LimeSDRInputGUI::LimeSDRInputGUI(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::LimeSDRInputGUI),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(),
m_sampleRate(0),
@ -42,7 +41,7 @@ LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, DeviceUISet *device
m_statusCounter(0),
m_deviceStatusCounter(0)
{
m_limeSDRInput = (LimeSDRInput*) m_deviceAPI->getSampleSource();
m_limeSDRInput = (LimeSDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
ui->setupUi(this);
@ -331,7 +330,7 @@ void LimeSDRInputGUI::updateHardware()
void LimeSDRInputGUI::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -348,7 +347,7 @@ void LimeSDRInputGUI::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;
@ -374,7 +373,7 @@ void LimeSDRInputGUI::updateStatus()
}
else
{
if (m_deviceAPI->isBuddyLeader())
if (m_deviceUISet->m_deviceSourceAPI->isBuddyLeader())
{
LimeSDRInput::MsgGetDeviceInfo* message = LimeSDRInput::MsgGetDeviceInfo::create();
m_limeSDRInput->getInputMessageQueue()->push(message);
@ -393,15 +392,15 @@ void LimeSDRInputGUI::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}

View File

@ -36,7 +36,7 @@ class LimeSDRInputGUI : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit LimeSDRInputGUI(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~LimeSDRInputGUI();
virtual void destroy();
@ -54,7 +54,6 @@ public:
private:
Ui::LimeSDRInputGUI* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
LimeSDRInput* m_limeSDRInput; //!< Same object as above but gives easy access to LimeSDRInput methods and attributes that are used intensively
LimeSDRInputSettings m_settings;

View File

@ -100,12 +100,11 @@ PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources()
PluginInstanceGUI* LimeSDRInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if(sourceId == m_deviceTypeID)
{
LimeSDRInputGUI* gui = new LimeSDRInputGUI(deviceAPI, deviceUISet);
LimeSDRInputGUI* gui = new LimeSDRInputGUI(deviceUISet);
*widget = gui;
return gui;
}

View File

@ -39,7 +39,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -28,10 +28,9 @@
#include "ui_plutosdrinputgui.h"
#include "plutosdrinputgui.h"
PlutoSDRInputGui::PlutoSDRInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
PlutoSDRInputGui::PlutoSDRInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::PlutoSDRInputGUI),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(),
m_forceSettings(true),
@ -42,7 +41,7 @@ PlutoSDRInputGui::PlutoSDRInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *devi
m_doApplySettings(true),
m_statusCounter(0)
{
m_sampleSource = (PlutoSDRInput*) m_deviceAPI->getSampleSource();
m_sampleSource = (PlutoSDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
ui->setupUi(this);
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
@ -156,15 +155,15 @@ void PlutoSDRInputGui::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}
@ -346,7 +345,7 @@ void PlutoSDRInputGui::blockApplySettings(bool block)
void PlutoSDRInputGui::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -363,7 +362,7 @@ void PlutoSDRInputGui::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;
@ -395,7 +394,7 @@ void PlutoSDRInputGui::updateStatus()
if (m_statusCounter % 10 == 0) // 5s
{
if (m_deviceAPI->isBuddyLeader()) {
if (m_deviceUISet->m_deviceSourceAPI->isBuddyLeader()) {
((PlutoSDRInput *) m_sampleSource)->fetchTemperature();
}

View File

@ -38,7 +38,7 @@ class PlutoSDRInputGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit PlutoSDRInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit PlutoSDRInputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~PlutoSDRInputGui();
virtual void destroy();
@ -54,7 +54,6 @@ public:
private:
Ui::PlutoSDRInputGUI* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
PlutoSDRInputSettings m_settings;
bool m_forceSettings;

View File

@ -84,12 +84,11 @@ PluginInterface::SamplingDevices PlutoSDRInputPlugin::enumSampleSources()
PluginInstanceGUI* PlutoSDRInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if(sourceId == m_deviceTypeID)
{
PlutoSDRInputGui* gui = new PlutoSDRInputGui(deviceAPI, deviceUISet);
PlutoSDRInputGui* gui = new PlutoSDRInputGui(deviceUISet);
*widget = gui;
return gui;
}

View File

@ -39,7 +39,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -30,17 +30,16 @@
#include "dsp/dspcommands.h"
RTLSDRGui::RTLSDRGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
RTLSDRGui::RTLSDRGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::RTLSDRGui),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true),
m_settings(),
m_sampleSource(0),
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
{
m_sampleSource = (RTLSDRInput*) m_deviceAPI->getSampleSource();
m_sampleSource = (RTLSDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
ui->setupUi(this);
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
@ -312,15 +311,15 @@ void RTLSDRGui::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}
@ -357,7 +356,7 @@ void RTLSDRGui::updateHardware()
void RTLSDRGui::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -374,7 +373,7 @@ void RTLSDRGui::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;

View File

@ -37,7 +37,7 @@ class RTLSDRGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit RTLSDRGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit RTLSDRGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~RTLSDRGui();
virtual void destroy();
@ -55,7 +55,6 @@ public:
private:
Ui::RTLSDRGui* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings;
RTLSDRSettings m_settings;

View File

@ -65,11 +65,10 @@ PluginInterface::SamplingDevices RTLSDRPlugin::enumSampleSources()
PluginInstanceGUI* RTLSDRPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if(sourceId == m_deviceTypeID) {
RTLSDRGui* gui = new RTLSDRGui(deviceAPI, deviceUISet);
RTLSDRGui* gui = new RTLSDRGui(deviceUISet);
*widget = gui;
return gui;
} else {

View File

@ -23,7 +23,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -46,10 +46,9 @@
#include "device/deviceuiset.h"
#include "sdrdaemonsourcegui.h"
SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::SDRdaemonSourceGui),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_sampleSource(NULL),
m_acquisition(false),
@ -101,10 +100,10 @@ SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
m_statusTimer.start(500);
connect(&(deviceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
connect(&(m_deviceUISet->m_deviceSourceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
m_sampleSource = (SDRdaemonSourceInput*) m_deviceAPI->getSampleSource();
m_sampleSource = (SDRdaemonSourceInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
displaySettings();
@ -594,15 +593,15 @@ void SDRdaemonSourceGui::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}
@ -733,7 +732,7 @@ void SDRdaemonSourceGui::updateHardware()
void SDRdaemonSourceGui::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -750,7 +749,7 @@ void SDRdaemonSourceGui::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;

View File

@ -37,7 +37,7 @@ class SDRdaemonSourceGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit SDRdaemonSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit SDRdaemonSourceGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~SDRdaemonSourceGui();
virtual void destroy();
@ -55,7 +55,6 @@ public:
private:
Ui::SDRdaemonSourceGui* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
SDRdaemonSourceSettings m_settings; //!< current settings
SDRdaemonSourceSettings m_controlSettings; //!< settings last sent to device via control port

View File

@ -73,12 +73,11 @@ PluginInterface::SamplingDevices SDRdaemonSourcePlugin::enumSampleSources()
PluginInstanceGUI* SDRdaemonSourcePlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if(sourceId == m_deviceTypeID)
{
SDRdaemonSourceGui* gui = new SDRdaemonSourceGui(deviceAPI, deviceUISet);
SDRdaemonSourceGui* gui = new SDRdaemonSourceGui(deviceUISet);
*widget = gui;
return gui;
}

View File

@ -39,7 +39,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -29,14 +29,13 @@
#include "dsp/dspcommands.h"
SDRPlayGui::SDRPlayGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
SDRPlayGui::SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent),
ui(new Ui::SDRPlayGui),
m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true)
{
m_sampleSource = (SDRPlayInput*) m_deviceAPI->getSampleSource();
m_sampleSource = (SDRPlayInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
ui->setupUi(this);
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
@ -277,7 +276,7 @@ void SDRPlayGui::updateHardware()
void SDRPlayGui::updateStatus()
{
int state = m_deviceAPI->state();
int state = m_deviceUISet->m_deviceSourceAPI->state();
if(m_lastEngineState != state)
{
@ -294,7 +293,7 @@ void SDRPlayGui::updateStatus()
break;
case DSPDeviceSourceEngine::StError:
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
break;
default:
break;
@ -436,15 +435,15 @@ void SDRPlayGui::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceAPI->stopAcquisition();
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
}
}

View File

@ -39,7 +39,7 @@ class SDRPlayGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT
public:
explicit SDRPlayGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
explicit SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~SDRPlayGui();
virtual void destroy();
@ -57,7 +57,6 @@ public:
private:
Ui::SDRPlayGui* ui;
DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings;
SDRPlaySettings m_settings;

View File

@ -86,12 +86,11 @@ PluginInterface::SamplingDevices SDRPlayPlugin::enumSampleSources()
PluginInstanceGUI* SDRPlayPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{
if(sourceId == m_deviceTypeID)
{
SDRPlayGui* gui = new SDRPlayGui(deviceAPI, deviceUISet);
SDRPlayGui* gui = new SDRPlayGui(deviceUISet);
*widget = gui;
return gui;
}

View File

@ -39,7 +39,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);

View File

@ -154,7 +154,6 @@ MainWindow::MainWindow(QWidget* parent) :
PluginInstanceGUI *pluginGUI = m_deviceUIs.back()->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceId(),
&gui,
m_deviceUIs.back()->m_deviceSourceAPI,
m_deviceUIs.back());
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginGUI->getInputMessageQueue());
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginGUI);
@ -241,7 +240,6 @@ void MainWindow::addSourceDevice()
PluginInstanceGUI *pluginGUI = m_deviceUIs.back()->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceId(),
&gui,
m_deviceUIs.back()->m_deviceSourceAPI,
m_deviceUIs.back());
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginGUI->getInputMessageQueue());
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginGUI);
@ -909,7 +907,6 @@ void MainWindow::on_sampleSource_confirmClicked(bool checked __attribute__((unus
PluginInstanceGUI *pluginUI = deviceUI->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
deviceUI->m_deviceSourceAPI->getSampleSourceId(),
&gui,
deviceUI->m_deviceSourceAPI,
deviceUI);
deviceUI->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginUI);

View File

@ -64,7 +64,6 @@ public:
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId __attribute__((unused)),
QWidget **widget __attribute__((unused)),
DeviceSourceAPI *deviceAPI __attribute__((unused)),
DeviceUISet *deviceUISet __attribute__((unused)))
{ return 0; }