Introduction
This Multimedia PeakMeter control can be used to display audio metering information in Multimedia applications. It has a few features like those found in WinAmp such as peak value fall off. This is the third version of this control, which now can display three different color ranges. I hope that you will find it useful. I don't think there's any free PeakMeter like this available.
Luigi Bianchi has made a free OWL Version of this control available. You may want to view it here. You are free to use this control as you wish as long as it is not sold for profit without my consent. Just let me know if you use it in your application.
Description
This control should be very easy to use since it uses the same format as other MFC standard controls. Each function includes a header with description. The Peak falloff speed can be controlled with SetFalloffDelay
function.
This new version allows you to use this control as a Progress control with the difference that you may have more than one band. To use this control as a progress control, don't call Start
function. Peak Falloff effect and Grid can be turned on and off by using SetFalloffEffect
and ShowGrid
respectively.
This control uses Keith Rule's CMemDC class. An ATL version of this control can be created easily. The class CMemDC
can be removed. An ATL (or ActiveX) version of this control can be created easily.
How to Use
Using this control is quite simple, you may create a static control and subclass it from a dialog. Both Vertical and Horizontal type of this control can be created this way. Add a static control to your dialog and use SS_LEFT
or SS_CENTER
to display the Horizontal or Vertical band for this control.
You may want to view the full features of this control by recompiling it with different values for color range and/or meter range. This control can also be used as a progress control. In this case, you should not call the Start
method.
void CPeakMeterDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_PMC_HORZ, m_PeakMeter1);
}
m_PeakMeter1.SetMeterBands(10, 10);
m_PeakMeter1.Start(1000/18);
m_PeakMeter2.Create(WS_CHILD|WS_VISIBLE|PMS_VERTICAL, rc, this, IDC_PMC_HORZ);
m_PeakMeter2.SetMeterBands(1, 10);
m_PeakMeter2.Start(1000/20);
m_PeakMeter1.SetData(ArrayData, 0, nElements);
History
- 4 Feb 2002 - 1.1: Improved Falloff effect to look more like Audio system.
- 10 June 2002 - 1.2: Added three ranges of color (low, medium, high).
- 26 June 2002 - updated source.
Ernest is a multi-discipline software engineer.
Skilled at software design and development for all Windows platforms.
-
MCSD (C#, .NET)
Interests: User Interface, GDI/GDI+, Scripting, Android, iOS, Windows Mobile.
Programming Skills: C/C++, C#, Java (Android), VB and ASP.NET.
I hope you will enjoy my contributions.