mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 12:51:49 -05:00
Removed direct reference to the DeviceSourceAPI in the source GUIs
This commit is contained in:
parent
e520ef5aeb
commit
da3e6dcdfb
@ -31,17 +31,16 @@
|
|||||||
#include "dsp/dspengine.h"
|
#include "dsp/dspengine.h"
|
||||||
#include "dsp/dspcommands.h"
|
#include "dsp/dspcommands.h"
|
||||||
|
|
||||||
AirspyGui::AirspyGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
AirspyGui::AirspyGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::AirspyGui),
|
ui(new Ui::AirspyGui),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_forceSettings(true),
|
m_forceSettings(true),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
m_sampleSource(0),
|
m_sampleSource(0),
|
||||||
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
||||||
{
|
{
|
||||||
m_sampleSource = (AirspyInput*) m_deviceAPI->getSampleSource();
|
m_sampleSource = (AirspyInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||||
@ -343,15 +342,15 @@ void AirspyGui::on_startStop_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -389,7 +388,7 @@ void AirspyGui::updateHardware()
|
|||||||
|
|
||||||
void AirspyGui::updateStatus()
|
void AirspyGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -406,7 +405,7 @@ void AirspyGui::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -38,7 +38,7 @@ class AirspyGui : public QWidget, public PluginInstanceGUI {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AirspyGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit AirspyGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~AirspyGui();
|
virtual ~AirspyGui();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
@ -58,7 +58,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::AirspyGui* ui;
|
Ui::AirspyGui* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
bool m_forceSettings;
|
bool m_forceSettings;
|
||||||
AirspySettings m_settings;
|
AirspySettings m_settings;
|
||||||
|
@ -122,12 +122,11 @@ PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if (sourceId == m_deviceTypeID)
|
if (sourceId == m_deviceTypeID)
|
||||||
{
|
{
|
||||||
AirspyGui* gui = new AirspyGui(deviceAPI, deviceUISet);
|
AirspyGui* gui = new AirspyGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -29,10 +29,9 @@
|
|||||||
#include <device/devicesourceapi.h>
|
#include <device/devicesourceapi.h>
|
||||||
#include "device/deviceuiset.h"
|
#include "device/deviceuiset.h"
|
||||||
|
|
||||||
BladerfInputGui::BladerfInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
BladerfInputGui::BladerfInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::BladerfInputGui),
|
ui(new Ui::BladerfInputGui),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_forceSettings(true),
|
m_forceSettings(true),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
@ -40,7 +39,7 @@ BladerfInputGui::BladerfInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *device
|
|||||||
m_sampleRate(0),
|
m_sampleRate(0),
|
||||||
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
||||||
{
|
{
|
||||||
m_sampleSource = (BladerfInput*) m_deviceAPI->getSampleSource();
|
m_sampleSource = (BladerfInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||||
@ -335,15 +334,15 @@ void BladerfInputGui::on_startStop_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -371,7 +370,7 @@ void BladerfInputGui::updateHardware()
|
|||||||
|
|
||||||
void BladerfInputGui::updateStatus()
|
void BladerfInputGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -388,7 +387,7 @@ void BladerfInputGui::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -36,7 +36,7 @@ class BladerfInputGui : public QWidget, public PluginInstanceGUI {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BladerfInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit BladerfInputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~BladerfInputGui();
|
virtual ~BladerfInputGui();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
@ -54,7 +54,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::BladerfInputGui* ui;
|
Ui::BladerfInputGui* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
bool m_forceSettings;
|
bool m_forceSettings;
|
||||||
BladeRFInputSettings m_settings;
|
BladeRFInputSettings m_settings;
|
||||||
|
@ -81,12 +81,11 @@ PluginInterface::SamplingDevices BlderfInputPlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* BlderfInputPlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* BlderfInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == m_deviceTypeID)
|
if(sourceId == m_deviceTypeID)
|
||||||
{
|
{
|
||||||
BladerfInputGui* gui = new BladerfInputGui(deviceAPI, deviceUISet);
|
BladerfInputGui* gui = new BladerfInputGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -28,17 +28,16 @@
|
|||||||
#include "fcdproconst.h"
|
#include "fcdproconst.h"
|
||||||
#include "fcdtraits.h"
|
#include "fcdtraits.h"
|
||||||
|
|
||||||
FCDProGui::FCDProGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
FCDProGui::FCDProGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::FCDProGui),
|
ui(new Ui::FCDProGui),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_forceSettings(true),
|
m_forceSettings(true),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
m_sampleSource(NULL),
|
m_sampleSource(NULL),
|
||||||
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
||||||
{
|
{
|
||||||
m_sampleSource = (FCDProInput*) m_deviceAPI->getSampleSource();
|
m_sampleSource = (FCDProInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||||
@ -438,15 +437,15 @@ void FCDProGui::on_startStop_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -475,7 +474,7 @@ void FCDProGui::on_transverter_clicked()
|
|||||||
|
|
||||||
void FCDProGui::updateStatus()
|
void FCDProGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -492,7 +491,7 @@ void FCDProGui::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -37,7 +37,7 @@ class FCDProGui : public QWidget, public PluginInstanceGUI {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FCDProGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit FCDProGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~FCDProGui();
|
virtual ~FCDProGui();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
@ -55,7 +55,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::FCDProGui* ui;
|
Ui::FCDProGui* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
bool m_forceSettings;
|
bool m_forceSettings;
|
||||||
FCDProSettings m_settings;
|
FCDProSettings m_settings;
|
||||||
|
@ -77,12 +77,11 @@ PluginInterface::SamplingDevices FCDProPlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* FCDProPlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* FCDProPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == fcd_traits<Pro>::interfaceIID)
|
if(sourceId == fcd_traits<Pro>::interfaceIID)
|
||||||
{
|
{
|
||||||
FCDProGui* gui = new FCDProGui(deviceAPI, deviceUISet);
|
FCDProGui* gui = new FCDProGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -29,17 +29,16 @@
|
|||||||
#include "fcdproplusconst.h"
|
#include "fcdproplusconst.h"
|
||||||
#include "fcdtraits.h"
|
#include "fcdtraits.h"
|
||||||
|
|
||||||
FCDProPlusGui::FCDProPlusGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
FCDProPlusGui::FCDProPlusGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::FCDProPlusGui),
|
ui(new Ui::FCDProPlusGui),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_forceSettings(true),
|
m_forceSettings(true),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
m_sampleSource(NULL),
|
m_sampleSource(NULL),
|
||||||
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
||||||
{
|
{
|
||||||
m_sampleSource = (FCDProPlusInput*) m_deviceAPI->getSampleSource();
|
m_sampleSource = (FCDProPlusInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
@ -228,7 +227,7 @@ void FCDProPlusGui::updateHardware()
|
|||||||
|
|
||||||
void FCDProPlusGui::updateStatus()
|
void FCDProPlusGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -245,7 +244,7 @@ void FCDProPlusGui::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -303,15 +302,15 @@ void FCDProPlusGui::on_startStop_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class FCDProPlusGui : public QWidget, public PluginInstanceGUI {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FCDProPlusGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit FCDProPlusGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~FCDProPlusGui();
|
virtual ~FCDProPlusGui();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
@ -54,7 +54,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::FCDProPlusGui* ui;
|
Ui::FCDProPlusGui* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
bool m_forceSettings;
|
bool m_forceSettings;
|
||||||
FCDProPlusSettings m_settings;
|
FCDProPlusSettings m_settings;
|
||||||
|
@ -79,12 +79,11 @@ PluginInterface::SamplingDevices FCDProPlusPlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* FCDProPlusPlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* FCDProPlusPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == fcd_traits<ProPlus>::interfaceIID)
|
if(sourceId == fcd_traits<ProPlus>::interfaceIID)
|
||||||
{
|
{
|
||||||
FCDProPlusGui* gui = new FCDProPlusGui(deviceAPI, deviceUISet);
|
FCDProPlusGui* gui = new FCDProPlusGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -35,10 +35,9 @@
|
|||||||
#include <device/devicesourceapi.h>
|
#include <device/devicesourceapi.h>
|
||||||
#include "device/deviceuiset.h"
|
#include "device/deviceuiset.h"
|
||||||
|
|
||||||
FileSourceGui::FileSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
FileSourceGui::FileSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::FileSourceGui),
|
ui(new Ui::FileSourceGui),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
m_sampleSource(NULL),
|
m_sampleSource(NULL),
|
||||||
@ -58,7 +57,7 @@ FileSourceGui::FileSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISe
|
|||||||
ui->centerFrequency->setValueRange(7, 0, pow(10,7));
|
ui->centerFrequency->setValueRange(7, 0, pow(10,7));
|
||||||
ui->fileNameText->setText(m_fileName);
|
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()));
|
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||||
m_statusTimer.start(500);
|
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->setChecked(true); // FIXME: always play in a loop
|
||||||
ui->playLoop->setEnabled(false);
|
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);
|
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
@ -210,22 +209,22 @@ void FileSourceGui::on_startStop_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileSourceGui::updateStatus()
|
void FileSourceGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -242,7 +241,7 @@ void FileSourceGui::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -36,7 +36,7 @@ class FileSourceGui : public QWidget, public PluginInstanceGUI {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FileSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit FileSourceGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~FileSourceGui();
|
virtual ~FileSourceGui();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
@ -54,7 +54,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::FileSourceGui* ui;
|
Ui::FileSourceGui* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
FileSourceInput::Settings m_settings;
|
FileSourceInput::Settings m_settings;
|
||||||
QTimer m_statusTimer;
|
QTimer m_statusTimer;
|
||||||
|
@ -72,12 +72,11 @@ PluginInterface::SamplingDevices FileSourcePlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* FileSourcePlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* FileSourcePlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == m_deviceTypeID)
|
if(sourceId == m_deviceTypeID)
|
||||||
{
|
{
|
||||||
FileSourceGui* gui = new FileSourceGui(deviceAPI, deviceUISet);
|
FileSourceGui* gui = new FileSourceGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -32,17 +32,16 @@
|
|||||||
|
|
||||||
#include "ui_hackrfinputgui.h"
|
#include "ui_hackrfinputgui.h"
|
||||||
|
|
||||||
HackRFInputGui::HackRFInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
HackRFInputGui::HackRFInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::HackRFInputGui),
|
ui(new Ui::HackRFInputGui),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
m_forceSettings(true),
|
m_forceSettings(true),
|
||||||
m_sampleSource(NULL),
|
m_sampleSource(NULL),
|
||||||
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
||||||
{
|
{
|
||||||
m_sampleSource = (HackRFInput*) m_deviceAPI->getSampleSource();
|
m_sampleSource = (HackRFInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||||
@ -332,21 +331,21 @@ void HackRFInputGui::on_startStop_toggled(bool checked)
|
|||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
// forcibly stop the Tx if present before starting
|
// 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();
|
buddy->stopGeneration();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -374,7 +373,7 @@ void HackRFInputGui::updateHardware()
|
|||||||
|
|
||||||
void HackRFInputGui::updateStatus()
|
void HackRFInputGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -392,7 +391,7 @@ void HackRFInputGui::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
HACKRF_IMGREJ_NB
|
HACKRF_IMGREJ_NB
|
||||||
} HackRFImgRejValue;
|
} HackRFImgRejValue;
|
||||||
|
|
||||||
explicit HackRFInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit HackRFInputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~HackRFInputGui();
|
virtual ~HackRFInputGui();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
@ -64,7 +64,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::HackRFInputGui* ui;
|
Ui::HackRFInputGui* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
HackRFInputSettings m_settings;
|
HackRFInputSettings m_settings;
|
||||||
bool m_forceSettings;
|
bool m_forceSettings;
|
||||||
|
@ -120,12 +120,11 @@ PluginInterface::SamplingDevices HackRFInputPlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* HackRFInputPlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* HackRFInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == m_deviceTypeID)
|
if(sourceId == m_deviceTypeID)
|
||||||
{
|
{
|
||||||
HackRFInputGui* gui = new HackRFInputGui(deviceAPI, deviceUISet);
|
HackRFInputGui* gui = new HackRFInputGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -29,10 +29,9 @@
|
|||||||
#include "device/devicesourceapi.h"
|
#include "device/devicesourceapi.h"
|
||||||
#include "device/deviceuiset.h"
|
#include "device/deviceuiset.h"
|
||||||
|
|
||||||
LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
LimeSDRInputGUI::LimeSDRInputGUI(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::LimeSDRInputGUI),
|
ui(new Ui::LimeSDRInputGUI),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
m_sampleRate(0),
|
m_sampleRate(0),
|
||||||
@ -42,7 +41,7 @@ LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, DeviceUISet *device
|
|||||||
m_statusCounter(0),
|
m_statusCounter(0),
|
||||||
m_deviceStatusCounter(0)
|
m_deviceStatusCounter(0)
|
||||||
{
|
{
|
||||||
m_limeSDRInput = (LimeSDRInput*) m_deviceAPI->getSampleSource();
|
m_limeSDRInput = (LimeSDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
@ -331,7 +330,7 @@ void LimeSDRInputGUI::updateHardware()
|
|||||||
|
|
||||||
void LimeSDRInputGUI::updateStatus()
|
void LimeSDRInputGUI::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -348,7 +347,7 @@ void LimeSDRInputGUI::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -374,7 +373,7 @@ void LimeSDRInputGUI::updateStatus()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->isBuddyLeader())
|
if (m_deviceUISet->m_deviceSourceAPI->isBuddyLeader())
|
||||||
{
|
{
|
||||||
LimeSDRInput::MsgGetDeviceInfo* message = LimeSDRInput::MsgGetDeviceInfo::create();
|
LimeSDRInput::MsgGetDeviceInfo* message = LimeSDRInput::MsgGetDeviceInfo::create();
|
||||||
m_limeSDRInput->getInputMessageQueue()->push(message);
|
m_limeSDRInput->getInputMessageQueue()->push(message);
|
||||||
@ -393,15 +392,15 @@ void LimeSDRInputGUI::on_startStop_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class LimeSDRInputGUI : public QWidget, public PluginInstanceGUI {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit LimeSDRInputGUI(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~LimeSDRInputGUI();
|
virtual ~LimeSDRInputGUI();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
@ -54,7 +54,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::LimeSDRInputGUI* ui;
|
Ui::LimeSDRInputGUI* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
LimeSDRInput* m_limeSDRInput; //!< Same object as above but gives easy access to LimeSDRInput methods and attributes that are used intensively
|
LimeSDRInput* m_limeSDRInput; //!< Same object as above but gives easy access to LimeSDRInput methods and attributes that are used intensively
|
||||||
LimeSDRInputSettings m_settings;
|
LimeSDRInputSettings m_settings;
|
||||||
|
@ -100,12 +100,11 @@ PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* LimeSDRInputPlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* LimeSDRInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == m_deviceTypeID)
|
if(sourceId == m_deviceTypeID)
|
||||||
{
|
{
|
||||||
LimeSDRInputGUI* gui = new LimeSDRInputGUI(deviceAPI, deviceUISet);
|
LimeSDRInputGUI* gui = new LimeSDRInputGUI(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -28,10 +28,9 @@
|
|||||||
#include "ui_plutosdrinputgui.h"
|
#include "ui_plutosdrinputgui.h"
|
||||||
#include "plutosdrinputgui.h"
|
#include "plutosdrinputgui.h"
|
||||||
|
|
||||||
PlutoSDRInputGui::PlutoSDRInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
PlutoSDRInputGui::PlutoSDRInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::PlutoSDRInputGUI),
|
ui(new Ui::PlutoSDRInputGUI),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
m_forceSettings(true),
|
m_forceSettings(true),
|
||||||
@ -42,7 +41,7 @@ PlutoSDRInputGui::PlutoSDRInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *devi
|
|||||||
m_doApplySettings(true),
|
m_doApplySettings(true),
|
||||||
m_statusCounter(0)
|
m_statusCounter(0)
|
||||||
{
|
{
|
||||||
m_sampleSource = (PlutoSDRInput*) m_deviceAPI->getSampleSource();
|
m_sampleSource = (PlutoSDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||||
@ -156,15 +155,15 @@ void PlutoSDRInputGui::on_startStop_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -346,7 +345,7 @@ void PlutoSDRInputGui::blockApplySettings(bool block)
|
|||||||
|
|
||||||
void PlutoSDRInputGui::updateStatus()
|
void PlutoSDRInputGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -363,7 +362,7 @@ void PlutoSDRInputGui::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -395,7 +394,7 @@ void PlutoSDRInputGui::updateStatus()
|
|||||||
|
|
||||||
if (m_statusCounter % 10 == 0) // 5s
|
if (m_statusCounter % 10 == 0) // 5s
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->isBuddyLeader()) {
|
if (m_deviceUISet->m_deviceSourceAPI->isBuddyLeader()) {
|
||||||
((PlutoSDRInput *) m_sampleSource)->fetchTemperature();
|
((PlutoSDRInput *) m_sampleSource)->fetchTemperature();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class PlutoSDRInputGui : public QWidget, public PluginInstanceGUI {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PlutoSDRInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit PlutoSDRInputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~PlutoSDRInputGui();
|
virtual ~PlutoSDRInputGui();
|
||||||
|
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
@ -54,7 +54,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::PlutoSDRInputGUI* ui;
|
Ui::PlutoSDRInputGUI* ui;
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
PlutoSDRInputSettings m_settings;
|
PlutoSDRInputSettings m_settings;
|
||||||
bool m_forceSettings;
|
bool m_forceSettings;
|
||||||
|
@ -84,12 +84,11 @@ PluginInterface::SamplingDevices PlutoSDRInputPlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* PlutoSDRInputPlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* PlutoSDRInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == m_deviceTypeID)
|
if(sourceId == m_deviceTypeID)
|
||||||
{
|
{
|
||||||
PlutoSDRInputGui* gui = new PlutoSDRInputGui(deviceAPI, deviceUISet);
|
PlutoSDRInputGui* gui = new PlutoSDRInputGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -30,17 +30,16 @@
|
|||||||
#include "dsp/dspcommands.h"
|
#include "dsp/dspcommands.h"
|
||||||
|
|
||||||
|
|
||||||
RTLSDRGui::RTLSDRGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
RTLSDRGui::RTLSDRGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::RTLSDRGui),
|
ui(new Ui::RTLSDRGui),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_forceSettings(true),
|
m_forceSettings(true),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
m_sampleSource(0),
|
m_sampleSource(0),
|
||||||
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
m_lastEngineState((DSPDeviceSourceEngine::State)-1)
|
||||||
{
|
{
|
||||||
m_sampleSource = (RTLSDRInput*) m_deviceAPI->getSampleSource();
|
m_sampleSource = (RTLSDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||||
@ -312,15 +311,15 @@ void RTLSDRGui::on_startStop_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -357,7 +356,7 @@ void RTLSDRGui::updateHardware()
|
|||||||
|
|
||||||
void RTLSDRGui::updateStatus()
|
void RTLSDRGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -374,7 +373,7 @@ void RTLSDRGui::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -37,7 +37,7 @@ class RTLSDRGui : public QWidget, public PluginInstanceGUI {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RTLSDRGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit RTLSDRGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~RTLSDRGui();
|
virtual ~RTLSDRGui();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
@ -55,7 +55,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::RTLSDRGui* ui;
|
Ui::RTLSDRGui* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
bool m_forceSettings;
|
bool m_forceSettings;
|
||||||
RTLSDRSettings m_settings;
|
RTLSDRSettings m_settings;
|
||||||
|
@ -65,11 +65,10 @@ PluginInterface::SamplingDevices RTLSDRPlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* RTLSDRPlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* RTLSDRPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == m_deviceTypeID) {
|
if(sourceId == m_deviceTypeID) {
|
||||||
RTLSDRGui* gui = new RTLSDRGui(deviceAPI, deviceUISet);
|
RTLSDRGui* gui = new RTLSDRGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
} else {
|
} else {
|
||||||
|
@ -23,7 +23,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -46,10 +46,9 @@
|
|||||||
#include "device/deviceuiset.h"
|
#include "device/deviceuiset.h"
|
||||||
#include "sdrdaemonsourcegui.h"
|
#include "sdrdaemonsourcegui.h"
|
||||||
|
|
||||||
SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::SDRdaemonSourceGui),
|
ui(new Ui::SDRdaemonSourceGui),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_sampleSource(NULL),
|
m_sampleSource(NULL),
|
||||||
m_acquisition(false),
|
m_acquisition(false),
|
||||||
@ -101,10 +100,10 @@ SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *
|
|||||||
|
|
||||||
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||||
m_statusTimer.start(500);
|
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()));
|
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
||||||
|
|
||||||
m_sampleSource = (SDRdaemonSourceInput*) m_deviceAPI->getSampleSource();
|
m_sampleSource = (SDRdaemonSourceInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||||
|
|
||||||
displaySettings();
|
displaySettings();
|
||||||
|
|
||||||
@ -594,15 +593,15 @@ void SDRdaemonSourceGui::on_startStop_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -733,7 +732,7 @@ void SDRdaemonSourceGui::updateHardware()
|
|||||||
|
|
||||||
void SDRdaemonSourceGui::updateStatus()
|
void SDRdaemonSourceGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -750,7 +749,7 @@ void SDRdaemonSourceGui::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -37,7 +37,7 @@ class SDRdaemonSourceGui : public QWidget, public PluginInstanceGUI {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SDRdaemonSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit SDRdaemonSourceGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~SDRdaemonSourceGui();
|
virtual ~SDRdaemonSourceGui();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
@ -55,7 +55,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::SDRdaemonSourceGui* ui;
|
Ui::SDRdaemonSourceGui* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
SDRdaemonSourceSettings m_settings; //!< current settings
|
SDRdaemonSourceSettings m_settings; //!< current settings
|
||||||
SDRdaemonSourceSettings m_controlSettings; //!< settings last sent to device via control port
|
SDRdaemonSourceSettings m_controlSettings; //!< settings last sent to device via control port
|
||||||
|
@ -73,12 +73,11 @@ PluginInterface::SamplingDevices SDRdaemonSourcePlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* SDRdaemonSourcePlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* SDRdaemonSourcePlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == m_deviceTypeID)
|
if(sourceId == m_deviceTypeID)
|
||||||
{
|
{
|
||||||
SDRdaemonSourceGui* gui = new SDRdaemonSourceGui(deviceAPI, deviceUISet);
|
SDRdaemonSourceGui* gui = new SDRdaemonSourceGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -29,14 +29,13 @@
|
|||||||
#include "dsp/dspcommands.h"
|
#include "dsp/dspcommands.h"
|
||||||
|
|
||||||
|
|
||||||
SDRPlayGui::SDRPlayGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
|
SDRPlayGui::SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::SDRPlayGui),
|
ui(new Ui::SDRPlayGui),
|
||||||
m_deviceAPI(deviceAPI),
|
|
||||||
m_deviceUISet(deviceUISet),
|
m_deviceUISet(deviceUISet),
|
||||||
m_forceSettings(true)
|
m_forceSettings(true)
|
||||||
{
|
{
|
||||||
m_sampleSource = (SDRPlayInput*) m_deviceAPI->getSampleSource();
|
m_sampleSource = (SDRPlayInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||||
@ -277,7 +276,7 @@ void SDRPlayGui::updateHardware()
|
|||||||
|
|
||||||
void SDRPlayGui::updateStatus()
|
void SDRPlayGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceAPI->state();
|
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||||
|
|
||||||
if(m_lastEngineState != state)
|
if(m_lastEngineState != state)
|
||||||
{
|
{
|
||||||
@ -294,7 +293,7 @@ void SDRPlayGui::updateStatus()
|
|||||||
break;
|
break;
|
||||||
case DSPDeviceSourceEngine::StError:
|
case DSPDeviceSourceEngine::StError:
|
||||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -436,15 +435,15 @@ void SDRPlayGui::on_startStop_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
if (m_deviceAPI->initAcquisition())
|
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
|
||||||
{
|
{
|
||||||
m_deviceAPI->startAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
|
||||||
DSPEngine::instance()->startAudioOutput();
|
DSPEngine::instance()->startAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_deviceAPI->stopAcquisition();
|
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
|
||||||
DSPEngine::instance()->stopAudioOutput();
|
DSPEngine::instance()->stopAudioOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ class SDRPlayGui : public QWidget, public PluginInstanceGUI {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SDRPlayGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~SDRPlayGui();
|
virtual ~SDRPlayGui();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
@ -57,7 +57,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::SDRPlayGui* ui;
|
Ui::SDRPlayGui* ui;
|
||||||
|
|
||||||
DeviceSourceAPI* m_deviceAPI;
|
|
||||||
DeviceUISet* m_deviceUISet;
|
DeviceUISet* m_deviceUISet;
|
||||||
bool m_forceSettings;
|
bool m_forceSettings;
|
||||||
SDRPlaySettings m_settings;
|
SDRPlaySettings m_settings;
|
||||||
|
@ -86,12 +86,11 @@ PluginInterface::SamplingDevices SDRPlayPlugin::enumSampleSources()
|
|||||||
PluginInstanceGUI* SDRPlayPlugin::createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI* SDRPlayPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == m_deviceTypeID)
|
if(sourceId == m_deviceTypeID)
|
||||||
{
|
{
|
||||||
SDRPlayGui* gui = new SDRPlayGui(deviceAPI, deviceUISet);
|
SDRPlayGui* gui = new SDRPlayGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceSourceAPI *deviceAPI,
|
|
||||||
DeviceUISet *deviceUISet);
|
DeviceUISet *deviceUISet);
|
||||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -154,7 +154,6 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
PluginInstanceGUI *pluginGUI = m_deviceUIs.back()->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI *pluginGUI = m_deviceUIs.back()->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
|
||||||
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceId(),
|
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceId(),
|
||||||
&gui,
|
&gui,
|
||||||
m_deviceUIs.back()->m_deviceSourceAPI,
|
|
||||||
m_deviceUIs.back());
|
m_deviceUIs.back());
|
||||||
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginGUI->getInputMessageQueue());
|
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginGUI->getInputMessageQueue());
|
||||||
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginGUI);
|
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginGUI);
|
||||||
@ -241,7 +240,6 @@ void MainWindow::addSourceDevice()
|
|||||||
PluginInstanceGUI *pluginGUI = m_deviceUIs.back()->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
|
PluginInstanceGUI *pluginGUI = m_deviceUIs.back()->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
|
||||||
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceId(),
|
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceId(),
|
||||||
&gui,
|
&gui,
|
||||||
m_deviceUIs.back()->m_deviceSourceAPI,
|
|
||||||
m_deviceUIs.back());
|
m_deviceUIs.back());
|
||||||
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginGUI->getInputMessageQueue());
|
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginGUI->getInputMessageQueue());
|
||||||
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginGUI);
|
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(
|
PluginInstanceGUI *pluginUI = deviceUI->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
|
||||||
deviceUI->m_deviceSourceAPI->getSampleSourceId(),
|
deviceUI->m_deviceSourceAPI->getSampleSourceId(),
|
||||||
&gui,
|
&gui,
|
||||||
deviceUI->m_deviceSourceAPI,
|
|
||||||
deviceUI);
|
deviceUI);
|
||||||
deviceUI->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
|
deviceUI->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
|
||||||
deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginUI);
|
deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginUI);
|
||||||
|
@ -64,7 +64,6 @@ public:
|
|||||||
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId __attribute__((unused)),
|
const QString& sourceId __attribute__((unused)),
|
||||||
QWidget **widget __attribute__((unused)),
|
QWidget **widget __attribute__((unused)),
|
||||||
DeviceSourceAPI *deviceAPI __attribute__((unused)),
|
|
||||||
DeviceUISet *deviceUISet __attribute__((unused)))
|
DeviceUISet *deviceUISet __attribute__((unused)))
|
||||||
{ return 0; }
|
{ return 0; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user