1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-15 12:51:49 -05:00

ATV demod: GUI and demod separation (1)

This commit is contained in:
f4exb 2017-11-06 23:04:23 +01:00
parent f32f0333e7
commit 5131fb86b1
4 changed files with 27 additions and 2 deletions

View File

@ -28,6 +28,7 @@
MESSAGE_CLASS_DEFINITION(ATVDemod::MsgConfigureATVDemod, Message)
MESSAGE_CLASS_DEFINITION(ATVDemod::MsgConfigureRFATVDemod, Message)
MESSAGE_CLASS_DEFINITION(ATVDemod::MsgReportEffectiveSampleRate, Message)
MESSAGE_CLASS_DEFINITION(ATVDemod::MsgReportChannelSampleRateChanged, Message)
const int ATVDemod::m_ssbFftLen = 1024;

View File

@ -147,6 +147,26 @@ public:
{ }
};
class MsgReportChannelSampleRateChanged : public Message {
MESSAGE_CLASS_DECLARATION
public:
int getSampleRate() const { return m_sampleRate; }
static MsgReportChannelSampleRateChanged* create(int sampleRate)
{
return new MsgReportChannelSampleRateChanged(sampleRate);
}
private:
int m_sampleRate;
MsgReportChannelSampleRateChanged(int sampleRate) :
Message(),
m_sampleRate(sampleRate)
{ }
};
ATVDemod(DeviceSourceAPI *deviceAPI);
~ATVDemod();
void setScopeSink(BasebandSampleSink* scopeSink) { m_scopeSink = scopeSink; }

View File

@ -235,6 +235,7 @@ void ATVDemodGUI::viewChanged()
void ATVDemodGUI::channelSampleRateChanged()
{
qDebug("ATVDemodGUI::channelSampleRateChanged");
m_inputSampleRate = m_channelizer->getInputSampleRate();
applySettings();
applyRFSettings();
}
@ -277,7 +278,8 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet,
m_blnBasicSettingsShown(false),
m_blnDoApplySettings(true),
m_objMagSqAverage(40, 0),
m_intTickCount(0)
m_intTickCount(0),
m_inputSampleRate(48000)
{
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true);
@ -429,7 +431,8 @@ void ATVDemodGUI::setChannelMarkerBandwidth()
if (ui->decimatorEnable->isChecked()) {
m_channelMarker.setBandwidth(ui->rfBW->value()*m_rfSliderDivisor);
} else {
m_channelMarker.setBandwidth(m_channelizer->getInputSampleRate());
// m_channelMarker.setBandwidth(m_channelizer->getInputSampleRate());
m_channelMarker.setBandwidth(m_inputSampleRate);
}
m_channelMarker.setSidebands(ChannelMarker::dsb);

View File

@ -107,6 +107,7 @@ private:
float m_fltLineTimeMultiplier;
float m_fltTopTimeMultiplier;
int m_rfSliderDivisor;
int m_inputSampleRate;
MessageQueue m_inputMessageQueue;
explicit ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, QWidget* objParent = 0);