CreateLevelsForAllConChannels shall call CStereoSignalLevelMeter::CalcLogResult
This commit is contained in:
parent
9503630c4a
commit
631c473acc
3 changed files with 8 additions and 18 deletions
|
@ -11,8 +11,7 @@
|
||||||
* fixed column widths are slightly too narrow for "Ping Time" and "Musicians" and typos
|
* fixed column widths are slightly too narrow for "Ping Time" and "Musicians" and typos
|
||||||
|
|
||||||
|
|
||||||
|
TODO fix UpdateCurLevel() for new 64 samples frame size
|
||||||
TODO in CreateLevelsForAllConChannels we should call CStereoSignalLevelMeter::CalcLogResult instead -> make it public and static
|
|
||||||
|
|
||||||
TODO auto jitter buffer performance not good at 64 samples frame size
|
TODO auto jitter buffer performance not good at 64 samples frame size
|
||||||
|
|
||||||
|
|
|
@ -1715,17 +1715,7 @@ void CServer::CreateLevelsForAllConChannels ( const int i
|
||||||
vecChannels[iChId].SetPrevLevel ( dCurLevel );
|
vecChannels[iChId].SetPrevLevel ( dCurLevel );
|
||||||
|
|
||||||
// logarithmic measure
|
// logarithmic measure
|
||||||
// TODO we should call CStereoSignalLevelMeter::CalcLogResult instead -> make it public and static
|
double dCurSigLevel = CStereoSignalLevelMeter::CalcLogResult ( dCurLevel );
|
||||||
const double dNormChanLevel = dCurLevel / _MAXSHORT;
|
|
||||||
double dCurSigLevel;
|
|
||||||
if ( dNormChanLevel > 0 )
|
|
||||||
{
|
|
||||||
dCurSigLevel = 20.0 * log10 ( dNormChanLevel );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dCurSigLevel = -100000.0; // large negative value
|
|
||||||
}
|
|
||||||
|
|
||||||
// map to signal level meter
|
// map to signal level meter
|
||||||
dCurSigLevel -= LOW_BOUND_SIG_METER;
|
dCurSigLevel -= LOW_BOUND_SIG_METER;
|
||||||
|
|
11
src/util.h
11
src/util.h
|
@ -594,17 +594,18 @@ class CStereoSignalLevelMeter
|
||||||
public:
|
public:
|
||||||
CStereoSignalLevelMeter() { Reset(); }
|
CStereoSignalLevelMeter() { Reset(); }
|
||||||
|
|
||||||
void Update ( const CVector<short>& vecsAudio );
|
void Update ( const CVector<short>& vecsAudio );
|
||||||
double MicLevelLeft() { return CalcLogResult ( dCurLevelL ); }
|
double MicLevelLeft() { return CalcLogResult ( dCurLevelL ); }
|
||||||
double MicLevelRight() { return CalcLogResult ( dCurLevelR ); }
|
double MicLevelRight() { return CalcLogResult ( dCurLevelR ); }
|
||||||
void Reset()
|
static double CalcLogResult ( const double& dLinearLevel );
|
||||||
|
|
||||||
|
void Reset()
|
||||||
{
|
{
|
||||||
dCurLevelL = 0.0;
|
dCurLevelL = 0.0;
|
||||||
dCurLevelR = 0.0;
|
dCurLevelR = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double CalcLogResult ( const double& dLinearLevel );
|
|
||||||
double UpdateCurLevel ( double dCurLevel,
|
double UpdateCurLevel ( double dCurLevel,
|
||||||
const short& sMax );
|
const short& sMax );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue