From 890fd88f1f1d2b6efe2c304097a76bc472bdf563 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 12 Oct 2017 20:33:16 +0200 Subject: [PATCH] NFM modulator: GUI and modulator separation phase 1 (1) --- plugins/channeltx/modnfm/nfmmod.cpp | 15 +++++++++++++++ plugins/channeltx/modnfm/nfmmod.h | 23 +++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index c0efaf1c3..05e73cb43 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -26,6 +26,7 @@ #include "nfmmod.h" MESSAGE_CLASS_DEFINITION(NFMMod::MsgConfigureNFMMod, Message) +MESSAGE_CLASS_DEFINITION(NFMMod::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(NFMMod::MsgConfigureFileSourceName, Message) MESSAGE_CLASS_DEFINITION(NFMMod::MsgConfigureFileSourceSeek, Message) MESSAGE_CLASS_DEFINITION(NFMMod::MsgConfigureAFInput, Message) @@ -275,6 +276,20 @@ bool NFMMod::handleMessage(const Message& cmd) return true; } + else if (MsgConfigureChannelizer::match(cmd)) + { + MsgConfigureChannelizer& cfg = (MsgConfigureChannelizer&) cmd; + +// m_channelizer->configure(m_channelizer->getInputMessageQueue(), +// cfg.getSampleRate(), +// cfg.getCenterFrequency()); + + qDebug() << "NFMMod::handleMessage: MsgConfigureChannelizer:" + << " getSampleRate: " << cfg.getSampleRate() + << " getCenterFrequency: " << cfg.getCenterFrequency(); + + return true; + } else if (MsgConfigureNFMMod::match(cmd)) { MsgConfigureNFMMod& cfg = (MsgConfigureNFMMod&) cmd; diff --git a/plugins/channeltx/modnfm/nfmmod.h b/plugins/channeltx/modnfm/nfmmod.h index ddad2baa9..bd60c3b4b 100644 --- a/plugins/channeltx/modnfm/nfmmod.h +++ b/plugins/channeltx/modnfm/nfmmod.h @@ -63,6 +63,29 @@ public: { } }; + class MsgConfigureChannelizer : public Message { + MESSAGE_CLASS_DECLARATION + + public: + int getSampleRate() const { return m_sampleRate; } + int getCenterFrequency() const { return m_centerFrequency; } + + static MsgConfigureChannelizer* create(int sampleRate, int centerFrequency) + { + return new MsgConfigureChannelizer(sampleRate, centerFrequency); + } + + private: + int m_sampleRate; + int m_centerFrequency; + + MsgConfigureChannelizer(int sampleRate, int centerFrequency) : + Message(), + m_sampleRate(sampleRate), + m_centerFrequency(centerFrequency) + { } + }; + typedef enum { NFMModInputNone,