1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

Channel Rx demods: in constructor make sure the thread is launched when all members have been properly initialized (i.e. do it last)

This commit is contained in:
f4exb 2018-03-16 10:24:19 +01:00
parent 8d69272a76
commit 170c59de43
10 changed files with 29 additions and 28 deletions

View File

@ -50,12 +50,12 @@ ChannelAnalyzerNG::ChannelAnalyzerNG(DeviceSourceAPI *deviceAPI) :
SSBFilter = new fftfilt(m_config.m_LowCutoff / m_config.m_inputSampleRate, m_config.m_Bandwidth / m_config.m_inputSampleRate, ssbFftLen);
DSBFilter = new fftfilt(m_config.m_Bandwidth / m_config.m_inputSampleRate, 2*ssbFftLen);
apply(true);
m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
apply(true);
}
ChannelAnalyzerNG::~ChannelAnalyzerNG()

View File

@ -61,13 +61,13 @@ AMDemod::AMDemod(DeviceSourceAPI *deviceAPI) :
m_audioNetSink = new AudioNetSink(0); // parent thread allocated dynamically
m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
}
AMDemod::~AMDemod()

View File

@ -85,14 +85,14 @@ ATVDemod::ATVDemod(DeviceSourceAPI *deviceAPI) :
m_objPhaseDiscri.setFMScaling(1.0f);
applyStandard();
m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged()));
applyStandard();
}
ATVDemod::~ATVDemod()

View File

@ -89,13 +89,13 @@ BFMDemod::BFMDemod(DeviceSourceAPI *deviceAPI) :
m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort);
m_audioNetSink->setStereo(true);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
}
BFMDemod::~BFMDemod()

View File

@ -58,15 +58,15 @@ DATVDemod::DATVDemod(DeviceSourceAPI *deviceAPI) :
m_objRFFilter = new fftfilt(-256000.0 / 1024000.0, 256000.0 / 1024000.0, rfFilterFftLength);
//To setup correct Sample Rate
channelSampleRateChanged();
m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged()));
//To setup correct Sample Rate
channelSampleRateChanged();
}
DATVDemod::~DATVDemod()

View File

@ -84,13 +84,13 @@ DSDDemod::DSDDemod(DeviceSourceAPI *deviceAPI) :
m_audioFifo1.setAudioNetSink(m_audioNetSink);
m_audioFifo2.setAudioNetSink(m_audioNetSink);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
}
DSDDemod::~DSDDemod()

View File

@ -66,6 +66,7 @@ NFMDemod::NFMDemod(DeviceSourceAPI *devieAPI) :
m_audioFifo(48000),
m_settingsMutex(QMutex::Recursive)
{
qDebug("NFMDemod::NFMDemod");
setObjectName(m_channelId);
m_audioBuffer.resize(1<<14);
@ -80,13 +81,13 @@ NFMDemod::NFMDemod(DeviceSourceAPI *devieAPI) :
m_audioNetSink = new AudioNetSink(0); // parent thread allocated dynamically
m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
}
NFMDemod::~NFMDemod()

View File

@ -89,13 +89,13 @@ SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) :
m_audioNetSink = new AudioNetSink(0); // parent thread allocated dynamically
m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
}
SSBDemod::~SSBDemod()

View File

@ -63,13 +63,13 @@ WFMDemod::WFMDemod(DeviceSourceAPI* deviceAPI) :
m_audioNetSink = new AudioNetSink(0); // parent thread allocated dynamically
m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
}
WFMDemod::~WFMDemod()

View File

@ -100,13 +100,13 @@ UDPSrc::UDPSrc(DeviceSourceAPI *deviceAPI) :
//DSPEngine::instance()->addAudioSink(&m_audioFifo);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
m_channelizer = new DownChannelizer(this);
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
m_deviceAPI->addChannelAPI(this);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
}
UDPSrc::~UDPSrc()