1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-05-30 05:52:24 -04:00

Tx plugins: fixed VU meter handling

This commit is contained in:
f4exb 2019-12-07 11:47:52 +01:00
parent fb242d15d3
commit 12735f26a9
21 changed files with 49 additions and 42 deletions

View File

@ -97,7 +97,8 @@ void AMModBaseband::handleData()
unsigned int ipart1end; unsigned int ipart1end;
unsigned int ipart2begin; unsigned int ipart2begin;
unsigned int ipart2end; unsigned int ipart2end;
Real rmsLevel, peakLevel, numSamples; qreal rmsLevel, peakLevel;
int numSamples;
unsigned int remainder = m_sampleFifo.remainder(); unsigned int remainder = m_sampleFifo.remainder();

View File

@ -27,7 +27,7 @@
const PluginDescriptor AMModPlugin::m_pluginDescriptor = { const PluginDescriptor AMModPlugin::m_pluginDescriptor = {
QString("AM Modulator"), QString("AM Modulator"),
QString("4.12.1"), QString("4.12.2"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,

View File

@ -52,10 +52,10 @@ public:
unsigned int getFeedbackAudioSampleRate() const { return m_feedbackAudioSampleRate; } unsigned int getFeedbackAudioSampleRate() const { return m_feedbackAudioSampleRate; }
CWKeyer& getCWKeyer() { return m_cwKeyer; } CWKeyer& getCWKeyer() { return m_cwKeyer; }
double getMagSq() const { return m_magsq; } double getMagSq() const { return m_magsq; }
void getLevels(Real& rmsLevel, Real& peakLevel, Real& numSamples) const void getLevels(qreal& rmsLevel, qreal& peakLevel, int& numSamples) const
{ {
rmsLevel = m_rmsLevel; rmsLevel = m_rmsLevel;
peakLevel = m_peakLevel; peakLevel = m_peakLevelOut;
numSamples = m_levelNbSamples; numSamples = m_levelNbSamples;
} }
void applySettings(const AMModSettings& settings, bool force = false); void applySettings(const AMModSettings& settings, bool force = false);
@ -94,8 +94,8 @@ private:
AudioFifo m_feedbackAudioFifo; AudioFifo m_feedbackAudioFifo;
quint32 m_levelCalcCount; quint32 m_levelCalcCount;
Real m_rmsLevel; qreal m_rmsLevel;
Real m_peakLevelOut; qreal m_peakLevelOut;
Real m_peakLevel; Real m_peakLevel;
Real m_levelSum; Real m_levelSum;

View File

@ -96,7 +96,8 @@ void ATVModBaseband::handleData()
unsigned int ipart1end; unsigned int ipart1end;
unsigned int ipart2begin; unsigned int ipart2begin;
unsigned int ipart2end; unsigned int ipart2end;
Real rmsLevel, peakLevel, numSamples; qreal rmsLevel, peakLevel;
int numSamples;
unsigned int remainder = m_sampleFifo.remainder(); unsigned int remainder = m_sampleFifo.remainder();

View File

@ -55,10 +55,10 @@ public:
void getCameraNumbers(std::vector<int>& numbers); void getCameraNumbers(std::vector<int>& numbers);
void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; } void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; }
void getLevels(Real& rmsLevel, Real& peakLevel, Real& numSamples) const void getLevels(qreal& rmsLevel, qreal& peakLevel, int& numSamples) const
{ {
rmsLevel = m_rmsLevel; rmsLevel = m_rmsLevel;
peakLevel = m_peakLevel; peakLevel = m_peakLevelOut;
numSamples = m_levelNbSamples; numSamples = m_levelNbSamples;
} }
@ -172,8 +172,8 @@ private:
MovingAverageUtil<double, double, 16> m_movingAverage; MovingAverageUtil<double, double, 16> m_movingAverage;
quint32 m_levelCalcCount; quint32 m_levelCalcCount;
Real m_rmsLevel; qreal m_rmsLevel;
Real m_peakLevelOut; qreal m_peakLevelOut;
Real m_peakLevel; Real m_peakLevel;
Real m_levelSum; Real m_levelSum;

View File

@ -93,7 +93,8 @@ void FreeDVModBaseband::handleData()
unsigned int ipart1end; unsigned int ipart1end;
unsigned int ipart2begin; unsigned int ipart2begin;
unsigned int ipart2end; unsigned int ipart2end;
Real rmsLevel, peakLevel, numSamples; qreal rmsLevel, peakLevel;
int numSamples;
unsigned int remainder = m_sampleFifo.remainder(); unsigned int remainder = m_sampleFifo.remainder();

View File

@ -27,7 +27,7 @@
const PluginDescriptor FreeDVModPlugin::m_pluginDescriptor = { const PluginDescriptor FreeDVModPlugin::m_pluginDescriptor = {
QString("FreeDV Modulator"), QString("FreeDV Modulator"),
QString("4.12.1"), QString("4.12.2"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,

View File

@ -52,10 +52,10 @@ public:
void applyAudioSampleRate(unsigned int sampleRate); void applyAudioSampleRate(unsigned int sampleRate);
CWKeyer& getCWKeyer() { return m_cwKeyer; } CWKeyer& getCWKeyer() { return m_cwKeyer; }
double getMagSq() const { return m_magsq; } double getMagSq() const { return m_magsq; }
void getLevels(Real& rmsLevel, Real& peakLevel, Real& numSamples) const void getLevels(qreal& rmsLevel, qreal& peakLevel, int& numSamples) const
{ {
rmsLevel = m_rmsLevel; rmsLevel = m_rmsLevel;
peakLevel = m_peakLevel; peakLevel = m_peakLevelOut;
numSamples = m_levelNbSamples; numSamples = m_levelNbSamples;
} }
unsigned int getAudioSampleRate() const { return m_audioSampleRate; } unsigned int getAudioSampleRate() const { return m_audioSampleRate; }
@ -106,8 +106,8 @@ private:
AudioFifo m_audioFifo; AudioFifo m_audioFifo;
quint32 m_levelCalcCount; quint32 m_levelCalcCount;
Real m_rmsLevel; qreal m_rmsLevel;
Real m_peakLevelOut; qreal m_peakLevelOut;
Real m_peakLevel; Real m_peakLevel;
Real m_levelSum; Real m_levelSum;

View File

@ -97,7 +97,8 @@ void NFMModBaseband::handleData()
unsigned int ipart1end; unsigned int ipart1end;
unsigned int ipart2begin; unsigned int ipart2begin;
unsigned int ipart2end; unsigned int ipart2end;
Real rmsLevel, peakLevel, numSamples; qreal rmsLevel, peakLevel;
int numSamples;
unsigned int remainder = m_sampleFifo.remainder(); unsigned int remainder = m_sampleFifo.remainder();

View File

@ -27,7 +27,7 @@
const PluginDescriptor NFMModPlugin::m_pluginDescriptor = { const PluginDescriptor NFMModPlugin::m_pluginDescriptor = {
QString("NFM Modulator"), QString("NFM Modulator"),
QString("4.12.1"), QString("4.12.2"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,

View File

@ -274,7 +274,7 @@ void NFMModSource::calculateLevel(Real& sample)
} }
else else
{ {
qreal rmsLevel = sqrt(m_levelSum / m_levelNbSamples); m_rmsLevel = sqrt(m_levelSum / m_levelNbSamples);
m_peakLevelOut = m_peakLevel; m_peakLevelOut = m_peakLevel;
m_peakLevel = 0.0f; m_peakLevel = 0.0f;
m_levelSum = 0.0f; m_levelSum = 0.0f;

View File

@ -55,10 +55,10 @@ public:
unsigned int getFeedbackAudioSampleRate() const { return m_feedbackAudioSampleRate; } unsigned int getFeedbackAudioSampleRate() const { return m_feedbackAudioSampleRate; }
CWKeyer& getCWKeyer() { return m_cwKeyer; } CWKeyer& getCWKeyer() { return m_cwKeyer; }
double getMagSq() const { return m_magsq; } double getMagSq() const { return m_magsq; }
void getLevels(Real& rmsLevel, Real& peakLevel, Real& numSamples) const void getLevels(qreal& rmsLevel, qreal& peakLevel, int& numSamples) const
{ {
rmsLevel = m_rmsLevel; rmsLevel = m_rmsLevel;
peakLevel = m_peakLevel; peakLevel = m_peakLevelOut;
numSamples = m_levelNbSamples; numSamples = m_levelNbSamples;
} }
void applySettings(const NFMModSettings& settings, bool force = false); void applySettings(const NFMModSettings& settings, bool force = false);
@ -103,8 +103,8 @@ private:
AudioFifo m_feedbackAudioFifo; AudioFifo m_feedbackAudioFifo;
quint32 m_levelCalcCount; quint32 m_levelCalcCount;
Real m_rmsLevel; qreal m_rmsLevel;
Real m_peakLevelOut; qreal m_peakLevelOut;
Real m_peakLevel; Real m_peakLevel;
Real m_levelSum; Real m_levelSum;

View File

@ -97,7 +97,8 @@ void SSBModBaseband::handleData()
unsigned int ipart1end; unsigned int ipart1end;
unsigned int ipart2begin; unsigned int ipart2begin;
unsigned int ipart2end; unsigned int ipart2end;
Real rmsLevel, peakLevel, numSamples; qreal rmsLevel, peakLevel;
int numSamples;
unsigned int remainder = m_sampleFifo.remainder(); unsigned int remainder = m_sampleFifo.remainder();

View File

@ -27,7 +27,7 @@
const PluginDescriptor SSBModPlugin::m_pluginDescriptor = { const PluginDescriptor SSBModPlugin::m_pluginDescriptor = {
QString("SSB Modulator"), QString("SSB Modulator"),
QString("4.12.1"), QString("4.12.2"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,

View File

@ -55,10 +55,10 @@ public:
unsigned int getFeedbackAudioSampleRate() const { return m_feedbackAudioSampleRate; } unsigned int getFeedbackAudioSampleRate() const { return m_feedbackAudioSampleRate; }
CWKeyer& getCWKeyer() { return m_cwKeyer; } CWKeyer& getCWKeyer() { return m_cwKeyer; }
double getMagSq() const { return m_magsq; } double getMagSq() const { return m_magsq; }
void getLevels(Real& rmsLevel, Real& peakLevel, Real& numSamples) const void getLevels(qreal& rmsLevel, qreal& peakLevel, int& numSamples) const
{ {
rmsLevel = m_rmsLevel; rmsLevel = m_rmsLevel;
peakLevel = m_peakLevel; peakLevel = m_peakLevelOut;
numSamples = m_levelNbSamples; numSamples = m_levelNbSamples;
} }
void applySettings(const SSBModSettings& settings, bool force = false); void applySettings(const SSBModSettings& settings, bool force = false);
@ -113,8 +113,8 @@ private:
AudioFifo m_feedbackAudioFifo; AudioFifo m_feedbackAudioFifo;
quint32 m_levelCalcCount; quint32 m_levelCalcCount;
Real m_rmsLevel; qreal m_rmsLevel;
Real m_peakLevelOut; qreal m_peakLevelOut;
Real m_peakLevel; Real m_peakLevel;
Real m_levelSum; Real m_levelSum;

View File

@ -93,7 +93,8 @@ void WFMModBaseband::handleData()
unsigned int ipart1end; unsigned int ipart1end;
unsigned int ipart2begin; unsigned int ipart2begin;
unsigned int ipart2end; unsigned int ipart2end;
Real rmsLevel, peakLevel, numSamples; qreal rmsLevel, peakLevel;
int numSamples;
unsigned int remainder = m_sampleFifo.remainder(); unsigned int remainder = m_sampleFifo.remainder();

View File

@ -27,7 +27,7 @@
const PluginDescriptor WFMModPlugin::m_pluginDescriptor = { const PluginDescriptor WFMModPlugin::m_pluginDescriptor = {
QString("WFM Modulator"), QString("WFM Modulator"),
QString("4.12.1"), QString("4.12.2"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,

View File

@ -51,10 +51,10 @@ public:
unsigned int getAudioSampleRate() const { return m_audioSampleRate; } unsigned int getAudioSampleRate() const { return m_audioSampleRate; }
CWKeyer& getCWKeyer() { return m_cwKeyer; } CWKeyer& getCWKeyer() { return m_cwKeyer; }
double getMagSq() const { return m_magsq; } double getMagSq() const { return m_magsq; }
void getLevels(Real& rmsLevel, Real& peakLevel, Real& numSamples) const void getLevels(qreal& rmsLevel, qreal& peakLevel, int& numSamples) const
{ {
rmsLevel = m_rmsLevel; rmsLevel = m_rmsLevel;
peakLevel = m_peakLevel; peakLevel = m_peakLevelOut;
numSamples = m_levelNbSamples; numSamples = m_levelNbSamples;
} }
void applySettings(const WFMModSettings& settings, bool force = false); void applySettings(const WFMModSettings& settings, bool force = false);
@ -89,8 +89,8 @@ private:
AudioFifo m_audioFifo; AudioFifo m_audioFifo;
quint32 m_levelCalcCount; quint32 m_levelCalcCount;
Real m_rmsLevel; qreal m_rmsLevel;
Real m_peakLevelOut; qreal m_peakLevelOut;
Real m_peakLevel; Real m_peakLevel;
Real m_levelSum; Real m_levelSum;

View File

@ -94,7 +94,8 @@ void UDPSourceBaseband::handleData()
unsigned int ipart1end; unsigned int ipart1end;
unsigned int ipart2begin; unsigned int ipart2begin;
unsigned int ipart2end; unsigned int ipart2end;
Real rmsLevel, peakLevel, numSamples; qreal rmsLevel, peakLevel;
int numSamples;
unsigned int remainder = m_sampleFifo.remainder(); unsigned int remainder = m_sampleFifo.remainder();

View File

@ -30,7 +30,7 @@
const PluginDescriptor UDPSourcePlugin::m_pluginDescriptor = { const PluginDescriptor UDPSourcePlugin::m_pluginDescriptor = {
QString("UDP Channel Source"), QString("UDP Channel Source"),
QString("4.12.1"), QString("4.12.2"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,

View File

@ -55,10 +55,10 @@ public:
void applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force = false); void applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force = false);
void applySettings(const UDPSourceSettings& settings, bool force = false); void applySettings(const UDPSourceSettings& settings, bool force = false);
void getLevels(Real& rmsLevel, Real& peakLevel, Real& numSamples) const void getLevels(qreal& rmsLevel, qreal& peakLevel, int& numSamples) const
{ {
rmsLevel = m_rmsLevel; rmsLevel = m_rmsLevel;
peakLevel = m_peakLevel; peakLevel = m_peakLevelOut;
numSamples = m_levelNbSamples; numSamples = m_levelNbSamples;
} }
@ -96,8 +96,8 @@ private:
int m_sampleRateAvgCounter; int m_sampleRateAvgCounter;
int m_levelCalcCount; int m_levelCalcCount;
Real m_rmsLevel; qreal m_rmsLevel;
Real m_peakLevelOut; qreal m_peakLevelOut;
Real m_peakLevel; Real m_peakLevel;
double m_levelSum; double m_levelSum;
int m_levelNbSamples; int m_levelNbSamples;