diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index d2ba1324b..aa68cd6c1 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -684,17 +684,6 @@ void SSBMod::applyAudioSampleRate(int sampleRate) float lowCutoff = m_settings.m_lowCutoff; bool usb = m_settings.m_usb; - if (band < 0) // negative means LSB - { - band = -band; // turn to positive - lowCutoff = -lowCutoff; - usb = false; // and take note of side band - } - else - { - usb = true; - } - if (band < 100.0f) // at least 100 Hz { band = 100.0f; @@ -838,17 +827,6 @@ void SSBMod::applySettings(const SSBModSettings& settings, bool force) if ((settings.m_bandwidth != m_settings.m_bandwidth) || (settings.m_lowCutoff != m_settings.m_lowCutoff) || force) { - if (band < 0) // negative means LSB - { - band = -band; // turn to positive - lowCutoff = -lowCutoff; - usb = false; // and take note of side band - } - else - { - usb = true; - } - if (band < 100.0f) // at least 100 Hz { band = 100.0f; diff --git a/plugins/channeltx/modssb/ssbmodgui.cpp b/plugins/channeltx/modssb/ssbmodgui.cpp index b7d41b0c6..5c177fcfd 100644 --- a/plugins/channeltx/modssb/ssbmodgui.cpp +++ b/plugins/channeltx/modssb/ssbmodgui.cpp @@ -120,8 +120,14 @@ bool SSBModGUI::handleMessage(const Message& message) } else if (SSBMod::MsgConfigureSSBMod::match(message)) { + SSBModSettings mod_settings; // different USB/LSB convention between modulator and GUI const SSBMod::MsgConfigureSSBMod& cfg = (SSBMod::MsgConfigureSSBMod&) message; - m_settings = cfg.getSettings(); + mod_settings = cfg.getSettings(); + if (mod_settings.m_usb == false) { + mod_settings.m_bandwidth = -mod_settings.m_bandwidth; + mod_settings.m_lowCutoff = -mod_settings.m_lowCutoff; + } + m_settings = mod_settings; blockApplySettings(true); displaySettings(); blockApplySettings(false); @@ -497,7 +503,17 @@ void SSBModGUI::applySettings(bool force) 48000, m_settings.m_inputFrequencyOffset); m_ssbMod->getInputMessageQueue()->push(msgChan); - SSBMod::MsgConfigureSSBMod *msg = SSBMod::MsgConfigureSSBMod::create(m_settings, force); + SSBModSettings mod_settings; // different USB/LSB convention between modulator and GUI + mod_settings = m_settings; + if (mod_settings.m_bandwidth > 0) { + mod_settings.m_usb = true; + } else { + mod_settings.m_bandwidth = -mod_settings.m_bandwidth; + mod_settings.m_lowCutoff = -mod_settings.m_lowCutoff; + mod_settings.m_usb = false; + } + + SSBMod::MsgConfigureSSBMod *msg = SSBMod::MsgConfigureSSBMod::create(mod_settings, force); m_ssbMod->getInputMessageQueue()->push(msg); } }