1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-25 11:34:09 -04:00

SSB mod: moved AF input mode in settings structure

This commit is contained in:
f4exb
2018-04-13 08:41:34 +02:00
parent b151b00182
commit e3815e4076
7 changed files with 54 additions and 65 deletions
+24 -15
View File
@@ -233,9 +233,8 @@ void SSBModGUI::on_play_toggled(bool checked)
ui->tone->setEnabled(!checked); // release other source inputs
ui->morseKeyer->setEnabled(!checked);
ui->mic->setEnabled(!checked);
m_modAFInput = checked ? SSBMod::SSBModInputFile : SSBMod::SSBModInputNone;
SSBMod::MsgConfigureAFInput* message = SSBMod::MsgConfigureAFInput::create(m_modAFInput);
m_ssbMod->getInputMessageQueue()->push(message);
m_settings.m_modAFInput = checked ? SSBModSettings::SSBModInputFile : SSBModSettings::SSBModInputNone;
applySettings();
ui->navTimeSlider->setEnabled(!checked);
m_enableNavTime = !checked;
}
@@ -245,9 +244,8 @@ void SSBModGUI::on_tone_toggled(bool checked)
ui->play->setEnabled(!checked); // release other source inputs
ui->morseKeyer->setEnabled(!checked);
ui->mic->setEnabled(!checked);
m_modAFInput = checked ? SSBMod::SSBModInputTone : SSBMod::SSBModInputNone;
SSBMod::MsgConfigureAFInput* message = SSBMod::MsgConfigureAFInput::create(m_modAFInput);
m_ssbMod->getInputMessageQueue()->push(message);
m_settings.m_modAFInput = checked ? SSBModSettings::SSBModInputTone : SSBModSettings::SSBModInputNone;
applySettings();
}
void SSBModGUI::on_morseKeyer_toggled(bool checked)
@@ -255,9 +253,8 @@ void SSBModGUI::on_morseKeyer_toggled(bool checked)
ui->play->setEnabled(!checked); // release other source inputs
ui->tone->setEnabled(!checked); // release other source inputs
ui->mic->setEnabled(!checked);
m_modAFInput = checked ? SSBMod::SSBModInputCWTone : SSBMod::SSBModInputNone;
SSBMod::MsgConfigureAFInput* message = SSBMod::MsgConfigureAFInput::create(m_modAFInput);
m_ssbMod->getInputMessageQueue()->push(message);
m_settings.m_modAFInput = checked ? SSBModSettings::SSBModInputCWTone : SSBModSettings::SSBModInputNone;
applySettings();
}
void SSBModGUI::on_mic_toggled(bool checked)
@@ -265,9 +262,8 @@ void SSBModGUI::on_mic_toggled(bool checked)
ui->play->setEnabled(!checked); // release other source inputs
ui->morseKeyer->setEnabled(!checked);
ui->tone->setEnabled(!checked); // release other source inputs
m_modAFInput = checked ? SSBMod::SSBModInputAudio : SSBMod::SSBModInputNone;
SSBMod::MsgConfigureAFInput* message = SSBMod::MsgConfigureAFInput::create(m_modAFInput);
m_ssbMod->getInputMessageQueue()->push(message);
m_settings.m_modAFInput = checked ? SSBModSettings::SSBModInputAudio : SSBModSettings::SSBModInputNone;
applySettings();
}
void SSBModGUI::on_agc_toggled(bool checked)
@@ -363,8 +359,7 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
m_recordSampleRate(48000),
m_samplesCount(0),
m_tickCount(0),
m_enableNavTime(false),
m_modAFInput(SSBMod::SSBModInputNone)
m_enableNavTime(false)
{
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true);
@@ -648,6 +643,20 @@ void SSBModGUI::displaySettings()
ui->volume->setValue(m_settings.m_volumeFactor * 10.0);
ui->volumeText->setText(QString("%1").arg(m_settings.m_volumeFactor, 0, 'f', 1));
ui->tone->setEnabled((m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputTone)
|| (m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputNone));
ui->mic->setEnabled((m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputAudio)
|| (m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputNone));
ui->play->setEnabled((m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputFile)
|| (m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputNone));
ui->morseKeyer->setEnabled((m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputCWTone)
|| (m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputNone));
ui->tone->setChecked(m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputTone);
ui->mic->setChecked(m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputAudio);
ui->play->setChecked(m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputFile);
ui->morseKeyer->setChecked(m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputCWTone);
blockApplySettings(false);
}
@@ -695,7 +704,7 @@ void SSBModGUI::tick()
m_channelPowerDbAvg(powDb);
ui->channelPower->setText(tr("%1 dB").arg(m_channelPowerDbAvg.asDouble(), 0, 'f', 1));
if (((++m_tickCount & 0xf) == 0) && (m_modAFInput == SSBMod::SSBModInputFile))
if (((++m_tickCount & 0xf) == 0) && (m_settings.m_modAFInput == SSBModSettings::SSBModInputFile))
{
SSBMod::MsgConfigureFileSourceStreamTiming* message = SSBMod::MsgConfigureFileSourceStreamTiming::create();
m_ssbMod->getInputMessageQueue()->push(message);