SSB demod: implemented DSB GUI control

This commit is contained in:
f4exb 2015-12-06 00:43:40 +01:00
parent fc89d3ea5c
commit f512503dc1
4 changed files with 32 additions and 9 deletions

View File

@ -74,9 +74,10 @@ void SSBDemod::configure(MessageQueue* messageQueue,
Real volume,
int spanLog2,
bool audioBinaural,
bool audioFlipChannel)
bool audioFlipChannel,
bool dsb)
{
Message* cmd = MsgConfigureSSBDemod::create(Bandwidth, LowCutoff, volume, spanLog2, audioBinaural, audioFlipChannel);
Message* cmd = MsgConfigureSSBDemod::create(Bandwidth, LowCutoff, volume, spanLog2, audioBinaural, audioFlipChannel, dsb);
messageQueue->push(cmd);
}
@ -245,6 +246,7 @@ bool SSBDemod::handleMessage(const Message& cmd)
m_spanLog2 = cfg.getSpanLog2();
m_audioBinaual = cfg.getAudioBinaural();
m_audioFlipChannels = cfg.getAudioFlipChannels();
m_dsb = cfg.getDSB();
m_settingsMutex.unlock();
@ -253,7 +255,8 @@ bool SSBDemod::handleMessage(const Message& cmd)
<< " m_volume: " << m_volume
<< " m_spanLog2: " << m_spanLog2
<< " m_audioBinaual: " << m_audioBinaual
<< " m_audioFlipChannels: " << m_audioFlipChannels;
<< " m_audioFlipChannels: " << m_audioFlipChannels
<< " m_dsb: " << m_dsb;
return true;
}

View File

@ -40,7 +40,8 @@ public:
Real volume,
int spanLog2,
bool audioBinaural,
bool audioFlipChannels);
bool audioFlipChannels,
bool dsb);
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly);
virtual void start();
@ -60,15 +61,17 @@ private:
int getSpanLog2() const { return m_spanLog2; }
bool getAudioBinaural() const { return m_audioBinaural; }
bool getAudioFlipChannels() const { return m_audioFlipChannels; }
bool getDSB() const { return m_dsb; }
static MsgConfigureSSBDemod* create(Real Bandwidth,
Real LowCutoff,
Real volume,
int spanLog2,
bool audioBinaural,
bool audioFlipChannels)
bool audioFlipChannels,
bool dsb)
{
return new MsgConfigureSSBDemod(Bandwidth, LowCutoff, volume, spanLog2, audioBinaural, audioFlipChannels);
return new MsgConfigureSSBDemod(Bandwidth, LowCutoff, volume, spanLog2, audioBinaural, audioFlipChannels, dsb);
}
private:
@ -78,20 +81,23 @@ private:
int m_spanLog2;
bool m_audioBinaural;
bool m_audioFlipChannels;
bool m_dsb;
MsgConfigureSSBDemod(Real Bandwidth,
Real LowCutoff,
Real volume,
int spanLog2,
bool audioBinaural,
bool audioFlipChannels) :
bool audioFlipChannels,
bool dsb) :
Message(),
m_Bandwidth(Bandwidth),
m_LowCutoff(LowCutoff),
m_volume(volume),
m_spanLog2(spanLog2),
m_audioBinaural(audioBinaural),
m_audioFlipChannels(audioFlipChannels)
m_audioFlipChannels(audioFlipChannels),
m_dsb(dsb)
{ }
};
@ -112,6 +118,7 @@ private:
bool m_audioBinaual;
bool m_audioFlipChannels;
bool m_usb;
bool m_dsb;
Real m_magsq;
NCO m_nco;

View File

@ -73,6 +73,7 @@ QByteArray SSBDemodGUI::serialize() const
s.writeS32(7, ui->spanLog2->value());
s.writeBool(8, m_audioBinaural);
s.writeBool(9, m_audioFlipChannels);
s.writeBool(10, m_dsb);
return s.final();
}
@ -114,6 +115,8 @@ bool SSBDemodGUI::deserialize(const QByteArray& data)
ui->audioBinaural->setChecked(m_audioBinaural);
d.readBool(9, &m_audioFlipChannels);
ui->audioFlipChannels->setChecked(m_audioFlipChannels);
d.readBool(10, &m_dsb);
ui->dsb->setChecked(m_dsb);
blockApplySettings(false);
m_channelMarker.blockSignals(false);
@ -161,6 +164,12 @@ void SSBDemodGUI::on_audioFlipChannels_toggled(bool flip)
applySettings();
}
void SSBDemodGUI::on_dsb_toggled(bool dsb)
{
m_dsb = dsb;
applySettings();
}
void SSBDemodGUI::on_deltaFrequency_changed(quint64 value)
{
if (ui->deltaMinus->isChecked())
@ -277,6 +286,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
m_spanLog2(3),
m_audioBinaural(false),
m_audioFlipChannels(false),
m_dsb(false),
m_channelPowerDbAvg(20,0)
{
ui->setupUi(this);
@ -396,7 +406,8 @@ void SSBDemodGUI::applySettings()
ui->volume->value() / 10.0,
m_spanLog2,
m_audioBinaural,
m_audioFlipChannels);
m_audioFlipChannels,
m_dsb);
}
}

View File

@ -42,6 +42,7 @@ private slots:
void on_deltaMinus_toggled(bool minus);
void on_audioBinaural_toggled(bool binaural);
void on_audioFlipChannels_toggled(bool flip);
void on_dsb_toggled(bool dsb);
void on_BW_valueChanged(int value);
void on_lowCut_valueChanged(int value);
void on_volume_valueChanged(int value);
@ -60,6 +61,7 @@ private:
int m_spanLog2;
bool m_audioBinaural;
bool m_audioFlipChannels;
bool m_dsb;
MovingAverage<Real> m_channelPowerDbAvg;
ThreadedSampleSink* m_threadedChannelizer;