mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
Merge pull request #300 from thasti/master
respect USB flag for SSBMod REST API calls
This commit is contained in:
commit
ac1a565471
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user