diff --git a/plugins/channel/bfm/bfmdemod.cpp b/plugins/channel/bfm/bfmdemod.cpp
index b1d64bcbd..60444e74c 100644
--- a/plugins/channel/bfm/bfmdemod.cpp
+++ b/plugins/channel/bfm/bfmdemod.cpp
@@ -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))
diff --git a/plugins/channel/bfm/bfmdemodgui.cpp b/plugins/channel/bfm/bfmdemodgui.cpp
index 7c3aff37c..67ae5ef28 100644
--- a/plugins/channel/bfm/bfmdemodgui.cpp
+++ b/plugins/channel/bfm/bfmdemodgui.cpp
@@ -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
}
diff --git a/plugins/channel/bfm/bfmdemodgui.h b/plugins/channel/bfm/bfmdemodgui.h
index d95ae89b0..2717e319c 100644
--- a/plugins/channel/bfm/bfmdemodgui.h
+++ b/plugins/channel/bfm/bfmdemodgui.h
@@ -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();
diff --git a/plugins/channel/bfm/bfmdemodgui.ui b/plugins/channel/bfm/bfmdemodgui.ui
index c7fe66770..93889e499 100644
--- a/plugins/channel/bfm/bfmdemodgui.ui
+++ b/plugins/channel/bfm/bfmdemodgui.ui
@@ -19,7 +19,7 @@
10
20
235
- 121
+ 111
@@ -136,6 +136,27 @@
+ -
+
+
+ Mono/Stereo toggle and pilot lock indicator
+
+
+ true
+
+
+
+
+
+
+ :/mono.png
+ :/stereo.png:/mono.png
+
+
+ true
+
+
+