mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-15 12:18:48 -04:00
Single DeviceAPI interface (1)
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "fcdproplusgui.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "fcdproplusconst.h"
|
||||
#include "fcdtraits.h"
|
||||
@@ -39,9 +39,9 @@ FCDProPlusGui::FCDProPlusGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_sampleSource(NULL),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (FCDProPlusInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (FCDProPlusInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -286,24 +286,24 @@ void FCDProPlusGui::updateHardware()
|
||||
|
||||
void FCDProPlusGui::updateStatus()
|
||||
{
|
||||
int state = m_deviceUISet->m_deviceSourceAPI->state();
|
||||
int state = m_deviceUISet->m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case DSPDeviceSourceEngine::StNotStarted:
|
||||
case DeviceAPI::StNotStarted:
|
||||
ui->startStop->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StIdle:
|
||||
case DeviceAPI::StIdle:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : blue; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StRunning:
|
||||
case DeviceAPI::StRunning:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : green; }");
|
||||
break;
|
||||
case DSPDeviceSourceEngine::StError:
|
||||
case DeviceAPI::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceSourceAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceUISet->m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
|
||||
#include "fcdproplusinput.h"
|
||||
#include "fcdproplusthread.h"
|
||||
@@ -39,7 +39,7 @@ MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgConfigureFCDProPlus, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgFileRecord, Message)
|
||||
|
||||
FCDProPlusInput::FCDProPlusInput(DeviceSourceAPI *deviceAPI) :
|
||||
FCDProPlusInput::FCDProPlusInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_dev(0),
|
||||
m_settings(),
|
||||
@@ -50,7 +50,7 @@ FCDProPlusInput::FCDProPlusInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_fcdFIFO.setSize(20*fcd_traits<ProPlus>::convBufSize);
|
||||
openDevice();
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
}
|
||||
@@ -64,7 +64,7 @@ FCDProPlusInput::~FCDProPlusInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
|
||||
closeDevice();
|
||||
@@ -81,7 +81,7 @@ bool FCDProPlusInput::openDevice()
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
int device = m_deviceAPI->getSampleSourceSequence();
|
||||
int device = m_deviceAPI->getSamplingDeviceSequence();
|
||||
qDebug() << "FCDProPlusInput::openDevice with device #" << device;
|
||||
m_dev = fcdOpen(fcd_traits<ProPlus>::vendorId, fcd_traits<ProPlus>::productId, device);
|
||||
|
||||
@@ -277,14 +277,14 @@ bool FCDProPlusInput::handleMessage(const Message& message)
|
||||
|
||||
if (cmd.getStartStop())
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
if (m_deviceAPI->initDeviceEngine())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
m_deviceAPI->startDeviceEngine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
m_deviceAPI->stopDeviceEngine();
|
||||
}
|
||||
|
||||
if (m_settings.m_useReverseAPI) {
|
||||
|
||||
@@ -38,7 +38,7 @@ struct fcd_buffer {
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class DeviceSourceAPI;
|
||||
class DeviceAPI;
|
||||
class FCDProPlusThread;
|
||||
class FileRecord;
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
FCDProPlusInput(DeviceSourceAPI *deviceAPI);
|
||||
FCDProPlusInput(DeviceAPI *deviceAPI);
|
||||
virtual ~FCDProPlusInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
void set_if_filter(int filterIndex);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
hid_device *m_dev;
|
||||
AudioInput m_fcdAudioInput;
|
||||
AudioFifo m_fcdFIFO;
|
||||
|
||||
@@ -111,7 +111,7 @@ PluginInstanceGUI* FCDProPlusPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *FCDProPlusPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *FCDProPlusPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if(sourceId == fcd_traits<ProPlus>::interfaceIID)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
const QString& sourceId,
|
||||
QWidget **widget,
|
||||
DeviceUISet *deviceUISet);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
|
||||
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI);
|
||||
|
||||
static const QString m_deviceTypeID;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user