mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-05 15:34:57 -04:00
Multi device support: completely removed DSPEngine dependency on DSPDeviceEngine message queues
This commit is contained in:
@@ -52,7 +52,7 @@ SDRdaemonInput::SDRdaemonInput(const QTimer& masterTimer, PluginAPI *pluginAPI)
|
||||
m_autoCorrBuffer(false)
|
||||
{
|
||||
m_sampleFifo.setSize(96000 * 4);
|
||||
m_SDRdaemonUDPHandler = new SDRdaemonUDPHandler(&m_sampleFifo, getOutputMessageQueueToGUI());
|
||||
m_SDRdaemonUDPHandler = new SDRdaemonUDPHandler(&m_sampleFifo, getOutputMessageQueueToGUI(), m_pluginAPI);
|
||||
m_SDRdaemonUDPHandler->connectTimer(&m_masterTimer);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,15 @@
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "sdrdaemonudphandler.h"
|
||||
#include "sdrdaemoninput.h"
|
||||
|
||||
SDRdaemonUDPHandler::SDRdaemonUDPHandler(SampleFifo *sampleFifo, MessageQueue *outputMessageQueueToGUI) :
|
||||
SDRdaemonUDPHandler::SDRdaemonUDPHandler(SampleFifo *sampleFifo, MessageQueue *outputMessageQueueToGUI, PluginAPI *pluginAPI) :
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_sdrDaemonBuffer(m_rateDivider),
|
||||
m_dataSocket(0),
|
||||
m_dataAddress(QHostAddress::LocalHost),
|
||||
@@ -88,7 +91,7 @@ void SDRdaemonUDPHandler::start()
|
||||
|
||||
// Need to notify the DSP engine to actually start
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(m_samplerate, m_centerFrequency * 1000); // Frequency in Hz for the DSP engine
|
||||
DSPEngine::instance()->getInputMessageQueue()->push(notif);
|
||||
m_pluginAPI->getDeviceInputMessageQueue()->push(notif);
|
||||
m_elapsedTimer.start();
|
||||
}
|
||||
|
||||
@@ -169,7 +172,7 @@ void SDRdaemonUDPHandler::processData()
|
||||
if (change)
|
||||
{
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(m_samplerate, m_centerFrequency * 1000); // Frequency in Hz for the DSP engine
|
||||
DSPEngine::instance()->getInputMessageQueue()->push(notif);
|
||||
m_pluginAPI->getDeviceInputMessageQueue()->push(notif);
|
||||
SDRdaemonInput::MsgReportSDRdaemonStreamData *report = SDRdaemonInput::MsgReportSDRdaemonStreamData::create(
|
||||
m_sdrDaemonBuffer.getSampleRateStream(),
|
||||
m_samplerate,
|
||||
|
||||
@@ -30,12 +30,13 @@
|
||||
class SampleFifo;
|
||||
class MessageQueue;
|
||||
class QTimer;
|
||||
class PluginAPI;
|
||||
|
||||
class SDRdaemonUDPHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SDRdaemonUDPHandler(SampleFifo* sampleFifo, MessageQueue *outputMessageQueueToGUI);
|
||||
SDRdaemonUDPHandler(SampleFifo* sampleFifo, MessageQueue *outputMessageQueueToGUI, PluginAPI *pluginAPI);
|
||||
~SDRdaemonUDPHandler();
|
||||
void connectTimer(const QTimer* timer);
|
||||
void start();
|
||||
@@ -49,6 +50,7 @@ public slots:
|
||||
void dataReadyRead();
|
||||
|
||||
private:
|
||||
PluginAPI *m_pluginAPI;
|
||||
SDRdaemonBuffer m_sdrDaemonBuffer;
|
||||
QUdpSocket *m_dataSocket;
|
||||
QHostAddress m_dataAddress;
|
||||
|
||||
Reference in New Issue
Block a user