The GraphicBarsManager object, accessible through the control's GraphicBarsManager property, is internally implemented as a COM interface called IGraphicBarsManager and contains information needed to render custom graphic bars like VU-Meters bars, Spectrum bars and Progress bars.
It can be used at Run-time in order to create various graphic bars and to change their graphical settings. For details about using graphic bars refer to the How to perform custom feedbacks rendering using graphic bars section.
The GraphicBarsManager object is implemented through the following methods:
The following code snippets show how to create and change this object in your code. These examples assume that you have placed a control named MyRecorder on a form or dialog box and that you want to change the graphic bar's range from 0 to 100.
Properties and methods of the control are accessible through the control wrapper class CActiveSoundRecorder contained inside the ActiveSoundRecorder.cpp and ActiveSoundRecorder.h files: these wrapper files are automatically generated when you insert the control inside your project so, in order to access the wrapper functions, you will have to insert the following line of code somewhere in your code.
The GraphicBarsManager object is defined by the control wrapper class CGraphicBarsManager contained inside the GraphicBarsManager.cpp and GraphicBarsManager.h files: also these wrapper files are automatically generated when you insert the control inside your project so, in order to access this object, you will have to insert the following line of code somewhere in your code.
Here follows the code needed to perform the requested operation of initialising the Spectrum object and changing some of its properties.
// declare a GraphicBarsManager object
// init the object with the control's GraphicBarsManager reference
graphicBarsMan = MyRecorder.GetGraphicBarsManager ();
// create a new graphic bar control as a child control of the container dialog box
HWND hWndBar = (HWND) graphicBarsMan.Create ((OLE_HANDLE) GetSafeHwnd (), 10, 10, 50, 100);
// change the new graphic bar's range from 0 to 100
graphicBarsMan.SetRange (hWndBar, 0, 100);
Here follows the code needed to perform the requested operations
' create a new graphic bar control as a child control of the container form
Dim hWndBar As OLE_HANDLE
hWndBar = MyRecorder.GraphicBarsManager.Create(Me.hWnd, 10, 10, 50, 100)
' change the new graphic bar's range from 0 to 100
MyRecorder.GraphicBarsManager.SetRange (hWndBar, 0, 100);
Samples of use of the GraphicBarsManager object in Visual Basic 6 and Visual C++ 6 can be found inside the following samples installed with the product's setup package: