#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 ]; } };