diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp
index b9bfe2ba4..fd3e358c1 100644
--- a/plugins/channeltx/modatv/atvmod.cpp
+++ b/plugins/channeltx/modatv/atvmod.cpp
@@ -114,7 +114,8 @@ void ATVMod::configure(MessageQueue* messageQueue,
bool channelMute,
bool invertedVideo,
float rfScaling,
- float fmExcursion)
+ float fmExcursion,
+ bool forceDecimator)
{
Message* cmd = MsgConfigureATVMod::create(
rfBandwidth,
@@ -131,7 +132,8 @@ void ATVMod::configure(MessageQueue* messageQueue,
channelMute,
invertedVideo,
rfScaling,
- fmExcursion);
+ fmExcursion,
+ forceDecimator);
messageQueue->push(cmd);
}
@@ -152,7 +154,7 @@ void ATVMod::pull(Sample& sample)
m_settingsMutex.lock();
- if (m_tvSampleRate == m_running.m_outputSampleRate) // no interpolation nor decimation
+ if ((m_tvSampleRate == m_running.m_outputSampleRate) && (!m_running.m_forceDecimator)) // no interpolation nor decimation
{
modulateSample();
pullFinalize(m_modSample, sample);
@@ -541,6 +543,7 @@ bool ATVMod::handleMessage(const Message& cmd)
m_config.m_invertedVideo = cfg.getInvertedVideo();
m_config.m_rfScalingFactor = cfg.getRFScaling();
m_config.m_fmExcursion = cfg.getFMExcursion();
+ m_config.m_forceDecimator = cfg.getForceDecimator();
apply();
@@ -559,7 +562,8 @@ bool ATVMod::handleMessage(const Message& cmd)
<< " m_channelMute: " << m_config.m_channelMute
<< " m_invertedVideo: " << m_config.m_invertedVideo
<< " m_rfScalingFactor: " << m_config.m_rfScalingFactor
- << " m_fmExcursion: " << m_config.m_fmExcursion;
+ << " m_fmExcursion: " << m_config.m_fmExcursion
+ << " m_forceDecimator: " << m_config.m_forceDecimator;
return true;
}
@@ -736,6 +740,7 @@ void ATVMod::apply(bool force)
m_running.m_invertedVideo = m_config.m_invertedVideo;
m_running.m_rfScalingFactor = m_config.m_rfScalingFactor;
m_running.m_fmExcursion = m_config.m_fmExcursion;
+ m_running.m_forceDecimator = m_config.m_forceDecimator;
}
void ATVMod::getBaseValues(int linesPerSecond, int& sampleRateUnits, int& nbPointsPerRateUnit)
diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h
index 3e0eb8211..4edc477da 100644
--- a/plugins/channeltx/modatv/atvmod.h
+++ b/plugins/channeltx/modatv/atvmod.h
@@ -349,7 +349,8 @@ public:
bool channelMute,
bool invertedVideo,
float rfScaling,
- float fmExcursion);
+ float fmExcursion,
+ bool forceDecimator);
virtual void pull(Sample& sample);
virtual void pullAudio(int nbSamples); // this is used for video signal actually
@@ -394,6 +395,7 @@ private:
bool getInvertedVideo() const { return m_invertedVideo; }
float getRFScaling() const { return m_rfScaling; }
float getFMExcursion() const { return m_fmExcursion; }
+ bool getForceDecimator() const { return m_forceDecimator; }
static MsgConfigureATVMod* create(
Real rfBandwidth,
@@ -410,7 +412,8 @@ private:
bool channelMute,
bool invertedVideo,
float rfScaling,
- float fmExcursion)
+ float fmExcursion,
+ bool forceDecimator)
{
return new MsgConfigureATVMod(
rfBandwidth,
@@ -427,7 +430,8 @@ private:
channelMute,
invertedVideo,
rfScaling,
- fmExcursion);
+ fmExcursion,
+ forceDecimator);
}
private:
@@ -446,6 +450,7 @@ private:
bool m_invertedVideo;
float m_rfScaling;
float m_fmExcursion;
+ bool m_forceDecimator;
MsgConfigureATVMod(
Real rfBandwidth,
@@ -462,7 +467,8 @@ private:
bool channelMute,
bool invertedVideo,
float rfScaling,
- float fmExcursion) :
+ float fmExcursion,
+ bool forceDecimator) :
Message(),
m_rfBandwidth(rfBandwidth),
m_rfOppBandwidth(rfOppBandwidth),
@@ -478,7 +484,8 @@ private:
m_channelMute(channelMute),
m_invertedVideo(invertedVideo),
m_rfScaling(rfScaling),
- m_fmExcursion(fmExcursion)
+ m_fmExcursion(fmExcursion),
+ m_forceDecimator(forceDecimator)
{ }
};
@@ -529,6 +536,7 @@ private:
bool m_invertedVideo; //!< True if video signal is inverted before modulation
float m_rfScalingFactor; //!< Scaling factor from +/-1 to +/-2^15
float m_fmExcursion; //!< FM excursion factor relative to full bandwidth
+ bool m_forceDecimator; //!< Forces decimator even when channel and source sample rates are equal
Config() :
m_outputSampleRate(-1),
@@ -547,7 +555,8 @@ private:
m_channelMute(false),
m_invertedVideo(false),
m_rfScalingFactor(29204.0f), // -1dB
- m_fmExcursion(0.5f) // half bandwidth
+ m_fmExcursion(0.5f), // half bandwidth
+ m_forceDecimator(false)
{ }
};
diff --git a/plugins/channeltx/modatv/atvmodgui.cpp b/plugins/channeltx/modatv/atvmodgui.cpp
index d927f1ad6..e098d905d 100644
--- a/plugins/channeltx/modatv/atvmodgui.cpp
+++ b/plugins/channeltx/modatv/atvmodgui.cpp
@@ -435,6 +435,11 @@ void ATVModGUI::on_channelMute_toggled(bool checked)
applySettings();
}
+void ATVModGUI::on_forceDecimator_toggled(bool checked)
+{
+ applySettings();
+}
+
void ATVModGUI::on_imageFileDialog_clicked(bool checked)
{
QString fileName = QFileDialog::getOpenFileName(this,
@@ -638,7 +643,8 @@ void ATVModGUI::applySettings()
ui->channelMute->isChecked(),
ui->invertVideo->isChecked(),
ui->rfScaling->value() * 327.68f,
- ui->fmExcursion->value() / 100.0f);
+ ui->fmExcursion->value() / 100.0f,
+ ui->forceDecimator->isChecked());
}
}
diff --git a/plugins/channeltx/modatv/atvmodgui.h b/plugins/channeltx/modatv/atvmodgui.h
index be8bf8bb0..5549c908b 100644
--- a/plugins/channeltx/modatv/atvmodgui.h
+++ b/plugins/channeltx/modatv/atvmodgui.h
@@ -63,6 +63,7 @@ private slots:
void on_deltaFrequency_changed(quint64 value);
void on_deltaMinus_toggled(bool minus);
void on_channelMute_toggled(bool checked);
+ void on_forceDecimator_toggled(bool checked);
void on_modulation_currentIndexChanged(int index);
void on_rfScaling_valueChanged(int value);
void on_fmExcursion_valueChanged(int value);
diff --git a/plugins/channeltx/modatv/atvmodgui.ui b/plugins/channeltx/modatv/atvmodgui.ui
index db0951907..09d1f1c10 100644
--- a/plugins/channeltx/modatv/atvmodgui.ui
+++ b/plugins/channeltx/modatv/atvmodgui.ui
@@ -130,6 +130,20 @@
+ -
+
+
+ Force decimaor usage
+
+
+
+
+
+
+ :/arrow_down.png:/arrow_down.png
+
+
+
-