From 1b66b72a11dc94f66c9b46101aa09e3b1b15403c Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 9 Dec 2015 04:13:13 +0100 Subject: [PATCH] BFM demod: implement button to control RDS activation --- plugins/channel/bfm/bfmdemod.cpp | 17 +++++++++++++---- plugins/channel/bfm/bfmdemod.h | 26 ++++++++++++++++++++------ plugins/channel/bfm/bfmdemodgui.cpp | 8 +++++++- plugins/channel/bfm/bfmdemodgui.h | 1 + plugins/channel/bfm/bfmdemodgui.ui | 22 ++++++++++++++++++---- sdrbase/resources/rds.png | Bin 0 -> 416 bytes sdrbase/resources/res.qrc | 1 + 7 files changed, 60 insertions(+), 15 deletions(-) create mode 100644 sdrbase/resources/rds.png diff --git a/plugins/channel/bfm/bfmdemod.cpp b/plugins/channel/bfm/bfmdemod.cpp index 80a9ac6cc..47d19d721 100644 --- a/plugins/channel/bfm/bfmdemod.cpp +++ b/plugins/channel/bfm/bfmdemod.cpp @@ -75,9 +75,16 @@ void BFMDemod::configure(MessageQueue* messageQueue, Real volume, Real squelch, bool audioStereo, - bool showPilot) + bool showPilot, + bool rdsActive) { - Message* cmd = MsgConfigureBFMDemod::create(rfBandwidth, afBandwidth, volume, squelch, audioStereo, showPilot); + Message* cmd = MsgConfigureBFMDemod::create(rfBandwidth, + afBandwidth, + volume, + squelch, + audioStereo, + showPilot, + rdsActive); messageQueue->push(cmd); } @@ -256,6 +263,7 @@ bool BFMDemod::handleMessage(const Message& cmd) m_config.m_squelch = cfg.getSquelch(); m_config.m_audioStereo = cfg.getAudioStereo(); m_config.m_showPilot = cfg.getShowPilot(); + m_config.m_rdsActive = cfg.getRDSActive(); apply(); @@ -264,7 +272,8 @@ bool BFMDemod::handleMessage(const Message& cmd) << " m_volume: " << m_config.m_volume << " m_squelch: " << m_config.m_squelch << " m_audioStereo: " << m_config.m_audioStereo - << " m_showPilot: " << m_config.m_showPilot; + << " m_showPilot: " << m_config.m_showPilot + << " m_rdsActive: " << m_config.m_rdsActive; return true; } @@ -356,5 +365,5 @@ void BFMDemod::apply() m_running.m_audioSampleRate = m_config.m_audioSampleRate; m_running.m_audioStereo = m_config.m_audioStereo; m_running.m_showPilot = m_config.m_showPilot; - + m_running.m_rdsActive = m_config.m_rdsActive; } diff --git a/plugins/channel/bfm/bfmdemod.h b/plugins/channel/bfm/bfmdemod.h index d63be9c27..5b44a0d49 100644 --- a/plugins/channel/bfm/bfmdemod.h +++ b/plugins/channel/bfm/bfmdemod.h @@ -44,7 +44,8 @@ public: Real volume, Real squelch, bool audioStereo, - bool showPilot); + bool showPilot, + bool rdsActive); int getSampleRate() const { return m_config.m_inputSampleRate; } virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po); @@ -67,15 +68,23 @@ private: Real getSquelch() const { return m_squelch; } bool getAudioStereo() const { return m_audioStereo; } bool getShowPilot() const { return m_showPilot; } + bool getRDSActive() const { return m_rdsActive; } static MsgConfigureBFMDemod* create(Real rfBandwidth, Real afBandwidth, Real volume, Real squelch, bool audioStereo, - bool showPilot) + bool showPilot, + bool rdsActive) { - return new MsgConfigureBFMDemod(rfBandwidth, afBandwidth, volume, squelch, audioStereo, showPilot); + return new MsgConfigureBFMDemod(rfBandwidth, + afBandwidth, + volume, + squelch, + audioStereo, + showPilot, + rdsActive); } private: @@ -85,20 +94,23 @@ private: Real m_squelch; bool m_audioStereo; bool m_showPilot; + bool m_rdsActive; MsgConfigureBFMDemod(Real rfBandwidth, Real afBandwidth, Real volume, Real squelch, bool audioStereo, - bool showPilot) : + bool showPilot, + bool rdsActive) : Message(), m_rfBandwidth(rfBandwidth), m_afBandwidth(afBandwidth), m_volume(volume), m_squelch(squelch), m_audioStereo(audioStereo), - m_showPilot(showPilot) + m_showPilot(showPilot), + m_rdsActive(rdsActive) { } }; @@ -123,6 +135,7 @@ private: quint32 m_audioSampleRate; bool m_audioStereo; bool m_showPilot; + bool m_rdsActive; Config() : m_inputSampleRate(-1), @@ -133,7 +146,8 @@ private: m_volume(0), m_audioSampleRate(0), m_audioStereo(false), - m_showPilot(false) + m_showPilot(false), + m_rdsActive(false) { } }; diff --git a/plugins/channel/bfm/bfmdemodgui.cpp b/plugins/channel/bfm/bfmdemodgui.cpp index 8fef0db39..266a6c7d2 100644 --- a/plugins/channel/bfm/bfmdemodgui.cpp +++ b/plugins/channel/bfm/bfmdemodgui.cpp @@ -243,6 +243,11 @@ void BFMDemodGUI::on_showPilot_clicked() applySettings(); } +void BFMDemodGUI::on_rds_clicked() +{ + applySettings(); +} + void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) { } @@ -338,7 +343,8 @@ void BFMDemodGUI::applySettings() ui->volume->value() / 10.0, ui->squelch->value(), ui->audioStereo->isChecked(), - ui->showPilot->isChecked()); + ui->showPilot->isChecked(), + ui->rds->isChecked()); } } diff --git a/plugins/channel/bfm/bfmdemodgui.h b/plugins/channel/bfm/bfmdemodgui.h index 4aaad51c1..9b9b9e45d 100644 --- a/plugins/channel/bfm/bfmdemodgui.h +++ b/plugins/channel/bfm/bfmdemodgui.h @@ -63,6 +63,7 @@ private slots: void on_squelch_valueChanged(int value); void on_audioStereo_toggled(bool stereo); void on_showPilot_clicked(); + void on_rds_clicked(); void onWidgetRolled(QWidget* widget, bool rollDown); void onMenuDoubleClicked(); void tick(); diff --git a/plugins/channel/bfm/bfmdemodgui.ui b/plugins/channel/bfm/bfmdemodgui.ui index 396c00e4a..0c1e2c0ad 100644 --- a/plugins/channel/bfm/bfmdemodgui.ui +++ b/plugins/channel/bfm/bfmdemodgui.ui @@ -6,7 +6,7 @@ 0 0 - 308 + 335 333 @@ -21,7 +21,7 @@ 10 20 - 281 + 311 121 @@ -203,6 +203,20 @@ + + + + Toggle RDS subsystem activation + + + . + + + + :/rds.png:/rds.png + + + @@ -386,12 +400,12 @@ 10 160 - 281 + 311 151 - Channel Spectrum + Baseband Spectrum diff --git a/sdrbase/resources/rds.png b/sdrbase/resources/rds.png new file mode 100644 index 0000000000000000000000000000000000000000..405c04ab51e4a989aa850ac3a8aa593a9a93e67d GIT binary patch literal 416 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1rX+877l!}s{b%+Ad7K3vkw8&y zVGw3ym^BBap1s7=*OmP~4<|FDLr)jS5R21qCvEg%b`)sa@5wSzyG4Y3 zc}G}Mvf?&D)>em82@A`vO|xsrf2h5LLt}|RwSH^s)YjGsCR(!&JyLM(dc6I{-qPg9 z%r8Q$t^c1nS7ZHw{p`N}ppwju{0VW9tB({$%*hPn6Y7%jbjol%v3t@IUES9<6`|fj z30pK7JS0Ex)fBwo_S=zmb^EJo)7zmZrJb|0j&N^q=j55NHI$*ePRRc7GOwaGwwE>tjG39U0IM`a5CzPr?}6_3a;o0$=5=}*0(vEr#Usd zCbX{GYT_>+k=}fsK{cdM^PEu?TgLpA|4*%+x%T(=`){~U*fx6YWbRG`h9`rktDnm{ Hr-UW|i_D*B literal 0 HcmV?d00001 diff --git a/sdrbase/resources/res.qrc b/sdrbase/resources/res.qrc index 03ce4800e..cd631d96d 100644 --- a/sdrbase/resources/res.qrc +++ b/sdrbase/resources/res.qrc @@ -46,5 +46,6 @@ flip_lr.png flip_rl.png carrier.png + rds.png