From 423476140a7efd4ddf1485a1c27c863698cd1045 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 27 Jun 2020 05:04:21 +0200 Subject: [PATCH] LocalSource: fixed DSPSignalNotification& message passing to baseband --- plugins/channeltx/localsource/localsource.cpp | 2 +- .../localsource/localsourcebaseband.cpp | 11 +++++----- .../localsource/localsourcebaseband.h | 20 ------------------- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/plugins/channeltx/localsource/localsource.cpp b/plugins/channeltx/localsource/localsource.cpp index 6268c35ac..bfdb7e83e 100644 --- a/plugins/channeltx/localsource/localsource.cpp +++ b/plugins/channeltx/localsource/localsource.cpp @@ -106,7 +106,7 @@ bool LocalSource::handleMessage(const Message& cmd) calculateFrequencyOffset(m_settings.m_log2Interp, m_settings.m_filterChainHash); propagateSampleRateAndFrequency(m_settings.m_localDeviceIndex, m_settings.m_log2Interp); - MsgBasebandSampleRateNotification *msg = MsgBasebandSampleRateNotification::create(cfg.getSampleRate()); + DSPSignalNotification *msg = new DSPSignalNotification(cfg.getSampleRate(), cfg.getCenterFrequency()); m_basebandSource->getInputMessageQueue()->push(msg); if (m_guiMessageQueue) diff --git a/plugins/channeltx/localsource/localsourcebaseband.cpp b/plugins/channeltx/localsource/localsourcebaseband.cpp index 032efaf72..31f900ec8 100644 --- a/plugins/channeltx/localsource/localsourcebaseband.cpp +++ b/plugins/channeltx/localsource/localsourcebaseband.cpp @@ -25,7 +25,6 @@ MESSAGE_CLASS_DEFINITION(LocalSourceBaseband::MsgConfigureLocalSourceBaseband, Message) MESSAGE_CLASS_DEFINITION(LocalSourceBaseband::MsgConfigureLocalSourceWork, Message) -MESSAGE_CLASS_DEFINITION(LocalSourceBaseband::MsgBasebandSampleRateNotification, Message) MESSAGE_CLASS_DEFINITION(LocalSourceBaseband::MsgConfigureLocalDeviceSampleSink, Message) LocalSourceBaseband::LocalSourceBaseband() : @@ -142,13 +141,13 @@ bool LocalSourceBaseband::handleMessage(const Message& cmd) return true; } - else if (MsgBasebandSampleRateNotification::match(cmd)) + else if (DSPSignalNotification::match(cmd)) { QMutexLocker mutexLocker(&m_mutex); - MsgBasebandSampleRateNotification& notif = (MsgBasebandSampleRateNotification&) cmd; - qDebug() << "LocalSourceBaseband::handleMessage: MsgBasebandSampleRateNotification: basebandSampleRate: " << notif.getBasebandSampleRate(); - m_sampleFifo.resize(SampleSourceFifo::getSizePolicy(notif.getBasebandSampleRate())); - m_channelizer->setBasebandSampleRate(notif.getBasebandSampleRate()); + DSPSignalNotification& notif = (DSPSignalNotification&) cmd; + qDebug() << "LocalSourceBaseband::handleMessage: DSPSignalNotification: basebandSampleRate: " << notif.getSampleRate(); + m_sampleFifo.resize(SampleSourceFifo::getSizePolicy(notif.getSampleRate())); + m_channelizer->setBasebandSampleRate(notif.getSampleRate()); return true; } diff --git a/plugins/channeltx/localsource/localsourcebaseband.h b/plugins/channeltx/localsource/localsourcebaseband.h index 914c86150..4d388fbe0 100644 --- a/plugins/channeltx/localsource/localsourcebaseband.h +++ b/plugins/channeltx/localsource/localsourcebaseband.h @@ -77,26 +77,6 @@ public: { } }; - class MsgBasebandSampleRateNotification : public Message { - MESSAGE_CLASS_DECLARATION - - public: - static MsgBasebandSampleRateNotification* create(int sampleRate) { - return new MsgBasebandSampleRateNotification(sampleRate); - } - - int getBasebandSampleRate() const { return m_sampleRate; } - - private: - - MsgBasebandSampleRateNotification(int sampleRate) : - Message(), - m_sampleRate(sampleRate) - { } - - int m_sampleRate; - }; - class MsgConfigureLocalDeviceSampleSink : public Message { MESSAGE_CLASS_DECLARATION