From 61df7de043ab1648507ccf4434fb5f8e90f58b10 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 20 Dec 2016 16:38:27 +0100 Subject: [PATCH] NFM Modulator: implemented channel mute --- plugins/channeltx/modnfm/nfmmod.cpp | 13 ++++++-- plugins/channeltx/modnfm/nfmmod.h | 18 +++++------ plugins/channeltx/modnfm/nfmmodgui.cpp | 4 +-- plugins/channeltx/modnfm/nfmmodgui.h | 2 +- plugins/channeltx/modnfm/nfmmodgui.ui | 45 ++++++++++++++++++++++---- 5 files changed, 60 insertions(+), 22 deletions(-) diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index 8fdda4c9d..64fda354e 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -107,6 +107,13 @@ void NFMMod::configure(MessageQueue* messageQueue, void NFMMod::pull(Sample& sample) { + if (m_running.m_channelMute) + { + sample.m_real = 0.0f; + sample.m_imag = 0.0f; + return; + } + Complex ci; Real t; @@ -292,7 +299,7 @@ bool NFMMod::handleMessage(const Message& cmd) m_config.m_fmDeviation = cfg.getFMDeviation(); m_config.m_toneFrequency = cfg.getToneFrequency(); m_config.m_volumeFactor = cfg.getVolumeFactor(); - m_config.m_audioMute = cfg.getAudioMute(); + m_config.m_channelMute = cfg.getChannelMute(); m_config.m_playLoop = cfg.getPlayLoop(); m_config.m_ctcssOn = cfg.getCTCSSOn(); m_config.m_ctcssFrequency = cfg.getCTCSSFrequency(); @@ -305,7 +312,7 @@ bool NFMMod::handleMessage(const Message& cmd) << " m_fmDeviation: " << m_config.m_fmDeviation << " m_toneFrequency: " << m_config.m_toneFrequency << " m_volumeFactor: " << m_config.m_volumeFactor - << " m_audioMute: " << m_config.m_audioMute + << " m_channelMute: " << m_config.m_channelMute << " m_playLoop: " << m_config.m_playLoop << " m_ctcssOn: " << m_config.m_ctcssOn << " m_ctcssFrequency: " << m_config.m_ctcssFrequency; @@ -416,7 +423,7 @@ void NFMMod::apply() m_running.m_fmDeviation = m_config.m_fmDeviation; m_running.m_volumeFactor = m_config.m_volumeFactor; m_running.m_audioSampleRate = m_config.m_audioSampleRate; - m_running.m_audioMute = m_config.m_audioMute; + m_running.m_channelMute = m_config.m_channelMute; m_running.m_playLoop = m_config.m_playLoop; m_running.m_ctcssOn = m_config.m_ctcssOn; m_running.m_ctcssFrequency = m_config.m_ctcssFrequency; diff --git a/plugins/channeltx/modnfm/nfmmod.h b/plugins/channeltx/modnfm/nfmmod.h index 7dd3b9375..eb6e2978d 100644 --- a/plugins/channeltx/modnfm/nfmmod.h +++ b/plugins/channeltx/modnfm/nfmmod.h @@ -184,7 +184,7 @@ public: float fmDeviation, float toneFrequency, float volumeFactor, - bool audioMute, + bool channelMute, bool playLoop, bool ctcssOn, float ctcssFrequency); @@ -219,7 +219,7 @@ private: float getFMDeviation() const { return m_fmDeviation; } float getToneFrequency() const { return m_toneFrequency; } float getVolumeFactor() const { return m_volumeFactor; } - bool getAudioMute() const { return m_audioMute; } + bool getChannelMute() const { return m_channelMute; } bool getPlayLoop() const { return m_playLoop; } bool getCTCSSOn() const { return m_ctcssOn; } float getCTCSSFrequency() const { return m_ctcssFrequency; } @@ -229,7 +229,7 @@ private: float fmDeviation, float toneFrequency, float volumeFactor, - bool audioMute, + bool channelMute, bool playLoop, bool ctcssOn, float ctcssFrequency) @@ -239,7 +239,7 @@ private: fmDeviation, toneFrequency, volumeFactor, - audioMute, + channelMute, playLoop, ctcssOn, ctcssFrequency); @@ -251,7 +251,7 @@ private: float m_fmDeviation; float m_toneFrequency; float m_volumeFactor; - bool m_audioMute; + bool m_channelMute; bool m_playLoop; bool m_ctcssOn; float m_ctcssFrequency; @@ -261,7 +261,7 @@ private: float fmDeviation, float toneFrequency, float volumeFactor, - bool audioMute, + bool channelMute, bool playLoop, bool ctcssOn, float ctcssFrequency) : @@ -271,7 +271,7 @@ private: m_fmDeviation(fmDeviation), m_toneFrequency(toneFrequency), m_volumeFactor(volumeFactor), - m_audioMute(audioMute), + m_channelMute(channelMute), m_playLoop(playLoop), m_ctcssOn(ctcssOn), m_ctcssFrequency(ctcssFrequency) @@ -300,7 +300,7 @@ private: float m_toneFrequency; float m_volumeFactor; quint32 m_audioSampleRate; - bool m_audioMute; + bool m_channelMute; bool m_playLoop; bool m_ctcssOn; float m_ctcssFrequency; @@ -314,7 +314,7 @@ private: m_toneFrequency(1000.0f), m_volumeFactor(1.0f), m_audioSampleRate(0), - m_audioMute(false), + m_channelMute(false), m_playLoop(false), m_ctcssOn(false), m_ctcssFrequency(88.5) diff --git a/plugins/channeltx/modnfm/nfmmodgui.cpp b/plugins/channeltx/modnfm/nfmmodgui.cpp index 70f8db72f..1464b97fb 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.cpp +++ b/plugins/channeltx/modnfm/nfmmodgui.cpp @@ -261,7 +261,7 @@ void NFMModGUI::on_toneFrequency_valueChanged(int value) applySettings(); } -void NFMModGUI::on_audioMute_toggled(bool checked) +void NFMModGUI::on_channelMute_toggled(bool checked) { applySettings(); } @@ -477,7 +477,7 @@ void NFMModGUI::applySettings() ui->fmDev->value() * 100.0f, // value is in '100 Hz ui->toneFrequency->value() * 10.0f, ui->volume->value() / 10.0f, - ui->audioMute->isChecked(), + ui->channelMute->isChecked(), ui->playLoop->isChecked(), ui->ctcssOn->isChecked(), m_ctcssTones[ui->ctcss->currentIndex()]); diff --git a/plugins/channeltx/modnfm/nfmmodgui.h b/plugins/channeltx/modnfm/nfmmodgui.h index 9dcae122c..cf7a35334 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.h +++ b/plugins/channeltx/modnfm/nfmmodgui.h @@ -66,7 +66,7 @@ private slots: void on_fmDev_valueChanged(int value); void on_toneFrequency_valueChanged(int value); void on_volume_valueChanged(int value); - void on_audioMute_toggled(bool checked); + void on_channelMute_toggled(bool checked); void on_tone_toggled(bool checked); void on_morseKeyer_toggled(bool checked); void on_mic_toggled(bool checked); diff --git a/plugins/channeltx/modnfm/nfmmodgui.ui b/plugins/channeltx/modnfm/nfmmodgui.ui index cc23cf577..464062905 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.ui +++ b/plugins/channeltx/modnfm/nfmmodgui.ui @@ -56,7 +56,16 @@ 3 - + + 2 + + + 2 + + + 2 + + 2 @@ -158,7 +167,7 @@ - + Mute/Unmute audio @@ -744,17 +753,17 @@
gui/valuedial.h
1 - - ButtonSwitch - QToolButton -
gui/buttonswitch.h
-
LevelMeterVU QWidget
gui/levelmeter.h
1
+ + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
CWKeyerGUI QWidget @@ -764,6 +773,28 @@ + + + + + + + + + + + + + + + + + + + + + +