1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

NFM Modulator: implemented channel mute

This commit is contained in:
f4exb 2016-12-20 16:38:27 +01:00
parent cd3191a9dc
commit 61df7de043
5 changed files with 60 additions and 22 deletions

View File

@ -107,6 +107,13 @@ void NFMMod::configure(MessageQueue* messageQueue,
void NFMMod::pull(Sample& sample)
{
if (m_running.m_channelMute)
{
sample.m_real = 0.0f;
sample.m_imag = 0.0f;
return;
}
Complex ci;
Real t;
@ -292,7 +299,7 @@ bool NFMMod::handleMessage(const Message& cmd)
m_config.m_fmDeviation = cfg.getFMDeviation();
m_config.m_toneFrequency = cfg.getToneFrequency();
m_config.m_volumeFactor = cfg.getVolumeFactor();
m_config.m_audioMute = cfg.getAudioMute();
m_config.m_channelMute = cfg.getChannelMute();
m_config.m_playLoop = cfg.getPlayLoop();
m_config.m_ctcssOn = cfg.getCTCSSOn();
m_config.m_ctcssFrequency = cfg.getCTCSSFrequency();
@ -305,7 +312,7 @@ bool NFMMod::handleMessage(const Message& cmd)
<< " m_fmDeviation: " << m_config.m_fmDeviation
<< " m_toneFrequency: " << m_config.m_toneFrequency
<< " m_volumeFactor: " << m_config.m_volumeFactor
<< " m_audioMute: " << m_config.m_audioMute
<< " m_channelMute: " << m_config.m_channelMute
<< " m_playLoop: " << m_config.m_playLoop
<< " m_ctcssOn: " << m_config.m_ctcssOn
<< " m_ctcssFrequency: " << m_config.m_ctcssFrequency;
@ -416,7 +423,7 @@ void NFMMod::apply()
m_running.m_fmDeviation = m_config.m_fmDeviation;
m_running.m_volumeFactor = m_config.m_volumeFactor;
m_running.m_audioSampleRate = m_config.m_audioSampleRate;
m_running.m_audioMute = m_config.m_audioMute;
m_running.m_channelMute = m_config.m_channelMute;
m_running.m_playLoop = m_config.m_playLoop;
m_running.m_ctcssOn = m_config.m_ctcssOn;
m_running.m_ctcssFrequency = m_config.m_ctcssFrequency;

View File

@ -184,7 +184,7 @@ public:
float fmDeviation,
float toneFrequency,
float volumeFactor,
bool audioMute,
bool channelMute,
bool playLoop,
bool ctcssOn,
float ctcssFrequency);
@ -219,7 +219,7 @@ private:
float getFMDeviation() const { return m_fmDeviation; }
float getToneFrequency() const { return m_toneFrequency; }
float getVolumeFactor() const { return m_volumeFactor; }
bool getAudioMute() const { return m_audioMute; }
bool getChannelMute() const { return m_channelMute; }
bool getPlayLoop() const { return m_playLoop; }
bool getCTCSSOn() const { return m_ctcssOn; }
float getCTCSSFrequency() const { return m_ctcssFrequency; }
@ -229,7 +229,7 @@ private:
float fmDeviation,
float toneFrequency,
float volumeFactor,
bool audioMute,
bool channelMute,
bool playLoop,
bool ctcssOn,
float ctcssFrequency)
@ -239,7 +239,7 @@ private:
fmDeviation,
toneFrequency,
volumeFactor,
audioMute,
channelMute,
playLoop,
ctcssOn,
ctcssFrequency);
@ -251,7 +251,7 @@ private:
float m_fmDeviation;
float m_toneFrequency;
float m_volumeFactor;
bool m_audioMute;
bool m_channelMute;
bool m_playLoop;
bool m_ctcssOn;
float m_ctcssFrequency;
@ -261,7 +261,7 @@ private:
float fmDeviation,
float toneFrequency,
float volumeFactor,
bool audioMute,
bool channelMute,
bool playLoop,
bool ctcssOn,
float ctcssFrequency) :
@ -271,7 +271,7 @@ private:
m_fmDeviation(fmDeviation),
m_toneFrequency(toneFrequency),
m_volumeFactor(volumeFactor),
m_audioMute(audioMute),
m_channelMute(channelMute),
m_playLoop(playLoop),
m_ctcssOn(ctcssOn),
m_ctcssFrequency(ctcssFrequency)
@ -300,7 +300,7 @@ private:
float m_toneFrequency;
float m_volumeFactor;
quint32 m_audioSampleRate;
bool m_audioMute;
bool m_channelMute;
bool m_playLoop;
bool m_ctcssOn;
float m_ctcssFrequency;
@ -314,7 +314,7 @@ private:
m_toneFrequency(1000.0f),
m_volumeFactor(1.0f),
m_audioSampleRate(0),
m_audioMute(false),
m_channelMute(false),
m_playLoop(false),
m_ctcssOn(false),
m_ctcssFrequency(88.5)

View File

@ -261,7 +261,7 @@ void NFMModGUI::on_toneFrequency_valueChanged(int value)
applySettings();
}
void NFMModGUI::on_audioMute_toggled(bool checked)
void NFMModGUI::on_channelMute_toggled(bool checked)
{
applySettings();
}
@ -477,7 +477,7 @@ void NFMModGUI::applySettings()
ui->fmDev->value() * 100.0f, // value is in '100 Hz
ui->toneFrequency->value() * 10.0f,
ui->volume->value() / 10.0f,
ui->audioMute->isChecked(),
ui->channelMute->isChecked(),
ui->playLoop->isChecked(),
ui->ctcssOn->isChecked(),
m_ctcssTones[ui->ctcss->currentIndex()]);

View File

@ -66,7 +66,7 @@ private slots:
void on_fmDev_valueChanged(int value);
void on_toneFrequency_valueChanged(int value);
void on_volume_valueChanged(int value);
void on_audioMute_toggled(bool checked);
void on_channelMute_toggled(bool checked);
void on_tone_toggled(bool checked);
void on_morseKeyer_toggled(bool checked);
void on_mic_toggled(bool checked);

View File

@ -56,7 +56,16 @@
<property name="spacing">
<number>3</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
@ -158,7 +167,7 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="audioMute">
<widget class="QToolButton" name="channelMute">
<property name="toolTip">
<string>Mute/Unmute audio</string>
</property>
@ -744,17 +753,17 @@
<header>gui/valuedial.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>LevelMeterVU</class>
<extends>QWidget</extends>
<header>gui/levelmeter.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>CWKeyerGUI</class>
<extends>QWidget</extends>
@ -764,6 +773,28 @@
</customwidgets>
<resources>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
</resources>
<connections/>
</ui>