mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
RMS meter - reset after calculating new data
This commit is contained in:
parent
e9289a19c8
commit
a716f3c55a
1 changed files with 11 additions and 8 deletions
|
|
@ -46,12 +46,6 @@ void Kmeterdsp::process (float *p, int n)
|
||||||
|
|
||||||
float s, t, z1, z2;
|
float s, t, z1, z2;
|
||||||
|
|
||||||
if (_flag) // Display thread has read the rms value.
|
|
||||||
{
|
|
||||||
_rms = 0;
|
|
||||||
_flag = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get filter state.
|
// Get filter state.
|
||||||
z1 = _z1;
|
z1 = _z1;
|
||||||
z2 = _z2;
|
z2 = _z2;
|
||||||
|
|
@ -88,9 +82,18 @@ void Kmeterdsp::process (float *p, int n)
|
||||||
_z1 = z1 + 1e-20f;
|
_z1 = z1 + 1e-20f;
|
||||||
_z2 = z2 + 1e-20f;
|
_z2 = z2 + 1e-20f;
|
||||||
|
|
||||||
// Adjust RMS value and update maximum since last read().
|
|
||||||
s = sqrtf (2 * z2);
|
s = sqrtf (2 * z2);
|
||||||
if (s > _rms) _rms = s;
|
|
||||||
|
if (_flag) // Display thread has read the rms value.
|
||||||
|
{
|
||||||
|
_rms = s;
|
||||||
|
_flag = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Adjust RMS value and update maximum since last read().
|
||||||
|
if (s > _rms) _rms = s;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue