ATV Modulator: added display of points per line

pull/27/head
f4exb 2017-03-22 11:48:39 +01:00
rodzic 0ea39c217c
commit 2a08949245
5 zmienionych plików z 32 dodań i 6 usunięć

Wyświetl plik

@ -16,9 +16,10 @@
#include "devicehackrfvalues.h"
const unsigned int HackRFSampleRates::m_nb_rates = 21;
const unsigned int HackRFSampleRates::m_nb_rates = 22;
const unsigned int HackRFSampleRates::m_rates[HackRFSampleRates::m_nb_rates] = {
2400000,
2600000,
3000000,
3150000, // for PAL-M
3200000,

Wyświetl plik

@ -665,6 +665,7 @@ void ATVMod::apply(bool force)
int rateUnits, nbPointsPerRateUnit;
getBaseValues(m_config.m_nbLines * m_config.m_fps, rateUnits, nbPointsPerRateUnit);
m_tvSampleRate = (m_config.m_outputSampleRate / rateUnits) * rateUnits; // make sure working sample rate is a multiple of rate units
m_pointsPerLine = (m_tvSampleRate / rateUnits) * nbPointsPerRateUnit;
m_settingsMutex.lock();
@ -690,7 +691,7 @@ void ATVMod::apply(bool force)
m_settingsMutex.unlock();
MsgReportEffectiveSampleRate *report;
report = MsgReportEffectiveSampleRate::create(m_tvSampleRate);
report = MsgReportEffectiveSampleRate::create(m_tvSampleRate, m_pointsPerLine);
getOutputMessageQueue()->push(report);
}

Wyświetl plik

@ -311,18 +311,23 @@ public:
public:
int getSampleRate() const { return m_sampleRate; }
uint32_t gatNbPointsPerLine() const { return m_nbPointsPerLine; }
static MsgReportEffectiveSampleRate* create(int sampleRate)
static MsgReportEffectiveSampleRate* create(int sampleRate, uint32_t nbPointsPerLine)
{
return new MsgReportEffectiveSampleRate(sampleRate);
return new MsgReportEffectiveSampleRate(sampleRate, nbPointsPerLine);
}
protected:
int m_sampleRate;
uint32_t m_nbPointsPerLine;
MsgReportEffectiveSampleRate(int sampleRate) :
MsgReportEffectiveSampleRate(
int sampleRate,
uint32_t nbPointsPerLine) :
Message(),
m_sampleRate(sampleRate)
m_sampleRate(sampleRate),
m_nbPointsPerLine(nbPointsPerLine)
{ }
};
@ -556,6 +561,7 @@ private:
Real m_interpolatorDistance;
Real m_interpolatorDistanceRemain;
int m_tvSampleRate; //!< sample rate for generating signal
uint32_t m_pointsPerLine; //!< Number of points per full line
uint32_t m_pointsPerSync; //!< number of line points for the horizontal sync
uint32_t m_pointsPerBP; //!< number of line points for the back porch
uint32_t m_pointsPerImgLine; //!< number of line points for the image line

Wyświetl plik

@ -214,7 +214,9 @@ bool ATVModGUI::handleMessage(const Message& message)
else if (ATVMod::MsgReportEffectiveSampleRate::match(message))
{
int sampleRate = ((ATVMod::MsgReportEffectiveSampleRate&)message).getSampleRate();
uint32_t nbPointsPerLine = ((ATVMod::MsgReportEffectiveSampleRate&)message).gatNbPointsPerLine();
ui->channelSampleRateText->setText(tr("%1k").arg(sampleRate/1000.0f, 0, 'f', 0));
ui->nbPointsPerLineText->setText(tr("%1p").arg(nbPointsPerLine));
setRFFiltersSlidersRange(sampleRate);
return true;
}

Wyświetl plik

@ -146,6 +146,22 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="nbPointsPerLineText">
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>0000p</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">