mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 17:58:43 -05:00
BFM demod: implemented mono/stereo control button with stereo pilot lock indication (green)
This commit is contained in:
parent
baccaba2c8
commit
cd31cc6c0e
@ -119,10 +119,11 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
||||
m_m2Sample = m_m1Sample;
|
||||
m_m1Sample = rf[i];
|
||||
|
||||
// TODO: conditional to stereo mode selected
|
||||
Real pilotSample;
|
||||
m_pilotPLL.process(demod, pilotSample);
|
||||
//m_sampleBuffer.push_back(Sample(demod * (1<<15), 0.0));
|
||||
m_sampleBuffer.push_back(Sample(pilotSample * (1<<15), 0.0));
|
||||
m_sampleBuffer.push_back(Sample(demod * (1<<15), 0.0));
|
||||
//m_sampleBuffer.push_back(Sample(pilotSample * (1<<15), 0.0)); // debug pilot
|
||||
Complex e(demod, 0);
|
||||
|
||||
if(m_interpolator.interpolate(&m_interpolatorDistanceRemain, e, &ci))
|
||||
|
@ -216,6 +216,13 @@ void BFMDemodGUI::on_squelch_valueChanged(int value)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void BFMDemodGUI::on_audioStereo_toggled(bool stereo)
|
||||
{
|
||||
if (!stereo)
|
||||
{
|
||||
ui->audioStereo->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
}
|
||||
|
||||
void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
{
|
||||
@ -334,5 +341,21 @@ void BFMDemodGUI::tick()
|
||||
Real powDb = CalcDb::dbPower(m_bfmDemod->getMagSq());
|
||||
m_channelPowerDbAvg.feed(powDb);
|
||||
ui->channelPower->setText(QString::number(m_channelPowerDbAvg.average(), 'f', 1));
|
||||
|
||||
if (m_bfmDemod->getPilotLock())
|
||||
{
|
||||
if (ui->audioStereo->isChecked())
|
||||
{
|
||||
ui->audioStereo->setStyleSheet("QToolButton { background-color : green; }");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ui->audioStereo->isChecked())
|
||||
{
|
||||
ui->audioStereo->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
}
|
||||
|
||||
//qDebug() << "Pilot lock: " << m_bfmDemod->getPilotLock() << ":" << m_bfmDemod->getPilotLevel(); TODO: update a GUI item with status
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ private slots:
|
||||
void on_afBW_valueChanged(int value);
|
||||
void on_volume_valueChanged(int value);
|
||||
void on_squelch_valueChanged(int value);
|
||||
void on_audioStereo_toggled(bool stereo);
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onMenuDoubleClicked();
|
||||
void tick();
|
||||
|
@ -19,7 +19,7 @@
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>235</width>
|
||||
<height>121</height>
|
||||
<height>111</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -136,6 +136,27 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="audioStereo">
|
||||
<property name="toolTip">
|
||||
<string>Mono/Stereo toggle and pilot lock indicator</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrbase/resources/res.qrc">
|
||||
<normaloff>:/mono.png</normaloff>
|
||||
<normalon>:/stereo.png</normalon>:/mono.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
Loading…
Reference in New Issue
Block a user