port from perforce
This commit is contained in:
43
evoke-64k/ev10/VUMeter.h
Normal file
43
evoke-64k/ev10/VUMeter.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
struct SVUMeter
|
||||
{
|
||||
const static int m_iBufferLength= 441;
|
||||
float m_fVUData[ m_iBufferLength ];
|
||||
int m_iLastPos;
|
||||
|
||||
SVUMeter()
|
||||
{
|
||||
m_iLastPos= 0;
|
||||
for( int i= 0; i < m_iBufferLength; ++i )
|
||||
{
|
||||
m_fVUData[ i ]= 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void Set( int iPos,
|
||||
float fVal )
|
||||
{
|
||||
iPos= iPos % m_iBufferLength;
|
||||
while( true )
|
||||
{
|
||||
m_fVUData[ m_iLastPos ]= fVal;
|
||||
if( m_iLastPos != iPos )
|
||||
{
|
||||
m_iLastPos++;
|
||||
m_iLastPos= m_iLastPos % m_iBufferLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float Get( int iPos )
|
||||
{
|
||||
iPos= iPos % m_iBufferLength;
|
||||
return m_fVUData[ iPos ];
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user