mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-09 09:25:07 -04:00
Multi device support: pass plugin API to devices input handlers to give access to DSP device engine methods
This commit is contained in:
@@ -59,7 +59,7 @@ BladerfGui::BladerfGui(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
|
||||
displaySettings();
|
||||
|
||||
m_sampleSource = new BladerfInput();
|
||||
m_sampleSource = new BladerfInput(m_pluginAPI);
|
||||
DSPEngine::instance()->setSource(m_sampleSource);
|
||||
|
||||
char recFileNameCStr[30];
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <errno.h>
|
||||
#include <QDebug>
|
||||
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
@@ -28,7 +29,8 @@
|
||||
MESSAGE_CLASS_DEFINITION(BladerfInput::MsgConfigureBladerf, Message)
|
||||
MESSAGE_CLASS_DEFINITION(BladerfInput::MsgReportBladerf, Message)
|
||||
|
||||
BladerfInput::BladerfInput() :
|
||||
BladerfInput::BladerfInput(PluginAPI *pluginAPI) :
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
m_bladerfThread(0),
|
||||
@@ -413,7 +415,7 @@ bool BladerfInput::applySettings(const BladeRFSettings& settings, bool force)
|
||||
{
|
||||
int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Decim);
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency);
|
||||
DSPEngine::instance()->getInputMessageQueue()->push(notif);
|
||||
m_pluginAPI->getDeviceInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
qDebug() << "BladerfInput::applySettings: center freq: " << m_settings.m_centerFrequency << " Hz"
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <libbladeRF.h>
|
||||
#include <QString>
|
||||
|
||||
class PluginAPI;
|
||||
class BladerfThread;
|
||||
|
||||
class BladerfInput : public SampleSource {
|
||||
@@ -63,7 +64,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
BladerfInput();
|
||||
BladerfInput(PluginAPI *pluginAPI);
|
||||
virtual ~BladerfInput();
|
||||
|
||||
virtual bool init(const Message& message);
|
||||
@@ -81,6 +82,7 @@ private:
|
||||
bladerf_lna_gain getLnaGain(int lnaGain);
|
||||
struct bladerf *open_bladerf_from_serial(const char *serial);
|
||||
|
||||
PluginAPI *m_pluginAPI;
|
||||
QMutex m_mutex;
|
||||
BladeRFSettings m_settings;
|
||||
struct bladerf* m_dev;
|
||||
|
||||
Reference in New Issue
Block a user