FT8 demod: removed audio references (almost)

This commit is contained in:
f4exb 2023-01-15 07:24:53 +01:00
parent 6444d749d8
commit cd8990907d
19 changed files with 99 additions and 502 deletions

View File

@ -241,16 +241,13 @@ void FT8Demod::applySettings(const FT8DemodSettings& settings, bool force)
<< " m_lowCutoff: " << settings.m_filterBank[settings.m_filterIndex].m_lowCutoff << " m_lowCutoff: " << settings.m_filterBank[settings.m_filterIndex].m_lowCutoff
<< " m_fftWindow: " << settings.m_filterBank[settings.m_filterIndex].m_fftWindow << "]" << " m_fftWindow: " << settings.m_filterBank[settings.m_filterIndex].m_fftWindow << "]"
<< " m_volume: " << settings.m_volume << " m_volume: " << settings.m_volume
<< " m_audioBinaual: " << settings.m_audioBinaural
<< " m_audioFlipChannels: " << settings.m_audioFlipChannels
<< " m_dsb: " << settings.m_dsb << " m_dsb: " << settings.m_dsb
<< " m_audioMute: " << settings.m_audioMute
<< " m_agcActive: " << settings.m_agc << " m_agcActive: " << settings.m_agc
<< " m_agcClamping: " << settings.m_agcClamping << " m_agcClamping: " << settings.m_agcClamping
<< " m_agcTimeLog2: " << settings.m_agcTimeLog2 << " m_agcTimeLog2: " << settings.m_agcTimeLog2
<< " agcPowerThreshold: " << settings.m_agcPowerThreshold << " agcPowerThreshold: " << settings.m_agcPowerThreshold
<< " agcThresholdGate: " << settings.m_agcThresholdGate << " agcThresholdGate: " << settings.m_agcThresholdGate
<< " m_audioDeviceName: " << settings.m_audioDeviceName << " m_ft8SampleRate: " << settings.m_ft8SampleRate
<< " m_streamIndex: " << settings.m_streamIndex << " m_streamIndex: " << settings.m_streamIndex
<< " m_useReverseAPI: " << settings.m_useReverseAPI << " m_useReverseAPI: " << settings.m_useReverseAPI
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress << " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
@ -294,21 +291,12 @@ void FT8Demod::applySettings(const FT8DemodSettings& settings, bool force)
if ((m_settings.m_agcClamping != settings.m_agcClamping) || force) { if ((m_settings.m_agcClamping != settings.m_agcClamping) || force) {
reverseAPIKeys.append("agcClamping"); reverseAPIKeys.append("agcClamping");
} }
if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force) { if ((settings.m_ft8SampleRate != m_settings.m_ft8SampleRate) || force) {
reverseAPIKeys.append("audioDeviceName"); reverseAPIKeys.append("ft8SampleRate");
}
if ((m_settings.m_audioBinaural != settings.m_audioBinaural) || force) {
reverseAPIKeys.append("audioBinaural");
}
if ((m_settings.m_audioFlipChannels != settings.m_audioFlipChannels) || force) {
reverseAPIKeys.append("audioFlipChannels");
} }
if ((m_settings.m_dsb != settings.m_dsb) || force) { if ((m_settings.m_dsb != settings.m_dsb) || force) {
reverseAPIKeys.append("dsb"); reverseAPIKeys.append("dsb");
} }
if ((m_settings.m_audioMute != settings.m_audioMute) || force) {
reverseAPIKeys.append("audioMute");
}
if ((m_settings.m_agc != settings.m_agc) || force) { if ((m_settings.m_agc != settings.m_agc) || force) {
reverseAPIKeys.append("agc"); reverseAPIKeys.append("agc");
} }
@ -400,7 +388,7 @@ void FT8Demod::sendSampleRateToDemodAnalyzer()
{ {
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create( MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
this, this,
getAudioSampleRate() m_settings.m_ft8SampleRate
); );
messageQueue->push(msg); messageQueue->push(msg);
} }
@ -479,18 +467,9 @@ void FT8Demod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("volume")) { if (channelSettingsKeys.contains("volume")) {
settings.m_volume = response.getFt8DemodSettings()->getVolume(); settings.m_volume = response.getFt8DemodSettings()->getVolume();
} }
if (channelSettingsKeys.contains("audioBinaural")) {
settings.m_audioBinaural = response.getFt8DemodSettings()->getAudioBinaural() != 0;
}
if (channelSettingsKeys.contains("audioFlipChannels")) {
settings.m_audioFlipChannels = response.getFt8DemodSettings()->getAudioFlipChannels() != 0;
}
if (channelSettingsKeys.contains("dsb")) { if (channelSettingsKeys.contains("dsb")) {
settings.m_dsb = response.getFt8DemodSettings()->getDsb() != 0; settings.m_dsb = response.getFt8DemodSettings()->getDsb() != 0;
} }
if (channelSettingsKeys.contains("audioMute")) {
settings.m_audioMute = response.getFt8DemodSettings()->getAudioMute() != 0;
}
if (channelSettingsKeys.contains("agc")) { if (channelSettingsKeys.contains("agc")) {
settings.m_agc = response.getFt8DemodSettings()->getAgc() != 0; settings.m_agc = response.getFt8DemodSettings()->getAgc() != 0;
} }
@ -513,7 +492,7 @@ void FT8Demod::webapiUpdateChannelSettings(
settings.m_title = *response.getFt8DemodSettings()->getTitle(); settings.m_title = *response.getFt8DemodSettings()->getTitle();
} }
if (channelSettingsKeys.contains("audioDeviceName")) { if (channelSettingsKeys.contains("audioDeviceName")) {
settings.m_audioDeviceName = *response.getFt8DemodSettings()->getAudioDeviceName(); settings.m_ft8SampleRate = response.getFt8DemodSettings()->getFt8SampleRate();
} }
if (channelSettingsKeys.contains("streamIndex")) { if (channelSettingsKeys.contains("streamIndex")) {
settings.m_streamIndex = response.getFt8DemodSettings()->getStreamIndex(); settings.m_streamIndex = response.getFt8DemodSettings()->getStreamIndex();
@ -557,7 +536,6 @@ int FT8Demod::webapiReportGet(
void FT8Demod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const FT8DemodSettings& settings) void FT8Demod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const FT8DemodSettings& settings)
{ {
response.getFt8DemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
response.getFt8DemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset); response.getFt8DemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getFt8DemodSettings()->setFilterIndex(settings.m_filterIndex); response.getFt8DemodSettings()->setFilterIndex(settings.m_filterIndex);
response.getFt8DemodSettings()->setSpanLog2(settings.m_filterBank[settings.m_filterIndex].m_spanLog2); response.getFt8DemodSettings()->setSpanLog2(settings.m_filterBank[settings.m_filterIndex].m_spanLog2);
@ -565,16 +543,14 @@ void FT8Demod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getFt8DemodSettings()->setLowCutoff(settings.m_filterBank[settings.m_filterIndex].m_lowCutoff); response.getFt8DemodSettings()->setLowCutoff(settings.m_filterBank[settings.m_filterIndex].m_lowCutoff);
response.getFt8DemodSettings()->setFftWindow((int) settings.m_filterBank[settings.m_filterIndex].m_fftWindow); response.getFt8DemodSettings()->setFftWindow((int) settings.m_filterBank[settings.m_filterIndex].m_fftWindow);
response.getFt8DemodSettings()->setVolume(settings.m_volume); response.getFt8DemodSettings()->setVolume(settings.m_volume);
response.getFt8DemodSettings()->setAudioBinaural(settings.m_audioBinaural ? 1 : 0);
response.getFt8DemodSettings()->setAudioFlipChannels(settings.m_audioFlipChannels ? 1 : 0);
response.getFt8DemodSettings()->setDsb(settings.m_dsb ? 1 : 0); response.getFt8DemodSettings()->setDsb(settings.m_dsb ? 1 : 0);
response.getFt8DemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
response.getFt8DemodSettings()->setAgc(settings.m_agc ? 1 : 0); response.getFt8DemodSettings()->setAgc(settings.m_agc ? 1 : 0);
response.getFt8DemodSettings()->setAgcClamping(settings.m_agcClamping ? 1 : 0); response.getFt8DemodSettings()->setAgcClamping(settings.m_agcClamping ? 1 : 0);
response.getFt8DemodSettings()->setAgcTimeLog2(settings.m_agcTimeLog2); response.getFt8DemodSettings()->setAgcTimeLog2(settings.m_agcTimeLog2);
response.getFt8DemodSettings()->setAgcPowerThreshold(settings.m_agcPowerThreshold); response.getFt8DemodSettings()->setAgcPowerThreshold(settings.m_agcPowerThreshold);
response.getFt8DemodSettings()->setAgcThresholdGate(settings.m_agcThresholdGate); response.getFt8DemodSettings()->setAgcThresholdGate(settings.m_agcThresholdGate);
response.getFt8DemodSettings()->setRgbColor(settings.m_rgbColor); response.getFt8DemodSettings()->setRgbColor(settings.m_rgbColor);
response.getFt8DemodSettings()->setFt8SampleRate(settings.m_ft8SampleRate);
if (response.getFt8DemodSettings()->getTitle()) { if (response.getFt8DemodSettings()->getTitle()) {
*response.getFt8DemodSettings()->getTitle() = settings.m_title; *response.getFt8DemodSettings()->getTitle() = settings.m_title;
@ -582,12 +558,6 @@ void FT8Demod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getFt8DemodSettings()->setTitle(new QString(settings.m_title)); response.getFt8DemodSettings()->setTitle(new QString(settings.m_title));
} }
if (response.getFt8DemodSettings()->getAudioDeviceName()) {
*response.getFt8DemodSettings()->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
response.getFt8DemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
response.getFt8DemodSettings()->setStreamIndex(settings.m_streamIndex); response.getFt8DemodSettings()->setStreamIndex(settings.m_streamIndex);
response.getFt8DemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); response.getFt8DemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
@ -655,7 +625,6 @@ void FT8Demod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response
if (m_running) if (m_running)
{ {
response.getFt8DemodReport()->setSquelch(m_basebandSink->getAudioActive() ? 1 : 0); response.getFt8DemodReport()->setSquelch(m_basebandSink->getAudioActive() ? 1 : 0);
response.getFt8DemodReport()->setAudioSampleRate(m_basebandSink->getAudioSampleRate());
response.getFt8DemodReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate()); response.getFt8DemodReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
} }
} }
@ -749,18 +718,9 @@ void FT8Demod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("volume") || force) { if (channelSettingsKeys.contains("volume") || force) {
swgFT8DemodSettings->setVolume(settings.m_volume); swgFT8DemodSettings->setVolume(settings.m_volume);
} }
if (channelSettingsKeys.contains("audioBinaural") || force) {
swgFT8DemodSettings->setAudioBinaural(settings.m_audioBinaural ? 1 : 0);
}
if (channelSettingsKeys.contains("audioFlipChannels") || force) {
swgFT8DemodSettings->setAudioFlipChannels(settings.m_audioFlipChannels ? 1 : 0);
}
if (channelSettingsKeys.contains("dsb") || force) { if (channelSettingsKeys.contains("dsb") || force) {
swgFT8DemodSettings->setDsb(settings.m_dsb ? 1 : 0); swgFT8DemodSettings->setDsb(settings.m_dsb ? 1 : 0);
} }
if (channelSettingsKeys.contains("audioMute") || force) {
swgFT8DemodSettings->setAudioMute(settings.m_audioMute ? 1 : 0);
}
if (channelSettingsKeys.contains("agc") || force) { if (channelSettingsKeys.contains("agc") || force) {
swgFT8DemodSettings->setAgc(settings.m_agc ? 1 : 0); swgFT8DemodSettings->setAgc(settings.m_agc ? 1 : 0);
} }
@ -783,7 +743,7 @@ void FT8Demod::webapiFormatChannelSettings(
swgFT8DemodSettings->setTitle(new QString(settings.m_title)); swgFT8DemodSettings->setTitle(new QString(settings.m_title));
} }
if (channelSettingsKeys.contains("audioDeviceName") || force) { if (channelSettingsKeys.contains("audioDeviceName") || force) {
swgFT8DemodSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName)); swgFT8DemodSettings->setFt8SampleRate(settings.m_ft8SampleRate);
} }
if (channelSettingsKeys.contains("streamIndex") || force) { if (channelSettingsKeys.contains("streamIndex") || force) {
swgFT8DemodSettings->setStreamIndex(settings.m_streamIndex); swgFT8DemodSettings->setStreamIndex(settings.m_streamIndex);

View File

@ -96,10 +96,8 @@ public:
} }
void setMessageQueueToGUI(MessageQueue* queue) override { ChannelAPI::setMessageQueueToGUI(queue); } void setMessageQueueToGUI(MessageQueue* queue) override { ChannelAPI::setMessageQueueToGUI(queue); }
uint32_t getAudioSampleRate() const { return m_running ? m_basebandSink->getAudioSampleRate() : 0; }
uint32_t getChannelSampleRate() const { return m_running ? m_basebandSink->getChannelSampleRate() : 0; } uint32_t getChannelSampleRate() const { return m_running ? m_basebandSink->getChannelSampleRate() : 0; }
double getMagSq() const { return m_running ? m_basebandSink->getMagSq() : 0.0; } double getMagSq() const { return m_running ? m_basebandSink->getMagSq() : 0.0; }
bool getAudioActive() const { return m_running && m_basebandSink->getAudioActive(); }
void getMagSqLevels(double& avg, double& peak, int& nbSamples) void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{ {

View File

@ -42,8 +42,6 @@ FT8DemodBaseband::FT8DemodBaseband() :
); );
DSPEngine::instance()->getAudioDeviceManager()->addAudioSink(m_sink.getAudioFifo(), getInputMessageQueue()); DSPEngine::instance()->getAudioDeviceManager()->addAudioSink(m_sink.getAudioFifo(), getInputMessageQueue());
m_audioSampleRate = DSPEngine::instance()->getAudioDeviceManager()->getOutputSampleRate();
m_sink.applyAudioSampleRate(m_audioSampleRate);
m_channelSampleRate = 0; m_channelSampleRate = 0;
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
@ -57,7 +55,6 @@ FT8DemodBaseband::~FT8DemodBaseband()
void FT8DemodBaseband::reset() void FT8DemodBaseband::reset()
{ {
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
m_sink.applyAudioSampleRate(DSPEngine::instance()->getAudioDeviceManager()->getOutputSampleRate());
m_sampleFifo.reset(); m_sampleFifo.reset();
m_channelSampleRate = 0; m_channelSampleRate = 0;
} }
@ -134,7 +131,7 @@ bool FT8DemodBaseband::handleMessage(const Message& cmd)
if (m_channelSampleRate != m_channelizer.getChannelSampleRate()) if (m_channelSampleRate != m_channelizer.getChannelSampleRate())
{ {
m_sink.applyAudioSampleRate(m_audioSampleRate); // reapply when channel sample rate changes m_sink.applyFT8SampleRate(m_settings.m_ft8SampleRate); // reapply when channel sample rate changes
m_channelSampleRate = m_channelizer.getChannelSampleRate(); m_channelSampleRate = m_channelizer.getChannelSampleRate();
} }
@ -150,12 +147,12 @@ void FT8DemodBaseband::applySettings(const FT8DemodSettings& settings, bool forc
{ {
if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force)
{ {
m_channelizer.setChannelization(m_audioSampleRate, settings.m_inputFrequencyOffset); m_channelizer.setChannelization(m_settings.m_ft8SampleRate, settings.m_inputFrequencyOffset);
m_sink.applyChannelSettings(m_channelizer.getChannelSampleRate(), m_channelizer.getChannelFrequencyOffset()); m_sink.applyChannelSettings(m_channelizer.getChannelSampleRate(), m_channelizer.getChannelFrequencyOffset());
if (m_channelSampleRate != m_channelizer.getChannelSampleRate()) if (m_channelSampleRate != m_channelizer.getChannelSampleRate())
{ {
m_sink.applyAudioSampleRate(m_audioSampleRate); // reapply when channel sample rate changes m_sink.applyFT8SampleRate(m_settings.m_ft8SampleRate); // reapply when channel sample rate changes
m_channelSampleRate = m_channelizer.getChannelSampleRate(); m_channelSampleRate = m_channelizer.getChannelSampleRate();
} }
} }
@ -164,36 +161,27 @@ void FT8DemodBaseband::applySettings(const FT8DemodSettings& settings, bool forc
{ {
if (m_spectrumVis) if (m_spectrumVis)
{ {
DSPSignalNotification *msg = new DSPSignalNotification(m_audioSampleRate/(1<<settings.m_filterBank[settings.m_filterIndex].m_spanLog2), 0); DSPSignalNotification *msg = new DSPSignalNotification(m_settings.m_ft8SampleRate/(1<<settings.m_filterBank[settings.m_filterIndex].m_spanLog2), 0);
m_spectrumVis->getInputMessageQueue()->push(msg); m_spectrumVis->getInputMessageQueue()->push(msg);
} }
} }
if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force) if ((settings.m_ft8SampleRate != m_settings.m_ft8SampleRate) || force)
{ {
AudioDeviceManager *audioDeviceManager = DSPEngine::instance()->getAudioDeviceManager(); m_sink.applyFT8SampleRate(settings.m_ft8SampleRate);
int audioDeviceIndex = audioDeviceManager->getOutputDeviceIndex(settings.m_audioDeviceName); m_channelizer.setChannelization(settings.m_ft8SampleRate, settings.m_inputFrequencyOffset);
audioDeviceManager->addAudioSink(m_sink.getAudioFifo(), getInputMessageQueue(), audioDeviceIndex); m_sink.applyChannelSettings(m_channelizer.getChannelSampleRate(), m_channelizer.getChannelFrequencyOffset());
unsigned int audioSampleRate = audioDeviceManager->getOutputSampleRate(audioDeviceIndex);
if (m_audioSampleRate != audioSampleRate) if (getMessageQueueToGUI())
{ {
m_sink.applyAudioSampleRate(audioSampleRate); DSPConfigureAudio *msg = new DSPConfigureAudio((int) settings.m_ft8SampleRate, DSPConfigureAudio::AudioOutput);
m_channelizer.setChannelization(audioSampleRate, settings.m_inputFrequencyOffset); getMessageQueueToGUI()->push(msg);
m_sink.applyChannelSettings(m_channelizer.getChannelSampleRate(), m_channelizer.getChannelFrequencyOffset()); }
m_audioSampleRate = audioSampleRate;
if (getMessageQueueToGUI()) if (m_spectrumVis)
{ {
DSPConfigureAudio *msg = new DSPConfigureAudio((int) audioSampleRate, DSPConfigureAudio::AudioOutput); DSPSignalNotification *msg = new DSPSignalNotification(settings.m_ft8SampleRate/(1<<m_settings.m_filterBank[settings.m_filterIndex].m_spanLog2), 0);
getMessageQueueToGUI()->push(msg); m_spectrumVis->getInputMessageQueue()->push(msg);
}
if (m_spectrumVis)
{
DSPSignalNotification *msg = new DSPSignalNotification(m_audioSampleRate/(1<<m_settings.m_filterBank[settings.m_filterIndex].m_spanLog2), 0);
m_spectrumVis->getInputMessageQueue()->push(msg);
}
} }
} }

View File

@ -68,7 +68,6 @@ public:
void setSpectrumSink(SpectrumVis* spectrumSink) { m_spectrumVis = spectrumSink; m_sink.setSpectrumSink(spectrumSink); } void setSpectrumSink(SpectrumVis* spectrumSink) { m_spectrumVis = spectrumSink; m_sink.setSpectrumSink(spectrumSink); }
double getMagSq() const { return m_sink.getMagSq(); } double getMagSq() const { return m_sink.getMagSq(); }
void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_sink.getMagSqLevels(avg, peak, nbSamples); } void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_sink.getMagSqLevels(avg, peak, nbSamples); }
unsigned int getAudioSampleRate() const { return m_audioSampleRate; }
bool getAudioActive() const { return m_sink.getAudioActive(); } bool getAudioActive() const { return m_sink.getAudioActive(); }
void setBasebandSampleRate(int sampleRate); void setBasebandSampleRate(int sampleRate);
void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; } void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; }
@ -82,7 +81,6 @@ private:
FT8DemodSink m_sink; FT8DemodSink m_sink;
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
FT8DemodSettings m_settings; FT8DemodSettings m_settings;
unsigned int m_audioSampleRate;
int m_channelSampleRate; int m_channelSampleRate;
MessageQueue *m_messageQueueToGUI; MessageQueue *m_messageQueueToGUI;
SpectrumVis *m_spectrumVis; SpectrumVis *m_spectrumVis;

View File

@ -96,15 +96,6 @@ bool FT8DemodGUI::handleMessage(const Message& message)
blockApplySettings(false); blockApplySettings(false);
return true; return true;
} }
else if (DSPConfigureAudio::match(message))
{
qDebug("FT8DemodGUI::handleMessage: DSPConfigureAudio: %d", m_ft8Demod->getAudioSampleRate());
applyBandwidths(1 + ui->spanLog2->maximum() - ui->spanLog2->value()); // will update spectrum details with new sample rate
blockApplySettings(true);
displaySettings();
blockApplySettings(false);
return true;
}
else if (DSPSignalNotification::match(message)) else if (DSPSignalNotification::match(message))
{ {
const DSPSignalNotification& notif = (const DSPSignalNotification&) message; const DSPSignalNotification& notif = (const DSPSignalNotification&) message;
@ -146,20 +137,6 @@ void FT8DemodGUI::channelMarkerHighlightedByCursor()
setHighlighted(m_channelMarker.getHighlighted()); setHighlighted(m_channelMarker.getHighlighted());
} }
void FT8DemodGUI::on_audioBinaural_toggled(bool binaural)
{
m_audioBinaural = binaural;
m_settings.m_audioBinaural = binaural;
applySettings();
}
void FT8DemodGUI::on_audioFlipChannels_toggled(bool flip)
{
m_audioFlipChannels = flip;
m_settings.m_audioFlipChannels = flip;
applySettings();
}
void FT8DemodGUI::on_dsb_toggled(bool dsb) void FT8DemodGUI::on_dsb_toggled(bool dsb)
{ {
ui->flipSidebands->setEnabled(!dsb); ui->flipSidebands->setEnabled(!dsb);
@ -230,13 +207,6 @@ void FT8DemodGUI::on_agcThresholdGate_valueChanged(int value)
applySettings(); applySettings();
} }
void FT8DemodGUI::on_audioMute_toggled(bool checked)
{
m_audioMute = checked;
m_settings.m_audioMute = checked;
applySettings();
}
void FT8DemodGUI::on_spanLog2_valueChanged(int value) void FT8DemodGUI::on_spanLog2_valueChanged(int value)
{ {
int s2max = spanLog2Max(); int s2max = spanLog2Max();
@ -366,9 +336,6 @@ FT8DemodGUI::FT8DemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_spectrumVis->setGLSpectrum(ui->glSpectrum); m_spectrumVis->setGLSpectrum(ui->glSpectrum);
m_ft8Demod->setMessageQueueToGUI(getInputMessageQueue()); m_ft8Demod->setMessageQueueToGUI(getInputMessageQueue());
CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute);
connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect(const QPoint &)));
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
@ -443,7 +410,7 @@ void FT8DemodGUI::applySettings(bool force)
unsigned int FT8DemodGUI::spanLog2Max() unsigned int FT8DemodGUI::spanLog2Max()
{ {
unsigned int spanLog2 = 0; unsigned int spanLog2 = 0;
for (; m_ft8Demod->getAudioSampleRate() / (1<<spanLog2) >= 1000; spanLog2++); for (; m_settings.m_ft8SampleRate / (1<<spanLog2) >= 1000; spanLog2++);
return spanLog2 == 0 ? 0 : spanLog2-1; return spanLog2 == 0 ? 0 : spanLog2-1;
} }
@ -455,10 +422,10 @@ void FT8DemodGUI::applyBandwidths(unsigned int spanLog2, bool force)
ui->spanLog2->setMaximum(limit); ui->spanLog2->setMaximum(limit);
bool dsb = ui->dsb->isChecked(); bool dsb = ui->dsb->isChecked();
//int spanLog2 = ui->spanLog2->value(); //int spanLog2 = ui->spanLog2->value();
m_spectrumRate = m_ft8Demod->getAudioSampleRate() / (1<<spanLog2); m_spectrumRate = m_settings.m_ft8SampleRate / (1<<spanLog2);
int bw = ui->BW->value(); int bw = ui->BW->value();
int lw = ui->lowCut->value(); int lw = ui->lowCut->value();
int bwMax = m_ft8Demod->getAudioSampleRate() / (100*(1<<spanLog2)); int bwMax = m_settings.m_ft8SampleRate / (100*(1<<spanLog2));
int tickInterval = m_spectrumRate / 1200; int tickInterval = m_spectrumRate / 1200;
tickInterval = tickInterval == 0 ? 1 : tickInterval; tickInterval = tickInterval == 0 ? 1 : tickInterval;
@ -598,9 +565,6 @@ void FT8DemodGUI::displaySettings()
ui->agc->setChecked(m_settings.m_agc); ui->agc->setChecked(m_settings.m_agc);
ui->agcClamping->setChecked(m_settings.m_agcClamping); ui->agcClamping->setChecked(m_settings.m_agcClamping);
ui->audioBinaural->setChecked(m_settings.m_audioBinaural);
ui->audioFlipChannels->setChecked(m_settings.m_audioFlipChannels);
ui->audioMute->setChecked(m_settings.m_audioMute);
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
ui->fftWindow->setCurrentIndex((int) m_settings.m_filterBank[m_settings.m_filterIndex].m_fftWindow); ui->fftWindow->setCurrentIndex((int) m_settings.m_filterBank[m_settings.m_filterIndex].m_fftWindow);
@ -692,20 +656,6 @@ void FT8DemodGUI::enterEvent(EnterEventType* event)
ChannelGUI::enterEvent(event); ChannelGUI::enterEvent(event);
} }
void FT8DemodGUI::audioSelect(const QPoint& p)
{
qDebug("FT8DemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.move(p);
audioSelect.exec();
if (audioSelect.m_selected)
{
m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
applySettings();
}
}
void FT8DemodGUI::tick() void FT8DemodGUI::tick()
{ {
double magsqAvg, magsqPeak; double magsqAvg, magsqPeak;
@ -723,31 +673,12 @@ void FT8DemodGUI::tick()
ui->channelPower->setText(tr("%1 dB").arg(powDbAvg, 0, 'f', 1)); ui->channelPower->setText(tr("%1 dB").arg(powDbAvg, 0, 'f', 1));
} }
int audioSampleRate = m_ft8Demod->getAudioSampleRate();
bool squelchOpen = m_ft8Demod->getAudioActive();
if ((audioSampleRate != m_audioSampleRate) || (squelchOpen != m_squelchOpen))
{
if (audioSampleRate < 0) {
ui->audioMute->setStyleSheet("QToolButton { background-color : red; }");
} else if (squelchOpen) {
ui->audioMute->setStyleSheet("QToolButton { background-color : green; }");
} else {
ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
}
m_audioSampleRate = audioSampleRate;
m_squelchOpen = squelchOpen;
}
m_tickCount++; m_tickCount++;
} }
void FT8DemodGUI::makeUIConnections() void FT8DemodGUI::makeUIConnections()
{ {
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &FT8DemodGUI::on_deltaFrequency_changed); QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &FT8DemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->audioBinaural, &QToolButton::toggled, this, &FT8DemodGUI::on_audioBinaural_toggled);
QObject::connect(ui->audioFlipChannels, &QToolButton::toggled, this, &FT8DemodGUI::on_audioFlipChannels_toggled);
QObject::connect(ui->dsb, &QToolButton::toggled, this, &FT8DemodGUI::on_dsb_toggled); QObject::connect(ui->dsb, &QToolButton::toggled, this, &FT8DemodGUI::on_dsb_toggled);
QObject::connect(ui->BW, &TickedSlider::valueChanged, this, &FT8DemodGUI::on_BW_valueChanged); QObject::connect(ui->BW, &TickedSlider::valueChanged, this, &FT8DemodGUI::on_BW_valueChanged);
QObject::connect(ui->lowCut, &TickedSlider::valueChanged, this, &FT8DemodGUI::on_lowCut_valueChanged); QObject::connect(ui->lowCut, &TickedSlider::valueChanged, this, &FT8DemodGUI::on_lowCut_valueChanged);
@ -757,7 +688,6 @@ void FT8DemodGUI::makeUIConnections()
QObject::connect(ui->agcTimeLog2, &QDial::valueChanged, this, &FT8DemodGUI::on_agcTimeLog2_valueChanged); QObject::connect(ui->agcTimeLog2, &QDial::valueChanged, this, &FT8DemodGUI::on_agcTimeLog2_valueChanged);
QObject::connect(ui->agcPowerThreshold, &QDial::valueChanged, this, &FT8DemodGUI::on_agcPowerThreshold_valueChanged); QObject::connect(ui->agcPowerThreshold, &QDial::valueChanged, this, &FT8DemodGUI::on_agcPowerThreshold_valueChanged);
QObject::connect(ui->agcThresholdGate, &QDial::valueChanged, this, &FT8DemodGUI::on_agcThresholdGate_valueChanged); QObject::connect(ui->agcThresholdGate, &QDial::valueChanged, this, &FT8DemodGUI::on_agcThresholdGate_valueChanged);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &FT8DemodGUI::on_audioMute_toggled);
QObject::connect(ui->spanLog2, &QSlider::valueChanged, this, &FT8DemodGUI::on_spanLog2_valueChanged); QObject::connect(ui->spanLog2, &QSlider::valueChanged, this, &FT8DemodGUI::on_spanLog2_valueChanged);
QObject::connect(ui->flipSidebands, &QPushButton::clicked, this, &FT8DemodGUI::on_flipSidebands_clicked); QObject::connect(ui->flipSidebands, &QPushButton::clicked, this, &FT8DemodGUI::on_flipSidebands_clicked);
QObject::connect(ui->fftWindow, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FT8DemodGUI::on_fftWindow_currentIndexChanged); QObject::connect(ui->fftWindow, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FT8DemodGUI::on_fftWindow_currentIndexChanged);

View File

@ -109,8 +109,6 @@ private:
private slots: private slots:
void on_deltaFrequency_changed(qint64 value); void on_deltaFrequency_changed(qint64 value);
void on_audioBinaural_toggled(bool binaural);
void on_audioFlipChannels_toggled(bool flip);
void on_dsb_toggled(bool dsb); void on_dsb_toggled(bool dsb);
void on_BW_valueChanged(int value); void on_BW_valueChanged(int value);
void on_lowCut_valueChanged(int value); void on_lowCut_valueChanged(int value);
@ -120,7 +118,6 @@ private slots:
void on_agcTimeLog2_valueChanged(int value); void on_agcTimeLog2_valueChanged(int value);
void on_agcPowerThreshold_valueChanged(int value); void on_agcPowerThreshold_valueChanged(int value);
void on_agcThresholdGate_valueChanged(int value); void on_agcThresholdGate_valueChanged(int value);
void on_audioMute_toggled(bool checked);
void on_spanLog2_valueChanged(int value); void on_spanLog2_valueChanged(int value);
void on_flipSidebands_clicked(bool checked); void on_flipSidebands_clicked(bool checked);
void on_fftWindow_currentIndexChanged(int index); void on_fftWindow_currentIndexChanged(int index);
@ -128,7 +125,6 @@ private slots:
void onWidgetRolled(QWidget* widget, bool rollDown); void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p); void onMenuDialogCalled(const QPoint& p);
void handleInputMessages(); void handleInputMessages();
void audioSelect(const QPoint& p);
void tick(); void tick();
}; };

View File

@ -169,42 +169,6 @@
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="audioOptionsLayout"> <layout class="QHBoxLayout" name="audioOptionsLayout">
<item>
<widget class="QToolButton" name="audioBinaural">
<property name="toolTip">
<string>Toggle btw Mono and Binaural I/Q audio</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/mono.png</normaloff>
<normalon>:/stereo.png</normalon>:/mono.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="audioFlipChannels">
<property name="toolTip">
<string>Flip left/right audio channels</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/flip_lr.png</normaloff>
<normalon>:/flip_rl.png</normalon>:/flip_lr.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="Line" name="line_4"> <widget class="Line" name="line_4">
<property name="orientation"> <property name="orientation">
@ -1010,24 +974,6 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QToolButton" name="audioMute">
<property name="toolTip">
<string>Mute/Unmute audio</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/sound_on.png</normaloff>
<normalon>:/sound_off.png</normalon>:/sound_on.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

View File

@ -41,10 +41,7 @@ FT8DemodSettings::FT8DemodSettings() :
void FT8DemodSettings::resetToDefaults() void FT8DemodSettings::resetToDefaults()
{ {
m_audioBinaural = false;
m_audioFlipChannels = false;
m_dsb = false; m_dsb = false;
m_audioMute = false;
m_agc = false; m_agc = false;
m_agcClamping = false; m_agcClamping = false;
m_agcPowerThreshold = -100; m_agcPowerThreshold = -100;
@ -52,9 +49,9 @@ void FT8DemodSettings::resetToDefaults()
m_agcTimeLog2 = 7; m_agcTimeLog2 = 7;
m_volume = 1.0; m_volume = 1.0;
m_inputFrequencyOffset = 0; m_inputFrequencyOffset = 0;
m_rgbColor = QColor(0, 255, 0).rgb(); m_rgbColor = QColor(0, 192, 255).rgb();
m_title = "FT8 Demodulator"; m_title = "FT8 Demodulator";
m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName; m_ft8SampleRate = 12000;
m_streamIndex = 0; m_streamIndex = 0;
m_useReverseAPI = false; m_useReverseAPI = false;
m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIAddress = "127.0.0.1";
@ -77,8 +74,6 @@ QByteArray FT8DemodSettings::serialize() const
} }
s.writeU32(5, m_rgbColor); s.writeU32(5, m_rgbColor);
s.writeBool(8, m_audioBinaural);
s.writeBool(9, m_audioFlipChannels);
s.writeBool(10, m_dsb); s.writeBool(10, m_dsb);
s.writeBool(11, m_agc); s.writeBool(11, m_agc);
s.writeS32(12, m_agcTimeLog2); s.writeS32(12, m_agcTimeLog2);
@ -86,7 +81,7 @@ QByteArray FT8DemodSettings::serialize() const
s.writeS32(14, m_agcThresholdGate); s.writeS32(14, m_agcThresholdGate);
s.writeBool(15, m_agcClamping); s.writeBool(15, m_agcClamping);
s.writeString(16, m_title); s.writeString(16, m_title);
s.writeString(17, m_audioDeviceName); s.writeS32(17, m_ft8SampleRate);
s.writeBool(18, m_useReverseAPI); s.writeBool(18, m_useReverseAPI);
s.writeString(19, m_reverseAPIAddress); s.writeString(19, m_reverseAPIAddress);
s.writeU32(20, m_reverseAPIPort); s.writeU32(20, m_reverseAPIPort);
@ -142,8 +137,6 @@ bool FT8DemodSettings::deserialize(const QByteArray& data)
} }
d.readU32(5, &m_rgbColor); d.readU32(5, &m_rgbColor);
d.readBool(8, &m_audioBinaural, false);
d.readBool(9, &m_audioFlipChannels, false);
d.readBool(10, &m_dsb, false); d.readBool(10, &m_dsb, false);
d.readBool(11, &m_agc, false); d.readBool(11, &m_agc, false);
d.readS32(12, &m_agcTimeLog2, 7); d.readS32(12, &m_agcTimeLog2, 7);
@ -151,7 +144,7 @@ bool FT8DemodSettings::deserialize(const QByteArray& data)
d.readS32(14, &m_agcThresholdGate, 4); d.readS32(14, &m_agcThresholdGate, 4);
d.readBool(15, &m_agcClamping, false); d.readBool(15, &m_agcClamping, false);
d.readString(16, &m_title, "SSB Demodulator"); d.readString(16, &m_title, "SSB Demodulator");
d.readString(17, &m_audioDeviceName, AudioDeviceManager::m_defaultDeviceName); d.readS32(17, &m_ft8SampleRate, 12000);
d.readBool(18, &m_useReverseAPI, false); d.readBool(18, &m_useReverseAPI, false);
d.readString(19, &m_reverseAPIAddress, "127.0.0.1"); d.readString(19, &m_reverseAPIAddress, "127.0.0.1");
d.readU32(20, &utmp, 0); d.readU32(20, &utmp, 0);

View File

@ -47,10 +47,7 @@ struct FT8DemodSettings
// Real m_lowCutoff; // Real m_lowCutoff;
Real m_volume; Real m_volume;
// int m_spanLog2; // int m_spanLog2;
bool m_audioBinaural;
bool m_audioFlipChannels;
bool m_dsb; bool m_dsb;
bool m_audioMute;
bool m_agc; bool m_agc;
bool m_agcClamping; bool m_agcClamping;
int m_agcTimeLog2; int m_agcTimeLog2;
@ -58,7 +55,7 @@ struct FT8DemodSettings
int m_agcThresholdGate; int m_agcThresholdGate;
quint32 m_rgbColor; quint32 m_rgbColor;
QString m_title; QString m_title;
QString m_audioDeviceName; int m_ft8SampleRate;
int m_streamIndex; //!< MIMO channel. Not relevant when connected to SI (single Rx). int m_streamIndex; //!< MIMO channel. Not relevant when connected to SI (single Rx).
bool m_useReverseAPI; bool m_useReverseAPI;
QString m_reverseAPIAddress; QString m_reverseAPIAddress;

View File

@ -37,10 +37,7 @@ const int FT8DemodSink::m_ssbFftLen = 1024;
const int FT8DemodSink::m_agcTarget = 3276; // 32768/10 -10 dB amplitude => -20 dB power: center of normal signal const int FT8DemodSink::m_agcTarget = 3276; // 32768/10 -10 dB amplitude => -20 dB power: center of normal signal
FT8DemodSink::FT8DemodSink() : FT8DemodSink::FT8DemodSink() :
m_audioBinaual(false),
m_audioFlipChannels(false),
m_dsb(false), m_dsb(false),
m_audioMute(false),
m_agc(12000, m_agcTarget, 1e-2), m_agc(12000, m_agcTarget, 1e-2),
m_agcActive(false), m_agcActive(false),
m_agcClamping(false), m_agcClamping(false),
@ -51,7 +48,7 @@ FT8DemodSink::FT8DemodSink() :
m_audioActive(false), m_audioActive(false),
m_spectrumSink(nullptr), m_spectrumSink(nullptr),
m_audioFifo(24000), m_audioFifo(24000),
m_audioSampleRate(48000) m_ft8SampleRate(12000)
{ {
m_Bandwidth = 5000; m_Bandwidth = 5000;
m_LowCutoff = 300; m_LowCutoff = 300;
@ -77,8 +74,8 @@ FT8DemodSink::FT8DemodSink() :
m_agc.setClampMax(SDR_RX_SCALED/100.0); m_agc.setClampMax(SDR_RX_SCALED/100.0);
m_agc.setClamping(m_agcClamping); m_agc.setClamping(m_agcClamping);
SSBFilter = new fftfilt(m_LowCutoff / m_audioSampleRate, m_Bandwidth / m_audioSampleRate, m_ssbFftLen); SSBFilter = new fftfilt(m_LowCutoff / m_ft8SampleRate, m_Bandwidth / m_ft8SampleRate, m_ssbFftLen);
DSBFilter = new fftfilt((2.0f * m_Bandwidth) / m_audioSampleRate, 2 * m_ssbFftLen); DSBFilter = new fftfilt((2.0f * m_Bandwidth) / m_ft8SampleRate, 2 * m_ssbFftLen);
applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, true); applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, true);
applySettings(m_settings, true); applySettings(m_settings, true);
@ -175,66 +172,39 @@ void FT8DemodSink::processOneSample(Complex &ci)
m_audioActive = delayedSample.real() != 0.0; m_audioActive = delayedSample.real() != 0.0;
m_squelchDelayLine.write(sideband[i]*agcVal); m_squelchDelayLine.write(sideband[i]*agcVal);
if (m_audioMute) fftfilt::cmplx z = m_agcActive ? delayedSample * m_agc.getStepValue() : delayedSample;
Real demod = (z.real() + z.imag()) * 0.7;
qint16 sample = (qint16)(demod * m_volume);
m_audioBuffer[m_audioBufferFill].l = sample;
m_audioBuffer[m_audioBufferFill].r = sample;
m_demodBuffer[m_demodBufferFill++] = (z.real() + z.imag()) * 0.7;
if (m_demodBufferFill >= m_demodBuffer.size())
{ {
m_audioBuffer[m_audioBufferFill].r = 0; QList<ObjectPipe*> dataPipes;
m_audioBuffer[m_audioBufferFill].l = 0; MainCore::instance()->getDataPipes().getDataPipes(m_channel, "demod", dataPipes);
}
else
{
fftfilt::cmplx z = m_agcActive ? delayedSample * m_agc.getStepValue() : delayedSample;
if (m_audioBinaual) if (dataPipes.size() > 0)
{ {
if (m_audioFlipChannels) QList<ObjectPipe*>::iterator it = dataPipes.begin();
for (; it != dataPipes.end(); ++it)
{ {
m_audioBuffer[m_audioBufferFill].r = (qint16)(z.imag() * m_volume); DataFifo *fifo = qobject_cast<DataFifo*>((*it)->m_element);
m_audioBuffer[m_audioBufferFill].l = (qint16)(z.real() * m_volume);
}
else
{
m_audioBuffer[m_audioBufferFill].r = (qint16)(z.real() * m_volume);
m_audioBuffer[m_audioBufferFill].l = (qint16)(z.imag() * m_volume);
}
m_demodBuffer[m_demodBufferFill++] = z.real(); if (fifo)
m_demodBuffer[m_demodBufferFill++] = z.imag();
}
else
{
Real demod = (z.real() + z.imag()) * 0.7;
qint16 sample = (qint16)(demod * m_volume);
m_audioBuffer[m_audioBufferFill].l = sample;
m_audioBuffer[m_audioBufferFill].r = sample;
m_demodBuffer[m_demodBufferFill++] = (z.real() + z.imag()) * 0.7;
}
if (m_demodBufferFill >= m_demodBuffer.size())
{
QList<ObjectPipe*> dataPipes;
MainCore::instance()->getDataPipes().getDataPipes(m_channel, "demod", dataPipes);
if (dataPipes.size() > 0)
{
QList<ObjectPipe*>::iterator it = dataPipes.begin();
for (; it != dataPipes.end(); ++it)
{ {
DataFifo *fifo = qobject_cast<DataFifo*>((*it)->m_element); fifo->write(
(quint8*) &m_demodBuffer[0],
if (fifo) m_demodBuffer.size() * sizeof(qint16),
{ DataFifo::DataTypeI16
fifo->write( );
(quint8*) &m_demodBuffer[0],
m_demodBuffer.size() * sizeof(qint16),
m_audioBinaual ? DataFifo::DataTypeCI16 : DataFifo::DataTypeI16
);
}
} }
} }
m_demodBufferFill = 0;
} }
m_demodBufferFill = 0;
} }
++m_audioBufferFill; ++m_audioBufferFill;
@ -275,16 +245,16 @@ void FT8DemodSink::applyChannelSettings(int channelSampleRate, int channelFreque
Real interpolatorBandwidth = (m_Bandwidth * 1.5f) > channelSampleRate ? channelSampleRate : (m_Bandwidth * 1.5f); Real interpolatorBandwidth = (m_Bandwidth * 1.5f) > channelSampleRate ? channelSampleRate : (m_Bandwidth * 1.5f);
m_interpolator.create(16, channelSampleRate, interpolatorBandwidth, 2.0f); m_interpolator.create(16, channelSampleRate, interpolatorBandwidth, 2.0f);
m_interpolatorDistanceRemain = 0; m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) channelSampleRate / (Real) m_audioSampleRate; m_interpolatorDistance = (Real) channelSampleRate / (Real) m_ft8SampleRate;
} }
m_channelSampleRate = channelSampleRate; m_channelSampleRate = channelSampleRate;
m_channelFrequencyOffset = channelFrequencyOffset; m_channelFrequencyOffset = channelFrequencyOffset;
} }
void FT8DemodSink::applyAudioSampleRate(int sampleRate) void FT8DemodSink::applyFT8SampleRate(int sampleRate)
{ {
qDebug("FT8DemodSink::applyAudioSampleRate: %d", sampleRate); qDebug("FT8DemodSink::applyFT8SampleRate: %d", sampleRate);
Real interpolatorBandwidth = (m_Bandwidth * 1.5f) > m_channelSampleRate ? m_channelSampleRate : (m_Bandwidth * 1.5f); Real interpolatorBandwidth = (m_Bandwidth * 1.5f) > m_channelSampleRate ? m_channelSampleRate : (m_Bandwidth * 1.5f);
m_interpolator.create(16, m_channelSampleRate, interpolatorBandwidth, 2.0f); m_interpolator.create(16, m_channelSampleRate, interpolatorBandwidth, 2.0f);
@ -311,7 +281,7 @@ void FT8DemodSink::applyAudioSampleRate(int sampleRate)
} }
m_audioFifo.setSize(sampleRate); m_audioFifo.setSize(sampleRate);
m_audioSampleRate = sampleRate; m_ft8SampleRate = sampleRate;
QList<ObjectPipe*> pipes; QList<ObjectPipe*> pipes;
@ -342,16 +312,13 @@ void FT8DemodSink::applySettings(const FT8DemodSettings& settings, bool force)
<< " m_lowCutoff: " << settings.m_filterBank[settings.m_filterIndex].m_lowCutoff << " m_lowCutoff: " << settings.m_filterBank[settings.m_filterIndex].m_lowCutoff
<< " m_fftWindow: " << settings.m_filterBank[settings.m_filterIndex].m_fftWindow << "]" << " m_fftWindow: " << settings.m_filterBank[settings.m_filterIndex].m_fftWindow << "]"
<< " m_volume: " << settings.m_volume << " m_volume: " << settings.m_volume
<< " m_audioBinaual: " << settings.m_audioBinaural
<< " m_audioFlipChannels: " << settings.m_audioFlipChannels
<< " m_dsb: " << settings.m_dsb << " m_dsb: " << settings.m_dsb
<< " m_audioMute: " << settings.m_audioMute
<< " m_agcActive: " << settings.m_agc << " m_agcActive: " << settings.m_agc
<< " m_agcClamping: " << settings.m_agcClamping << " m_agcClamping: " << settings.m_agcClamping
<< " m_agcTimeLog2: " << settings.m_agcTimeLog2 << " m_agcTimeLog2: " << settings.m_agcTimeLog2
<< " agcPowerThreshold: " << settings.m_agcPowerThreshold << " agcPowerThreshold: " << settings.m_agcPowerThreshold
<< " agcThresholdGate: " << settings.m_agcThresholdGate << " agcThresholdGate: " << settings.m_agcThresholdGate
<< " m_audioDeviceName: " << settings.m_audioDeviceName << " m_ft8SampleRate: " << settings.m_ft8SampleRate
<< " m_streamIndex: " << settings.m_streamIndex << " m_streamIndex: " << settings.m_streamIndex
<< " m_useReverseAPI: " << settings.m_useReverseAPI << " m_useReverseAPI: " << settings.m_useReverseAPI
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress << " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
@ -389,9 +356,9 @@ void FT8DemodSink::applySettings(const FT8DemodSettings& settings, bool force)
Real interpolatorBandwidth = (m_Bandwidth * 1.5f) > m_channelSampleRate ? m_channelSampleRate : (m_Bandwidth * 1.5f); Real interpolatorBandwidth = (m_Bandwidth * 1.5f) > m_channelSampleRate ? m_channelSampleRate : (m_Bandwidth * 1.5f);
m_interpolator.create(16, m_channelSampleRate, interpolatorBandwidth, 2.0f); m_interpolator.create(16, m_channelSampleRate, interpolatorBandwidth, 2.0f);
m_interpolatorDistanceRemain = 0; m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) m_channelSampleRate / (Real) m_audioSampleRate; m_interpolatorDistance = (Real) m_channelSampleRate / (Real) m_ft8SampleRate;
SSBFilter->create_filter(m_LowCutoff / (float) m_audioSampleRate, m_Bandwidth / (float) m_audioSampleRate, settings.m_filterBank[settings.m_filterIndex].m_fftWindow); SSBFilter->create_filter(m_LowCutoff / (float) m_ft8SampleRate, m_Bandwidth / (float) m_ft8SampleRate, settings.m_filterBank[settings.m_filterIndex].m_fftWindow);
DSBFilter->create_dsb_filter(m_Bandwidth / (float) m_audioSampleRate, settings.m_filterBank[settings.m_filterIndex].m_fftWindow); DSBFilter->create_dsb_filter(m_Bandwidth / (float) m_ft8SampleRate, settings.m_filterBank[settings.m_filterIndex].m_fftWindow);
} }
if ((m_settings.m_volume != settings.m_volume) || force) if ((m_settings.m_volume != settings.m_volume) || force)
@ -405,10 +372,10 @@ void FT8DemodSink::applySettings(const FT8DemodSettings& settings, bool force)
(m_settings.m_agcThresholdGate != settings.m_agcThresholdGate) || (m_settings.m_agcThresholdGate != settings.m_agcThresholdGate) ||
(m_settings.m_agcClamping != settings.m_agcClamping) || force) (m_settings.m_agcClamping != settings.m_agcClamping) || force)
{ {
int agcNbSamples = (m_audioSampleRate / 1000) * (1<<settings.m_agcTimeLog2); int agcNbSamples = (m_ft8SampleRate / 1000) * (1<<settings.m_agcTimeLog2);
m_agc.setThresholdEnable(settings.m_agcPowerThreshold != -FT8DemodSettings::m_minPowerThresholdDB); m_agc.setThresholdEnable(settings.m_agcPowerThreshold != -FT8DemodSettings::m_minPowerThresholdDB);
double agcPowerThreshold = CalcDb::powerFromdB(settings.m_agcPowerThreshold) * (SDR_RX_SCALED*SDR_RX_SCALED); double agcPowerThreshold = CalcDb::powerFromdB(settings.m_agcPowerThreshold) * (SDR_RX_SCALED*SDR_RX_SCALED);
int agcThresholdGate = (m_audioSampleRate / 1000) * settings.m_agcThresholdGate; // ms int agcThresholdGate = (m_ft8SampleRate / 1000) * settings.m_agcThresholdGate; // ms
bool agcClamping = settings.m_agcClamping; bool agcClamping = settings.m_agcClamping;
if (m_agcNbSamples != agcNbSamples) if (m_agcNbSamples != agcNbSamples)
@ -444,10 +411,7 @@ void FT8DemodSink::applySettings(const FT8DemodSettings& settings, bool force)
} }
m_spanLog2 = settings.m_filterBank[settings.m_filterIndex].m_spanLog2; m_spanLog2 = settings.m_filterBank[settings.m_filterIndex].m_spanLog2;
m_audioBinaual = settings.m_audioBinaural;
m_audioFlipChannels = settings.m_audioFlipChannels;
m_dsb = settings.m_dsb; m_dsb = settings.m_dsb;
m_audioMute = settings.m_audioMute;
m_agcActive = settings.m_agc; m_agcActive = settings.m_agc;
m_settings = settings; m_settings = settings;
} }

View File

@ -43,7 +43,7 @@ public:
void setSpectrumSink(SpectrumVis* spectrumSink) { m_spectrumSink = spectrumSink; } void setSpectrumSink(SpectrumVis* spectrumSink) { m_spectrumSink = spectrumSink; }
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false); void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false);
void applySettings(const FT8DemodSettings& settings, bool force = false); void applySettings(const FT8DemodSettings& settings, bool force = false);
void applyAudioSampleRate(int sampleRate); void applyFT8SampleRate(int sampleRate);
AudioFifo *getAudioFifo() { return &m_audioFifo; } AudioFifo *getAudioFifo() { return &m_audioFifo; }
double getMagSq() const { return m_magsq; } double getMagSq() const { return m_magsq; }
@ -91,11 +91,8 @@ private:
int m_undersampleCount; int m_undersampleCount;
int m_channelSampleRate; int m_channelSampleRate;
int m_channelFrequencyOffset; int m_channelFrequencyOffset;
bool m_audioBinaual;
bool m_audioFlipChannels;
bool m_usb; bool m_usb;
bool m_dsb; bool m_dsb;
bool m_audioMute;
double m_magsq; double m_magsq;
double m_magsqSum; double m_magsqSum;
double m_magsqPeak; double m_magsqPeak;
@ -123,7 +120,7 @@ private:
AudioVector m_audioBuffer; AudioVector m_audioBuffer;
uint m_audioBufferFill; uint m_audioBufferFill;
AudioFifo m_audioFifo; AudioFifo m_audioFifo;
quint32 m_audioSampleRate; quint32 m_ft8SampleRate;
QVector<qint16> m_demodBuffer; QVector<qint16> m_demodBuffer;
int m_demodBufferFill; int m_demodBufferFill;

View File

@ -5573,9 +5573,6 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"description" : "Audio squelch status (1 if open else 0)" "description" : "Audio squelch status (1 if open else 0)"
}, },
"audioSampleRate" : {
"type" : "integer"
},
"channelSampleRate" : { "channelSampleRate" : {
"type" : "integer" "type" : "integer"
} }
@ -5610,22 +5607,10 @@ margin-bottom: 20px;
"type" : "number", "type" : "number",
"format" : "float" "format" : "float"
}, },
"audioBinaural" : {
"type" : "integer",
"description" : "Audio binaural mode (1 if active else 0)"
},
"audioFlipChannels" : {
"type" : "integer",
"description" : "Flip audio channels (1 if flipped else 0)"
},
"dsb" : { "dsb" : {
"type" : "integer", "type" : "integer",
"description" : "Double sidebands mode (1 if DSB else 0)" "description" : "Double sidebands mode (1 if DSB else 0)"
}, },
"audioMute" : {
"type" : "integer",
"description" : "Mute audio (1 if muted else 0)"
},
"agc" : { "agc" : {
"type" : "integer", "type" : "integer",
"description" : "AGC (1 if AGC active else 0)" "description" : "AGC (1 if AGC active else 0)"
@ -5652,8 +5637,8 @@ margin-bottom: 20px;
"title" : { "title" : {
"type" : "string" "type" : "string"
}, },
"audioDeviceName" : { "ft8SampleRate" : {
"type" : "string" "type" : "integer"
}, },
"streamIndex" : { "streamIndex" : {
"type" : "integer", "type" : "integer",
@ -56911,7 +56896,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2023-01-14T23:57:54.939+01:00 Generated 2023-01-15T03:28:53.541+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -30,18 +30,9 @@ FT8DemodSettings:
volume: volume:
type: number type: number
format: float format: float
audioBinaural:
description: Audio binaural mode (1 if active else 0)
type: integer
audioFlipChannels:
description: Flip audio channels (1 if flipped else 0)
type: integer
dsb: dsb:
description: Double sidebands mode (1 if DSB else 0) description: Double sidebands mode (1 if DSB else 0)
type: integer type: integer
audioMute:
description: Mute audio (1 if muted else 0)
type: integer
agc: agc:
description: AGC (1 if AGC active else 0) description: AGC (1 if AGC active else 0)
type: integer type: integer
@ -61,8 +52,8 @@ FT8DemodSettings:
type: integer type: integer
title: title:
type: string type: string
audioDeviceName: ft8SampleRate:
type: string type: integer
streamIndex: streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx). description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer type: integer
@ -94,7 +85,5 @@ FT8DemodReport:
squelch: squelch:
description: Audio squelch status (1 if open else 0) description: Audio squelch status (1 if open else 0)
type: integer type: integer
audioSampleRate:
type: integer
channelSampleRate: channelSampleRate:
type: integer type: integer

View File

@ -30,18 +30,9 @@ FT8DemodSettings:
volume: volume:
type: number type: number
format: float format: float
audioBinaural:
description: Audio binaural mode (1 if active else 0)
type: integer
audioFlipChannels:
description: Flip audio channels (1 if flipped else 0)
type: integer
dsb: dsb:
description: Double sidebands mode (1 if DSB else 0) description: Double sidebands mode (1 if DSB else 0)
type: integer type: integer
audioMute:
description: Mute audio (1 if muted else 0)
type: integer
agc: agc:
description: AGC (1 if AGC active else 0) description: AGC (1 if AGC active else 0)
type: integer type: integer
@ -61,8 +52,8 @@ FT8DemodSettings:
type: integer type: integer
title: title:
type: string type: string
audioDeviceName: ft8SampleRate:
type: string type: integer
streamIndex: streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx). description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer type: integer
@ -94,7 +85,5 @@ FT8DemodReport:
squelch: squelch:
description: Audio squelch status (1 if open else 0) description: Audio squelch status (1 if open else 0)
type: integer type: integer
audioSampleRate:
type: integer
channelSampleRate: channelSampleRate:
type: integer type: integer

View File

@ -5573,9 +5573,6 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"description" : "Audio squelch status (1 if open else 0)" "description" : "Audio squelch status (1 if open else 0)"
}, },
"audioSampleRate" : {
"type" : "integer"
},
"channelSampleRate" : { "channelSampleRate" : {
"type" : "integer" "type" : "integer"
} }
@ -5610,22 +5607,10 @@ margin-bottom: 20px;
"type" : "number", "type" : "number",
"format" : "float" "format" : "float"
}, },
"audioBinaural" : {
"type" : "integer",
"description" : "Audio binaural mode (1 if active else 0)"
},
"audioFlipChannels" : {
"type" : "integer",
"description" : "Flip audio channels (1 if flipped else 0)"
},
"dsb" : { "dsb" : {
"type" : "integer", "type" : "integer",
"description" : "Double sidebands mode (1 if DSB else 0)" "description" : "Double sidebands mode (1 if DSB else 0)"
}, },
"audioMute" : {
"type" : "integer",
"description" : "Mute audio (1 if muted else 0)"
},
"agc" : { "agc" : {
"type" : "integer", "type" : "integer",
"description" : "AGC (1 if AGC active else 0)" "description" : "AGC (1 if AGC active else 0)"
@ -5652,8 +5637,8 @@ margin-bottom: 20px;
"title" : { "title" : {
"type" : "string" "type" : "string"
}, },
"audioDeviceName" : { "ft8SampleRate" : {
"type" : "string" "type" : "integer"
}, },
"streamIndex" : { "streamIndex" : {
"type" : "integer", "type" : "integer",
@ -56911,7 +56896,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2023-01-14T23:57:54.939+01:00 Generated 2023-01-15T03:28:53.541+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -32,8 +32,6 @@ SWGFT8DemodReport::SWGFT8DemodReport() {
m_channel_power_db_isSet = false; m_channel_power_db_isSet = false;
squelch = 0; squelch = 0;
m_squelch_isSet = false; m_squelch_isSet = false;
audio_sample_rate = 0;
m_audio_sample_rate_isSet = false;
channel_sample_rate = 0; channel_sample_rate = 0;
m_channel_sample_rate_isSet = false; m_channel_sample_rate_isSet = false;
} }
@ -48,8 +46,6 @@ SWGFT8DemodReport::init() {
m_channel_power_db_isSet = false; m_channel_power_db_isSet = false;
squelch = 0; squelch = 0;
m_squelch_isSet = false; m_squelch_isSet = false;
audio_sample_rate = 0;
m_audio_sample_rate_isSet = false;
channel_sample_rate = 0; channel_sample_rate = 0;
m_channel_sample_rate_isSet = false; m_channel_sample_rate_isSet = false;
} }
@ -59,7 +55,6 @@ SWGFT8DemodReport::cleanup() {
} }
SWGFT8DemodReport* SWGFT8DemodReport*
@ -77,8 +72,6 @@ SWGFT8DemodReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&squelch, pJson["squelch"], "qint32", ""); ::SWGSDRangel::setValue(&squelch, pJson["squelch"], "qint32", "");
::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", ""); ::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
} }
@ -103,9 +96,6 @@ SWGFT8DemodReport::asJsonObject() {
if(m_squelch_isSet){ if(m_squelch_isSet){
obj->insert("squelch", QJsonValue(squelch)); obj->insert("squelch", QJsonValue(squelch));
} }
if(m_audio_sample_rate_isSet){
obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
}
if(m_channel_sample_rate_isSet){ if(m_channel_sample_rate_isSet){
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate)); obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
} }
@ -133,16 +123,6 @@ SWGFT8DemodReport::setSquelch(qint32 squelch) {
this->m_squelch_isSet = true; this->m_squelch_isSet = true;
} }
qint32
SWGFT8DemodReport::getAudioSampleRate() {
return audio_sample_rate;
}
void
SWGFT8DemodReport::setAudioSampleRate(qint32 audio_sample_rate) {
this->audio_sample_rate = audio_sample_rate;
this->m_audio_sample_rate_isSet = true;
}
qint32 qint32
SWGFT8DemodReport::getChannelSampleRate() { SWGFT8DemodReport::getChannelSampleRate() {
return channel_sample_rate; return channel_sample_rate;
@ -164,9 +144,6 @@ SWGFT8DemodReport::isSet(){
if(m_squelch_isSet){ if(m_squelch_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(m_audio_sample_rate_isSet){
isObjectUpdated = true; break;
}
if(m_channel_sample_rate_isSet){ if(m_channel_sample_rate_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }

View File

@ -47,9 +47,6 @@ public:
qint32 getSquelch(); qint32 getSquelch();
void setSquelch(qint32 squelch); void setSquelch(qint32 squelch);
qint32 getAudioSampleRate();
void setAudioSampleRate(qint32 audio_sample_rate);
qint32 getChannelSampleRate(); qint32 getChannelSampleRate();
void setChannelSampleRate(qint32 channel_sample_rate); void setChannelSampleRate(qint32 channel_sample_rate);
@ -63,9 +60,6 @@ private:
qint32 squelch; qint32 squelch;
bool m_squelch_isSet; bool m_squelch_isSet;
qint32 audio_sample_rate;
bool m_audio_sample_rate_isSet;
qint32 channel_sample_rate; qint32 channel_sample_rate;
bool m_channel_sample_rate_isSet; bool m_channel_sample_rate_isSet;

View File

@ -42,14 +42,8 @@ SWGFT8DemodSettings::SWGFT8DemodSettings() {
m_fft_window_isSet = false; m_fft_window_isSet = false;
volume = 0.0f; volume = 0.0f;
m_volume_isSet = false; m_volume_isSet = false;
audio_binaural = 0;
m_audio_binaural_isSet = false;
audio_flip_channels = 0;
m_audio_flip_channels_isSet = false;
dsb = 0; dsb = 0;
m_dsb_isSet = false; m_dsb_isSet = false;
audio_mute = 0;
m_audio_mute_isSet = false;
agc = 0; agc = 0;
m_agc_isSet = false; m_agc_isSet = false;
agc_clamping = 0; agc_clamping = 0;
@ -64,8 +58,8 @@ SWGFT8DemodSettings::SWGFT8DemodSettings() {
m_rgb_color_isSet = false; m_rgb_color_isSet = false;
title = nullptr; title = nullptr;
m_title_isSet = false; m_title_isSet = false;
audio_device_name = nullptr; ft8_sample_rate = 0;
m_audio_device_name_isSet = false; m_ft8_sample_rate_isSet = false;
stream_index = 0; stream_index = 0;
m_stream_index_isSet = false; m_stream_index_isSet = false;
use_reverse_api = 0; use_reverse_api = 0;
@ -106,14 +100,8 @@ SWGFT8DemodSettings::init() {
m_fft_window_isSet = false; m_fft_window_isSet = false;
volume = 0.0f; volume = 0.0f;
m_volume_isSet = false; m_volume_isSet = false;
audio_binaural = 0;
m_audio_binaural_isSet = false;
audio_flip_channels = 0;
m_audio_flip_channels_isSet = false;
dsb = 0; dsb = 0;
m_dsb_isSet = false; m_dsb_isSet = false;
audio_mute = 0;
m_audio_mute_isSet = false;
agc = 0; agc = 0;
m_agc_isSet = false; m_agc_isSet = false;
agc_clamping = 0; agc_clamping = 0;
@ -128,8 +116,8 @@ SWGFT8DemodSettings::init() {
m_rgb_color_isSet = false; m_rgb_color_isSet = false;
title = new QString(""); title = new QString("");
m_title_isSet = false; m_title_isSet = false;
audio_device_name = new QString(""); ft8_sample_rate = 0;
m_audio_device_name_isSet = false; m_ft8_sample_rate_isSet = false;
stream_index = 0; stream_index = 0;
m_stream_index_isSet = false; m_stream_index_isSet = false;
use_reverse_api = 0; use_reverse_api = 0;
@ -166,15 +154,10 @@ SWGFT8DemodSettings::cleanup() {
if(title != nullptr) { if(title != nullptr) {
delete title; delete title;
} }
if(audio_device_name != nullptr) {
delete audio_device_name;
}
if(reverse_api_address != nullptr) { if(reverse_api_address != nullptr) {
@ -219,14 +202,8 @@ SWGFT8DemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", ""); ::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
::SWGSDRangel::setValue(&audio_binaural, pJson["audioBinaural"], "qint32", "");
::SWGSDRangel::setValue(&audio_flip_channels, pJson["audioFlipChannels"], "qint32", "");
::SWGSDRangel::setValue(&dsb, pJson["dsb"], "qint32", ""); ::SWGSDRangel::setValue(&dsb, pJson["dsb"], "qint32", "");
::SWGSDRangel::setValue(&audio_mute, pJson["audioMute"], "qint32", "");
::SWGSDRangel::setValue(&agc, pJson["agc"], "qint32", ""); ::SWGSDRangel::setValue(&agc, pJson["agc"], "qint32", "");
::SWGSDRangel::setValue(&agc_clamping, pJson["agcClamping"], "qint32", ""); ::SWGSDRangel::setValue(&agc_clamping, pJson["agcClamping"], "qint32", "");
@ -241,7 +218,7 @@ SWGFT8DemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
::SWGSDRangel::setValue(&audio_device_name, pJson["audioDeviceName"], "QString", "QString"); ::SWGSDRangel::setValue(&ft8_sample_rate, pJson["ft8SampleRate"], "qint32", "");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", ""); ::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
@ -298,18 +275,9 @@ SWGFT8DemodSettings::asJsonObject() {
if(m_volume_isSet){ if(m_volume_isSet){
obj->insert("volume", QJsonValue(volume)); obj->insert("volume", QJsonValue(volume));
} }
if(m_audio_binaural_isSet){
obj->insert("audioBinaural", QJsonValue(audio_binaural));
}
if(m_audio_flip_channels_isSet){
obj->insert("audioFlipChannels", QJsonValue(audio_flip_channels));
}
if(m_dsb_isSet){ if(m_dsb_isSet){
obj->insert("dsb", QJsonValue(dsb)); obj->insert("dsb", QJsonValue(dsb));
} }
if(m_audio_mute_isSet){
obj->insert("audioMute", QJsonValue(audio_mute));
}
if(m_agc_isSet){ if(m_agc_isSet){
obj->insert("agc", QJsonValue(agc)); obj->insert("agc", QJsonValue(agc));
} }
@ -331,8 +299,8 @@ SWGFT8DemodSettings::asJsonObject() {
if(title != nullptr && *title != QString("")){ if(title != nullptr && *title != QString("")){
toJsonValue(QString("title"), title, obj, QString("QString")); toJsonValue(QString("title"), title, obj, QString("QString"));
} }
if(audio_device_name != nullptr && *audio_device_name != QString("")){ if(m_ft8_sample_rate_isSet){
toJsonValue(QString("audioDeviceName"), audio_device_name, obj, QString("QString")); obj->insert("ft8SampleRate", QJsonValue(ft8_sample_rate));
} }
if(m_stream_index_isSet){ if(m_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index)); obj->insert("streamIndex", QJsonValue(stream_index));
@ -435,26 +403,6 @@ SWGFT8DemodSettings::setVolume(float volume) {
this->m_volume_isSet = true; this->m_volume_isSet = true;
} }
qint32
SWGFT8DemodSettings::getAudioBinaural() {
return audio_binaural;
}
void
SWGFT8DemodSettings::setAudioBinaural(qint32 audio_binaural) {
this->audio_binaural = audio_binaural;
this->m_audio_binaural_isSet = true;
}
qint32
SWGFT8DemodSettings::getAudioFlipChannels() {
return audio_flip_channels;
}
void
SWGFT8DemodSettings::setAudioFlipChannels(qint32 audio_flip_channels) {
this->audio_flip_channels = audio_flip_channels;
this->m_audio_flip_channels_isSet = true;
}
qint32 qint32
SWGFT8DemodSettings::getDsb() { SWGFT8DemodSettings::getDsb() {
return dsb; return dsb;
@ -465,16 +413,6 @@ SWGFT8DemodSettings::setDsb(qint32 dsb) {
this->m_dsb_isSet = true; this->m_dsb_isSet = true;
} }
qint32
SWGFT8DemodSettings::getAudioMute() {
return audio_mute;
}
void
SWGFT8DemodSettings::setAudioMute(qint32 audio_mute) {
this->audio_mute = audio_mute;
this->m_audio_mute_isSet = true;
}
qint32 qint32
SWGFT8DemodSettings::getAgc() { SWGFT8DemodSettings::getAgc() {
return agc; return agc;
@ -545,14 +483,14 @@ SWGFT8DemodSettings::setTitle(QString* title) {
this->m_title_isSet = true; this->m_title_isSet = true;
} }
QString* qint32
SWGFT8DemodSettings::getAudioDeviceName() { SWGFT8DemodSettings::getFt8SampleRate() {
return audio_device_name; return ft8_sample_rate;
} }
void void
SWGFT8DemodSettings::setAudioDeviceName(QString* audio_device_name) { SWGFT8DemodSettings::setFt8SampleRate(qint32 ft8_sample_rate) {
this->audio_device_name = audio_device_name; this->ft8_sample_rate = ft8_sample_rate;
this->m_audio_device_name_isSet = true; this->m_ft8_sample_rate_isSet = true;
} }
qint32 qint32
@ -671,18 +609,9 @@ SWGFT8DemodSettings::isSet(){
if(m_volume_isSet){ if(m_volume_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(m_audio_binaural_isSet){
isObjectUpdated = true; break;
}
if(m_audio_flip_channels_isSet){
isObjectUpdated = true; break;
}
if(m_dsb_isSet){ if(m_dsb_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(m_audio_mute_isSet){
isObjectUpdated = true; break;
}
if(m_agc_isSet){ if(m_agc_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
@ -704,7 +633,7 @@ SWGFT8DemodSettings::isSet(){
if(title && *title != QString("")){ if(title && *title != QString("")){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(audio_device_name && *audio_device_name != QString("")){ if(m_ft8_sample_rate_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(m_stream_index_isSet){ if(m_stream_index_isSet){

View File

@ -66,18 +66,9 @@ public:
float getVolume(); float getVolume();
void setVolume(float volume); void setVolume(float volume);
qint32 getAudioBinaural();
void setAudioBinaural(qint32 audio_binaural);
qint32 getAudioFlipChannels();
void setAudioFlipChannels(qint32 audio_flip_channels);
qint32 getDsb(); qint32 getDsb();
void setDsb(qint32 dsb); void setDsb(qint32 dsb);
qint32 getAudioMute();
void setAudioMute(qint32 audio_mute);
qint32 getAgc(); qint32 getAgc();
void setAgc(qint32 agc); void setAgc(qint32 agc);
@ -99,8 +90,8 @@ public:
QString* getTitle(); QString* getTitle();
void setTitle(QString* title); void setTitle(QString* title);
QString* getAudioDeviceName(); qint32 getFt8SampleRate();
void setAudioDeviceName(QString* audio_device_name); void setFt8SampleRate(qint32 ft8_sample_rate);
qint32 getStreamIndex(); qint32 getStreamIndex();
void setStreamIndex(qint32 stream_index); void setStreamIndex(qint32 stream_index);
@ -154,18 +145,9 @@ private:
float volume; float volume;
bool m_volume_isSet; bool m_volume_isSet;
qint32 audio_binaural;
bool m_audio_binaural_isSet;
qint32 audio_flip_channels;
bool m_audio_flip_channels_isSet;
qint32 dsb; qint32 dsb;
bool m_dsb_isSet; bool m_dsb_isSet;
qint32 audio_mute;
bool m_audio_mute_isSet;
qint32 agc; qint32 agc;
bool m_agc_isSet; bool m_agc_isSet;
@ -187,8 +169,8 @@ private:
QString* title; QString* title;
bool m_title_isSet; bool m_title_isSet;
QString* audio_device_name; qint32 ft8_sample_rate;
bool m_audio_device_name_isSet; bool m_ft8_sample_rate_isSet;
qint32 stream_index; qint32 stream_index;
bool m_stream_index_isSet; bool m_stream_index_isSet;