From ea1d0077103349cf2f741af000dc01b2d312ee7f Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 16 Mar 2018 10:26:49 +0100 Subject: [PATCH] Channel Tx modulators: in constructor make sure the thread is launched when all members have been properly initialized (i.e. do it last) --- plugins/channeltx/modam/ammod.cpp | 6 +++--- plugins/channeltx/modatv/atvmod.cpp | 6 +++--- plugins/channeltx/modnfm/nfmmod.cpp | 6 +++--- plugins/channeltx/modssb/ssbmod.cpp | 6 +++--- plugins/channeltx/modwfm/wfmmod.cpp | 6 +++--- plugins/channeltx/udpsink/udpsink.cpp | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/plugins/channeltx/modam/ammod.cpp b/plugins/channeltx/modam/ammod.cpp index ac96b2a95..8d09466fd 100644 --- a/plugins/channeltx/modam/ammod.cpp +++ b/plugins/channeltx/modam/ammod.cpp @@ -73,13 +73,13 @@ AMMod::AMMod(DeviceSinkAPI *deviceAPI) : m_cwKeyer.setWPM(13); m_cwKeyer.setMode(CWKeyerSettings::CWNone); + applyChannelSettings(m_basebandSampleRate, m_outputSampleRate, m_inputFrequencyOffset, true); + applySettings(m_settings, true); + m_channelizer = new UpChannelizer(this); m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this); m_deviceAPI->addThreadedSource(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); - - applyChannelSettings(m_basebandSampleRate, m_outputSampleRate, m_inputFrequencyOffset, true); - applySettings(m_settings, true); } AMMod::~AMMod() diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index 56cb8f5b8..44a5187d9 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -90,13 +90,13 @@ ATVMod::ATVMod(DeviceSinkAPI *deviceAPI) : m_interpolatorDistanceRemain = 0.0f; m_interpolatorDistance = 1.0f; + applyChannelSettings(m_outputSampleRate, m_inputFrequencyOffset, true); + applySettings(m_settings, true); // does applyStandard() too; + m_channelizer = new UpChannelizer(this); m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this); m_deviceAPI->addThreadedSource(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); - - applyChannelSettings(m_outputSampleRate, m_inputFrequencyOffset, true); - applySettings(m_settings, true); // does applyStandard() too; } ATVMod::~ATVMod() diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index 347385c82..9f68c2a10 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -77,13 +77,13 @@ NFMMod::NFMMod(DeviceSinkAPI *deviceAPI) : m_cwKeyer.setWPM(13); m_cwKeyer.setMode(CWKeyerSettings::CWNone); + applyChannelSettings(m_basebandSampleRate, m_outputSampleRate, m_inputFrequencyOffset, true); + applySettings(m_settings, true); + m_channelizer = new UpChannelizer(this); m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this); m_deviceAPI->addThreadedSource(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); - - applyChannelSettings(m_basebandSampleRate, m_outputSampleRate, m_inputFrequencyOffset, true); - applySettings(m_settings, true); } NFMMod::~NFMMod() diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index ae997cd0f..3ecf9766e 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -99,13 +99,13 @@ SSBMod::SSBMod(DeviceSinkAPI *deviceAPI) : m_inAGC.setStepDownDelay(m_settings.m_agcThresholdDelay); m_inAGC.setClamping(true); + applyChannelSettings(m_basebandSampleRate, m_outputSampleRate, m_inputFrequencyOffset, true); + applySettings(m_settings, true); + m_channelizer = new UpChannelizer(this); m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this); m_deviceAPI->addThreadedSource(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); - - applyChannelSettings(m_basebandSampleRate, m_outputSampleRate, m_inputFrequencyOffset, true); - applySettings(m_settings, true); } SSBMod::~SSBMod() diff --git a/plugins/channeltx/modwfm/wfmmod.cpp b/plugins/channeltx/modwfm/wfmmod.cpp index ed30f65c6..ecd75409c 100644 --- a/plugins/channeltx/modwfm/wfmmod.cpp +++ b/plugins/channeltx/modwfm/wfmmod.cpp @@ -83,13 +83,13 @@ WFMMod::WFMMod(DeviceSinkAPI *deviceAPI) : m_cwKeyer.setMode(CWKeyerSettings::CWNone); m_cwKeyer.reset(); + applyChannelSettings(m_basebandSampleRate, m_outputSampleRate, m_inputFrequencyOffset, true); + applySettings(m_settings, true); + m_channelizer = new UpChannelizer(this); m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this); m_deviceAPI->addThreadedSource(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); - - applyChannelSettings(m_basebandSampleRate, m_outputSampleRate, m_inputFrequencyOffset, true); - applySettings(m_settings, true); } WFMMod::~WFMMod() diff --git a/plugins/channeltx/udpsink/udpsink.cpp b/plugins/channeltx/udpsink/udpsink.cpp index 24060a85f..467241bd6 100644 --- a/plugins/channeltx/udpsink/udpsink.cpp +++ b/plugins/channeltx/udpsink/udpsink.cpp @@ -67,13 +67,13 @@ UDPSink::UDPSink(DeviceSinkAPI *deviceAPI) : m_SSBFilter = new fftfilt(m_settings.m_lowCutoff / m_settings.m_inputSampleRate, m_settings.m_rfBandwidth / m_settings.m_inputSampleRate, m_ssbFftLen); m_SSBFilterBuffer = new Complex[m_ssbFftLen>>1]; // filter returns data exactly half of its size + applyChannelSettings(m_basebandSampleRate, m_outputSampleRate, m_inputFrequencyOffset, true); + applySettings(m_settings, true); + m_channelizer = new UpChannelizer(this); m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this); m_deviceAPI->addThreadedSource(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); - - applyChannelSettings(m_basebandSampleRate, m_outputSampleRate, m_inputFrequencyOffset, true); - applySettings(m_settings, true); } UDPSink::~UDPSink()