Ever since I've been using
Winamp, I've always been a big fan of their PeakMeter area.
This is the main reason of this control. It is also one of the few PeakMeter that you can find over web.
There are two versions of this control depending on whether you are using MFC or .NET. The new .NET version offers more features.
To use in MFC application, you can subclass a
STATIC control or you can create it directly with
Create().
// define a member variable in your header file
CPeakMeterCtrl m_PeakMeter1;
// in your .cpp, use DataExchange to subclass
void CPeakMeterDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPeakMeterDlg)
DDX_Control(pDX, IDC_PMC_HORZ, m_PeakMeter1);
//}}AFX_DATA_MAP
}
// Create this control with create
m_PeakMeter2.Create(WS_CHILD|WS_VISIBLE, rc, this, IDC_PMC_VERT);
// note: call SetMeterStyle to change meter style
m_PeakMeter2.SetMeterStyle(PMS_VERTICAL);
m_PeakMeter2.SetMeterBands(10, 15);
m_PeakMeter2.Start(1000/20); // 20 fps