probably fix DisplayBpms::BpmIsConstant problems

const fixes
This commit is contained in:
Glenn Maynard
2004-11-30 07:56:01 +00:00
parent d3cf647638
commit c5a1874234
2 changed files with 9 additions and 9 deletions
+5 -5
View File
@@ -179,7 +179,7 @@ void DisplayBpms::Add( float f )
vfBpms.push_back( f ); vfBpms.push_back( f );
} }
float DisplayBpms::GetMin() float DisplayBpms::GetMin() const
{ {
float fMin = 99999; float fMin = 99999;
FOREACH_CONST( float, vfBpms, f ) FOREACH_CONST( float, vfBpms, f )
@@ -193,7 +193,7 @@ float DisplayBpms::GetMin()
return fMin; return fMin;
} }
float DisplayBpms::GetMax() float DisplayBpms::GetMax() const
{ {
float fMax = 0; float fMax = 0;
FOREACH_CONST( float, vfBpms, f ) FOREACH_CONST( float, vfBpms, f )
@@ -204,12 +204,12 @@ float DisplayBpms::GetMax()
return fMax; return fMax;
} }
bool DisplayBpms::BpmIsConstant() bool DisplayBpms::BpmIsConstant() const
{ {
return GetMin() == GetMax(); return fabsf( GetMin() - GetMax() ) < 0.001f;
} }
bool DisplayBpms::IsMystery() bool DisplayBpms::IsMystery() const
{ {
FOREACH_CONST( float, vfBpms, f ) FOREACH_CONST( float, vfBpms, f )
{ {
+4 -4
View File
@@ -316,10 +316,10 @@ PeakComboAward StringToPeakComboAward( const CString& pma );
struct DisplayBpms struct DisplayBpms
{ {
void Add( float f ); void Add( float f );
float GetMin(); float GetMin() const;
float GetMax(); float GetMax() const;
bool BpmIsConstant(); bool BpmIsConstant() const;
bool IsMystery(); bool IsMystery() const;
vector<float> vfBpms; vector<float> vfBpms;
}; };