diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp
index 2ccb18bfd..c8325b560 100644
--- a/plugins/channeltx/modatv/atvmod.cpp
+++ b/plugins/channeltx/modatv/atvmod.cpp
@@ -37,7 +37,7 @@ ATVMod::ATVMod() :
m_config.m_outputSampleRate = 1000000;
m_config.m_inputFrequencyOffset = 0;
m_config.m_rfBandwidth = 1000000;
- m_config.m_atvModInput = ATVModInputBarChart;
+ m_config.m_atvModInput = ATVModInputHBars;
m_config.m_atvStd = ATVStdPAL625;
applyStandard();
@@ -132,7 +132,7 @@ void ATVMod::modulateSample()
void ATVMod::pullVideo(Real& sample)
{
- if ((m_lineCount < 21) || (m_lineCount > 621) || ((m_lineCount > 309) && (m_lineCount < 335)))
+ if ((m_lineCount < 21) || (m_lineCount > 621) || ((m_lineCount > 309) && (m_lineCount < 333)))
{
pullVSyncLine(sample);
}
@@ -302,10 +302,16 @@ void ATVMod::applyStandard()
m_pointsPerFSync = (uint32_t) roundf(2.3f * m_pointsPerTU); // equalizing pulse (2.3/1.008 us)
// what is left in a 64/1.008 us line for the image
m_pointsPerImgLine = 64 * m_pointsPerTU - m_pointsPerSync - m_pointsPerBP - m_pointsPerFP;
- m_pointsPerBar = 10 * m_pointsPerTU; // set a bar length to 10/1.008 us (~5 bars per line)
+ m_pointsPerHBar = 10 * m_pointsPerTU; // set a bar length to 10/1.008 us (~5 bars per line)
+ m_linesPerVBar = 30;
m_nbLines = 525;
+ m_nbLines2 = 262;
+ m_nbImageLines = 510;
+ m_nbImageLines2 = 205;
m_interlaced = true;
m_nbHorizPoints = 64 * m_pointsPerTU; // full line
+ m_hBarIncrement = m_spanLevel / 5.0f;
+ m_vBarIncrement = m_spanLevel / 10.0f;
break;
case ATVStdPAL625:
default:
@@ -315,9 +321,15 @@ void ATVMod::applyStandard()
m_pointsPerFSync = (uint32_t) roundf(2.3f * m_pointsPerTU); // equalizing pulse (2.3 us)
// what is left in a 64 us line for the image
m_pointsPerImgLine = 64 * m_pointsPerTU - m_pointsPerSync - m_pointsPerBP - m_pointsPerFP;
- m_pointsPerBar = 10 * m_pointsPerTU; // set a bar length to 10 us (~5 bars per line)
+ m_pointsPerHBar = 10 * m_pointsPerTU; // set a bar length to 10 us (~5 bars per line)
+ m_linesPerVBar = 30;
m_nbLines = 625;
+ m_nbLines2 = 312;
+ m_nbImageLines = 610;
+ m_nbImageLines2 = 305;
m_interlaced = true;
m_nbHorizPoints = 64 * m_pointsPerTU; // full line
+ m_hBarIncrement = m_spanLevel / 5.0f;
+ m_vBarIncrement = m_spanLevel / 10.0f;
}
}
diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h
index a3c232d10..09bf3c6fa 100644
--- a/plugins/channeltx/modatv/atvmod.h
+++ b/plugins/channeltx/modatv/atvmod.h
@@ -41,8 +41,10 @@ public:
typedef enum
{
ATVModInputUniform,
- ATVModInputBarChart,
- ATVModInputGradient
+ ATVModInputHBars,
+ ATVModInputVBars,
+ ATVModInputHGradient,
+ ATVModInputVGradient
} ATVModInput;
ATVMod();
@@ -127,7 +129,7 @@ private:
m_inputFrequencyOffset(0),
m_rfBandwidth(0),
m_atvStd(ATVStdPAL625),
- m_atvModInput(ATVModInputBarChart),
+ m_atvModInput(ATVModInputHBars),
m_uniformLevel(0.5f)
{ }
};
@@ -146,10 +148,16 @@ private:
uint32_t m_pointsPerImgLine; //!< number of line points for the image line
uint32_t m_pointsPerFP; //!< number of line points for the front porch
uint32_t m_pointsPerFSync; //!< number of line points for the field first sync
- uint32_t m_pointsPerBar; //!< number of line points for a bar of the bar chart
+ uint32_t m_pointsPerHBar; //!< number of line points for a bar of the bar chart
+ uint32_t m_linesPerVBar; //!< number of lines for a bar of the bar chart
uint32_t m_pointsPerTU; //!< number of line points per time unit
uint32_t m_nbLines; //!< number of lines per complete frame
+ uint32_t m_nbLines2;
+ uint32_t m_nbImageLines;
+ uint32_t m_nbImageLines2;
uint32_t m_nbHorizPoints; //!< number of line points per horizontal line
+ float m_hBarIncrement;
+ float m_vBarIncrement;
bool m_interlaced; //!< true if image is interlaced (2 half frames per frame)
bool m_evenImage;
QMutex m_settingsMutex;
@@ -185,15 +193,22 @@ private:
else if (m_horizontalCount < m_pointsPerSync + m_pointsPerBP + m_pointsPerImgLine)
{
int pointIndex = m_horizontalCount - (m_pointsPerSync + m_pointsPerBP);
+ int iLine = m_lineCount % m_nbLines2;
switch(m_running.m_atvModInput)
{
- case ATVModInputBarChart:
- sample = (pointIndex / m_pointsPerBar) * (m_spanLevel/5.0f) + m_blackLevel;
+ case ATVModInputHBars:
+ sample = (pointIndex / m_pointsPerHBar) * m_hBarIncrement + m_blackLevel;
break;
- case ATVModInputGradient:
+ case ATVModInputVBars:
+ sample = (iLine / m_linesPerVBar) * m_vBarIncrement + m_blackLevel;
+ break;
+ case ATVModInputHGradient:
sample = (pointIndex / (float) m_pointsPerImgLine) * m_spanLevel + m_blackLevel;
break;
+ case ATVModInputVGradient:
+ sample = ((iLine -5) / (float) m_nbImageLines2) * m_spanLevel + m_blackLevel;
+ break;
case ATVModInputUniform:
default:
sample = m_spanLevel * m_running.m_uniformLevel + m_blackLevel;
diff --git a/plugins/channeltx/modatv/atvmodgui.ui b/plugins/channeltx/modatv/atvmodgui.ui
index 7158a959d..ae53a4b23 100644
--- a/plugins/channeltx/modatv/atvmodgui.ui
+++ b/plugins/channeltx/modatv/atvmodgui.ui
@@ -337,7 +337,17 @@
-
- Gradient
+ V Bars
+
+
+ -
+
+ H Grad
+
+
+ -
+
+ V Grad