mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -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:
@@ -46,7 +46,7 @@ HackRFGui::HackRFGui(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
|
||||
displaySettings();
|
||||
|
||||
m_sampleSource = new HackRFInput();
|
||||
m_sampleSource = new HackRFInput(m_pluginAPI);
|
||||
|
||||
displaySampleRates();
|
||||
displayBandwidths();
|
||||
|
||||
@@ -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"
|
||||
@@ -29,7 +30,8 @@
|
||||
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgConfigureHackRF, Message)
|
||||
MESSAGE_CLASS_DEFINITION(HackRFInput::MsgReportHackRF, Message)
|
||||
|
||||
HackRFInput::HackRFInput() :
|
||||
HackRFInput::HackRFInput(PluginAPI *pluginAPI) :
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
m_hackRFThread(0),
|
||||
@@ -396,8 +398,7 @@ bool HackRFInput::applySettings(const HackRFSettings& settings, bool force)
|
||||
{
|
||||
int sampleRate = devSampleRate/(1<<m_settings.m_log2Decim);
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency);
|
||||
DSPEngine::instance()->getInputMessageQueue()->push(notif);
|
||||
//getOutputMessageQueue()->push(notif);
|
||||
m_pluginAPI->getDeviceInputMessageQueue()->push(notif);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "hackrfsettings.h"
|
||||
#include <QString>
|
||||
|
||||
class PluginAPI;
|
||||
class HackRFThread;
|
||||
|
||||
class HackRFInput : public SampleSource {
|
||||
@@ -64,7 +65,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
HackRFInput();
|
||||
HackRFInput(PluginAPI *pluginAPI);
|
||||
virtual ~HackRFInput();
|
||||
|
||||
virtual bool init(const Message& message);
|
||||
@@ -82,6 +83,7 @@ private:
|
||||
hackrf_device *open_hackrf_from_sequence(int sequence);
|
||||
void setCenterFrequency(quint64 freq);
|
||||
|
||||
PluginAPI *m_pluginAPI;
|
||||
QMutex m_mutex;
|
||||
HackRFSettings m_settings;
|
||||
struct hackrf_device* m_dev;
|
||||
|
||||
Reference in New Issue
Block a user