From ab588684bb66ded7dbffe3223b889cdf32916553 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 14 Mar 2017 18:59:49 +0100 Subject: [PATCH] ATV Modulator: implemented channel mute --- plugins/channeltx/modatv/atvmod.cpp | 15 +++++++++++++-- plugins/channeltx/modatv/atvmod.h | 18 +++++++++++++----- plugins/channeltx/modatv/atvmodgui.h | 2 +- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index 7e76b2334..adea5c502 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -100,7 +100,8 @@ void ATVMod::configure(MessageQueue* messageQueue, atvModulation, videoPlayLoop, videoPlay, - cameraPlay); + cameraPlay, + channelMute); messageQueue->push(cmd); } @@ -110,6 +111,13 @@ void ATVMod::pullAudio(int nbSamples) void ATVMod::pull(Sample& sample) { + if (m_running.m_channelMute) + { + sample.m_real = 0.0f; + sample.m_imag = 0.0f; + return; + } + Complex ci; m_settingsMutex.lock(); @@ -446,6 +454,7 @@ bool ATVMod::handleMessage(const Message& cmd) m_config.m_videoPlayLoop = cfg.getVideoPlayLoop(); m_config.m_videoPlay = cfg.getVideoPlay(); m_config.m_cameraPlay = cfg.getCameraPlay(); + m_config.m_channelMute = cfg.getChannelMute(); apply(); @@ -457,7 +466,8 @@ bool ATVMod::handleMessage(const Message& cmd) << " m_atvModulation: " << (int) m_config.m_atvModulation << " m_videoPlayLoop: " << m_config.m_videoPlayLoop << " m_videoPlay: " << m_config.m_videoPlay - << " m_cameraPlay: " << m_config.m_cameraPlay; + << " m_cameraPlay: " << m_config.m_cameraPlay + << " m_channelMute: " << m_config.m_channelMute; return true; } @@ -595,6 +605,7 @@ void ATVMod::apply(bool force) m_running.m_videoPlayLoop = m_config.m_videoPlayLoop; m_running.m_videoPlay = m_config.m_videoPlay; m_running.m_cameraPlay = m_config.m_cameraPlay; + m_running.m_channelMute = m_config.m_channelMute; } int ATVMod::getSampleRateUnits(ATVStd std) diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h index bca78742d..84d4dadc7 100644 --- a/plugins/channeltx/modatv/atvmod.h +++ b/plugins/channeltx/modatv/atvmod.h @@ -347,6 +347,7 @@ private: bool getVideoPlayLoop() const { return m_videoPlayLoop; } bool getVideoPlay() const { return m_videoPlay; } bool getCameraPlay() const { return m_cameraPlay; } + bool getChannelMute() const { return m_channelMute; } static MsgConfigureATVMod* create( Real rfBandwidth, @@ -356,7 +357,8 @@ private: ATVModulation atvModulation, bool videoPlayLoop, bool videoPlay, - bool cameraPlay) + bool cameraPlay, + bool channelMute) { return new MsgConfigureATVMod( rfBandwidth, @@ -366,7 +368,8 @@ private: atvModulation, videoPlayLoop, videoPlay, - cameraPlay); + cameraPlay, + channelMute); } private: @@ -378,6 +381,7 @@ private: bool m_videoPlayLoop; bool m_videoPlay; bool m_cameraPlay; + bool m_channelMute; MsgConfigureATVMod( Real rfBandwidth, @@ -387,7 +391,8 @@ private: ATVModulation atvModulation, bool videoPlayLoop, bool videoPlay, - bool cameraPlay) : + bool cameraPlay, + bool channelMute) : Message(), m_rfBandwidth(rfBandwidth), m_atvStd(atvStd), @@ -396,7 +401,8 @@ private: m_atvModulation(atvModulation), m_videoPlayLoop(videoPlayLoop), m_videoPlay(videoPlay), - m_cameraPlay(cameraPlay) + m_cameraPlay(cameraPlay), + m_channelMute(channelMute) { } }; @@ -440,6 +446,7 @@ private: bool m_videoPlayLoop; //!< Play video in a loop bool m_videoPlay; //!< True to play video and false to pause bool m_cameraPlay; //!< True to play camera video and false to pause + bool m_channelMute; //!< Mute channel baseband output Config() : m_outputSampleRate(-1), @@ -451,7 +458,8 @@ private: m_atvModulation(ATVModulationAM), m_videoPlayLoop(false), m_videoPlay(false), - m_cameraPlay(false) + m_cameraPlay(false), + m_channelMute(false) { } }; diff --git a/plugins/channeltx/modatv/atvmodgui.h b/plugins/channeltx/modatv/atvmodgui.h index 58a742ef5..4357ea191 100644 --- a/plugins/channeltx/modatv/atvmodgui.h +++ b/plugins/channeltx/modatv/atvmodgui.h @@ -62,12 +62,12 @@ private slots: void on_deltaFrequency_changed(quint64 value); void on_deltaMinus_toggled(bool minus); + void on_channelMute_toggled(bool checked); void on_modulation_currentIndexChanged(int index); void on_rfBW_valueChanged(int value); void on_standard_currentIndexChanged(int index); void on_uniformLevel_valueChanged(int value); void on_inputSelect_currentIndexChanged(int index); - void on_channelMute_toggled(bool checked); void on_imageFileDialog_clicked(bool checked); void on_videoFileDialog_clicked(bool checked);