mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-08-26 13:26:24 -04:00
Single DeviceAPI interface (1)
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "fcdprogui.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "fcdproconst.h"
|
||||
#include "fcdtraits.h"
|
||||
@@ -38,9 +38,9 @@ FCDProGui::FCDProGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_sampleSource(NULL),
|
||||
m_lastEngineState(DSPDeviceSourceEngine::StNotStarted)
|
||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||
{
|
||||
m_sampleSource = (FCDProInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource();
|
||||
m_sampleSource = (FCDProInput*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
@@ -528,24 +528,24 @@ void FCDProGui::on_transverter_clicked()
|
||||
|
||||
void FCDProGui::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 "fcdproinput.h"
|
||||
#include "fcdprothread.h"
|
||||
@@ -39,7 +39,7 @@ MESSAGE_CLASS_DEFINITION(FCDProInput::MsgConfigureFCDPro, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProInput::MsgStartStop, Message)
|
||||
MESSAGE_CLASS_DEFINITION(FCDProInput::MsgFileRecord, Message)
|
||||
|
||||
FCDProInput::FCDProInput(DeviceSourceAPI *deviceAPI) :
|
||||
FCDProInput::FCDProInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_dev(0),
|
||||
m_settings(),
|
||||
@@ -50,7 +50,7 @@ FCDProInput::FCDProInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_fcdFIFO.setSize(20*fcd_traits<Pro>::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 @@ FCDProInput::~FCDProInput()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
|
||||
closeDevice();
|
||||
@@ -81,7 +81,7 @@ bool FCDProInput::openDevice()
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
int device = m_deviceAPI->getSampleSourceSequence();
|
||||
int device = m_deviceAPI->getSamplingDeviceSequence();
|
||||
qDebug() << "FCDProInput::openDevice with device #" << device;
|
||||
m_dev = fcdOpen(fcd_traits<Pro>::vendorId, fcd_traits<Pro>::productId, device);
|
||||
|
||||
@@ -275,14 +275,14 @@ bool FCDProInput::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 FCDProThread;
|
||||
class FileRecord;
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
FCDProInput(DeviceSourceAPI *deviceAPI);
|
||||
FCDProInput(DeviceAPI *deviceAPI);
|
||||
virtual ~FCDProInput();
|
||||
virtual void destroy();
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
void set_gain6(int index);
|
||||
|
||||
private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
DeviceAPI *m_deviceAPI;
|
||||
hid_device *m_dev;
|
||||
AudioInput m_fcdAudioInput;
|
||||
AudioFifo m_fcdFIFO;
|
||||
|
||||
@@ -109,7 +109,7 @@ PluginInstanceGUI* FCDProPlugin::createSampleSourcePluginInstanceGUI(
|
||||
}
|
||||
#endif
|
||||
|
||||
DeviceSampleSource *FCDProPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI)
|
||||
DeviceSampleSource *FCDProPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if (sourceId == fcd_traits<Pro>::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);
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
|
||||
Reference in New Issue
Block a user