1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-15 12:51:49 -05:00

SSB mod: fixed span slider aspect and bulky low/high cut slider group

This commit is contained in:
f4exb 2018-04-27 07:09:37 +02:00
parent 34ff36926e
commit 8d565f8187
4 changed files with 129 additions and 124 deletions

View File

@ -84,14 +84,14 @@ bool SSBModGUI::deserialize(const QByteArray& data)
{
qDebug("SSBModGUI::deserialize");
displaySettings();
applyBandwidths(true); // does applySettings(true)
applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
return true;
}
else
{
m_settings.resetToDefaults();
displaySettings();
applyBandwidths(true); // does applySettings(true)
applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
return false;
}
}
@ -115,7 +115,7 @@ bool SSBModGUI::handleMessage(const Message& message)
else if (DSPConfigureAudio::match(message))
{
qDebug("SSBModGUI::handleMessage: DSPConfigureAudio: %d", m_ssbMod->getAudioSampleRate());
applyBandwidths(); // will update spectrum details with new sample rate
applyBandwidths(5 - ui->spanLog2->value()); // will update spectrum details with new sample rate
return true;
}
else if (SSBMod::MsgConfigureSSBMod::match(message))
@ -184,7 +184,7 @@ void SSBModGUI::on_flipSidebands_clicked(bool checked __attribute__((unused)))
void SSBModGUI::on_dsb_toggled(bool dsb)
{
ui->flipSidebands->setEnabled(!dsb);
applyBandwidths();
applyBandwidths(5 - ui->spanLog2->value());
}
void SSBModGUI::on_audioBinaural_toggled(bool checked)
@ -201,21 +201,21 @@ void SSBModGUI::on_audioFlipChannels_toggled(bool checked)
void SSBModGUI::on_spanLog2_valueChanged(int value)
{
if ((value < 1) || (value > 5)) {
if ((value < 0) || (value > 4)) {
return;
}
applyBandwidths();
applyBandwidths(5 - value);
}
void SSBModGUI::on_BW_valueChanged(int value __attribute__((unused)))
{
applyBandwidths();
applyBandwidths(5 - ui->spanLog2->value());
}
void SSBModGUI::on_lowCut_valueChanged(int value __attribute__((unused)))
{
applyBandwidths();
applyBandwidths(5 - ui->spanLog2->value());
}
void SSBModGUI::on_toneFrequency_valueChanged(int value)
@ -454,7 +454,7 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
m_iconDSBLSB.addPixmap(QPixmap("://lsb.png"), QIcon::Normal, QIcon::Off);
displaySettings();
applyBandwidths(true); // does applySettings(true)
applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
}
SSBModGUI::~SSBModGUI()
@ -485,10 +485,9 @@ void SSBModGUI::applySettings(bool force)
}
}
void SSBModGUI::applyBandwidths(bool force)
void SSBModGUI::applyBandwidths(int spanLog2, bool force)
{
bool dsb = ui->dsb->isChecked();
int spanLog2 = ui->spanLog2->value();
m_spectrumRate = m_ssbMod->getAudioSampleRate() / (1<<spanLog2);
int bw = ui->BW->value();
int lw = ui->lowCut->value();
@ -646,7 +645,7 @@ void SSBModGUI::displaySettings()
ui->BW->blockSignals(true);
ui->dsb->setChecked(m_settings.m_dsb);
ui->spanLog2->setValue(m_settings.m_spanLog2);
ui->spanLog2->setValue(5 - m_settings.m_spanLog2);
ui->BW->setValue(roundf(m_settings.m_bandwidth/100.0));
s = QString::number(m_settings.m_bandwidth/1000.0, 'f', 1);

View File

@ -87,7 +87,7 @@ private:
bool blockApplySettings(bool block);
void applySettings(bool force = false);
void applyBandwidths(bool force = false);
void applyBandwidths(int spanLog2, bool force = false);
void displaySettings();
void displayAGCPowerThreshold();
void updateWithStreamData();

View File

@ -53,16 +53,7 @@
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>2</number>
</property>
<item>
@ -252,6 +243,18 @@
<layout class="QHBoxLayout" name="spanLayout">
<item>
<widget class="QLabel" name="spanLabel">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Span</string>
</property>
@ -263,10 +266,92 @@
<string>Spectrum display frequency span</string>
</property>
<property name="minimum">
<number>1</number>
<number>0</number>
</property>
<property name="maximum">
<number>5</number>
<number>4</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>2</number>
</property>
<property name="sliderPosition">
<number>2</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="invertedControls">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="spanText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>6.0k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="lowCutLayout">
<item>
<widget class="QLabel" name="lowCutLabel">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Low cut</string>
</property>
</widget>
</item>
<item>
<widget class="TickedSlider" name="lowCut">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Highpass filter cutoff frequency (SSB)</string>
</property>
<property name="minimum">
<number>-60</number>
</property>
<property name="maximum">
<number>60</number>
</property>
<property name="pageStep">
<number>1</number>
@ -274,24 +359,33 @@
<property name="value">
<number>3</number>
</property>
<property name="sliderPosition">
<number>3</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>true</bool>
<property name="tickPosition">
<enum>QSlider::NoTicks</enum>
</property>
<property name="invertedControls">
<bool>true</bool>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="spanText">
<widget class="QLabel" name="lowCutText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>6.0k</string>
<string>0.3k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -522,85 +616,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="lowCutLayout">
<item>
<widget class="QLabel" name="lowCutLabel">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Low cut</string>
</property>
</widget>
</item>
<item>
<widget class="TickedSlider" name="lowCut">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Highpass filter cutoff frequency (SSB)</string>
</property>
<property name="minimum">
<number>-60</number>
</property>
<property name="maximum">
<number>60</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>3</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksAbove</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lowCutText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>0.3k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="volumeLayout">
<item>
@ -1224,16 +1239,7 @@
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>3</number>
</property>
<item>

View File

@ -25,7 +25,7 @@
const PluginDescriptor SSBModPlugin::m_pluginDescriptor = {
QString("SSB Modulator"),
QString("3.14.2"),
QString("3.14.5"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,