1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-14 04:11:48 -05:00

BFM demod: implement button to control RDS activation

This commit is contained in:
f4exb 2015-12-09 04:13:13 +01:00
parent 274626d58f
commit 1b66b72a11
7 changed files with 60 additions and 15 deletions

View File

@ -75,9 +75,16 @@ void BFMDemod::configure(MessageQueue* messageQueue,
Real volume,
Real squelch,
bool audioStereo,
bool showPilot)
bool showPilot,
bool rdsActive)
{
Message* cmd = MsgConfigureBFMDemod::create(rfBandwidth, afBandwidth, volume, squelch, audioStereo, showPilot);
Message* cmd = MsgConfigureBFMDemod::create(rfBandwidth,
afBandwidth,
volume,
squelch,
audioStereo,
showPilot,
rdsActive);
messageQueue->push(cmd);
}
@ -256,6 +263,7 @@ bool BFMDemod::handleMessage(const Message& cmd)
m_config.m_squelch = cfg.getSquelch();
m_config.m_audioStereo = cfg.getAudioStereo();
m_config.m_showPilot = cfg.getShowPilot();
m_config.m_rdsActive = cfg.getRDSActive();
apply();
@ -264,7 +272,8 @@ bool BFMDemod::handleMessage(const Message& cmd)
<< " m_volume: " << m_config.m_volume
<< " m_squelch: " << m_config.m_squelch
<< " m_audioStereo: " << m_config.m_audioStereo
<< " m_showPilot: " << m_config.m_showPilot;
<< " m_showPilot: " << m_config.m_showPilot
<< " m_rdsActive: " << m_config.m_rdsActive;
return true;
}
@ -356,5 +365,5 @@ void BFMDemod::apply()
m_running.m_audioSampleRate = m_config.m_audioSampleRate;
m_running.m_audioStereo = m_config.m_audioStereo;
m_running.m_showPilot = m_config.m_showPilot;
m_running.m_rdsActive = m_config.m_rdsActive;
}

View File

@ -44,7 +44,8 @@ public:
Real volume,
Real squelch,
bool audioStereo,
bool showPilot);
bool showPilot,
bool rdsActive);
int getSampleRate() const { return m_config.m_inputSampleRate; }
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
@ -67,15 +68,23 @@ private:
Real getSquelch() const { return m_squelch; }
bool getAudioStereo() const { return m_audioStereo; }
bool getShowPilot() const { return m_showPilot; }
bool getRDSActive() const { return m_rdsActive; }
static MsgConfigureBFMDemod* create(Real rfBandwidth,
Real afBandwidth,
Real volume,
Real squelch,
bool audioStereo,
bool showPilot)
bool showPilot,
bool rdsActive)
{
return new MsgConfigureBFMDemod(rfBandwidth, afBandwidth, volume, squelch, audioStereo, showPilot);
return new MsgConfigureBFMDemod(rfBandwidth,
afBandwidth,
volume,
squelch,
audioStereo,
showPilot,
rdsActive);
}
private:
@ -85,20 +94,23 @@ private:
Real m_squelch;
bool m_audioStereo;
bool m_showPilot;
bool m_rdsActive;
MsgConfigureBFMDemod(Real rfBandwidth,
Real afBandwidth,
Real volume,
Real squelch,
bool audioStereo,
bool showPilot) :
bool showPilot,
bool rdsActive) :
Message(),
m_rfBandwidth(rfBandwidth),
m_afBandwidth(afBandwidth),
m_volume(volume),
m_squelch(squelch),
m_audioStereo(audioStereo),
m_showPilot(showPilot)
m_showPilot(showPilot),
m_rdsActive(rdsActive)
{ }
};
@ -123,6 +135,7 @@ private:
quint32 m_audioSampleRate;
bool m_audioStereo;
bool m_showPilot;
bool m_rdsActive;
Config() :
m_inputSampleRate(-1),
@ -133,7 +146,8 @@ private:
m_volume(0),
m_audioSampleRate(0),
m_audioStereo(false),
m_showPilot(false)
m_showPilot(false),
m_rdsActive(false)
{ }
};

View File

@ -243,6 +243,11 @@ void BFMDemodGUI::on_showPilot_clicked()
applySettings();
}
void BFMDemodGUI::on_rds_clicked()
{
applySettings();
}
void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{
}
@ -338,7 +343,8 @@ void BFMDemodGUI::applySettings()
ui->volume->value() / 10.0,
ui->squelch->value(),
ui->audioStereo->isChecked(),
ui->showPilot->isChecked());
ui->showPilot->isChecked(),
ui->rds->isChecked());
}
}

View File

@ -63,6 +63,7 @@ private slots:
void on_squelch_valueChanged(int value);
void on_audioStereo_toggled(bool stereo);
void on_showPilot_clicked();
void on_rds_clicked();
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDoubleClicked();
void tick();

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>308</width>
<width>335</width>
<height>333</height>
</rect>
</property>
@ -21,7 +21,7 @@
<rect>
<x>10</x>
<y>20</y>
<width>281</width>
<width>311</width>
<height>121</height>
</rect>
</property>
@ -203,6 +203,20 @@
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="rds">
<property name="toolTip">
<string>Toggle RDS subsystem activation</string>
</property>
<property name="text">
<string>.</string>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/rds.png</normaloff>:/rds.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@ -386,12 +400,12 @@
<rect>
<x>10</x>
<y>160</y>
<width>281</width>
<width>311</width>
<height>151</height>
</rect>
</property>
<property name="windowTitle">
<string>Channel Spectrum</string>
<string>Baseband Spectrum</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">

BIN
sdrbase/resources/rds.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

View File

@ -46,5 +46,6 @@
<file>flip_lr.png</file>
<file>flip_rl.png</file>
<file>carrier.png</file>
<file>rds.png</file>
</qresource>
</RCC>