Copyright © 2006-2016 MultiMedia Soft

How to perform custom feedbacks rendering using graphic bars

Previous pageReturn to chapter overviewNext page

Active Sound Recorder comes with some new graphical feature implemented through the GraphicBarsManager property: one of these features is the capability to display graphic bars in both horizontal and vertical orientations; these bars work as child controls of the container form (with their own HWND window handle) so the first thing to do is to create one or more instance of the control through a call to the GraphicBarsManager.Create method; as all of the other windows control, the graphic bars can be moved and resized (GraphicBarsManager.Move method), shown or hidden (GraphicBarsManager.Show method), refreshed (GraphicBarsManager.Refresh method) or destroyed (GraphicBarsManager.Destroy method).

 

Graphic bars can be used for the following purposes:

 

VU-Meter bars rendering

 

Spectrum bars rendering

 

Progress bars rendering

 

 

Exactly as for regular Progress bar controls, graphic bars have a range, defined through the GraphicBarsManager.GetRange and GraphicBarsManager.SetRange methods, and a value defined through the GraphicBarsManager.GetValue and GraphicBarsManager.SetValue methods.

 

Graphical settings related to a specific graphic bar can be retrieved and modified through the GraphicBarsManager.GetGraphicalSettings and GraphicBarsManager.SetGraphicalSettings methods: both of them receive in input an object of class GRAPHIC_BAR_SETTINGS which can manage the following settings:

 

Orientation through the nOrientation property.

asrec_i000098

 

Colors through the colorStart, colorEnd and colorBackground properties: you can define two colors used for rendering the current value so the graphic bar can display either a gradient color or a solid color.

 

3D appearance through the bAppearance3d property

 

Smoothing through the bSmoothing property; graphic bars can be led-based but they can also appear smoothed as seen on the images below:

asrec_i000093asrec_i000094

 

Automatic drop through the bAutomaticDrop property; this feature allows decreasing the displayed value to 0 with a certain delay as seen on certain hardware based VU-meters when no input sound is available.

 

Gradient shape through the nShape property; you can define how the gradient limits are rendered as seen on the samples below:

asrec_i000093 asrec_i000096 asrec_i000097

 

When using the control inside a web page, where managing data structures is not an easy task, you can access single parameters of the GRAPHIC_BAR_SETTINGS data structure using the GraphicBarsManager.GetGraphicalSettingsParam and GraphicBarsManager.SetGraphicalSettingsParam methods.

 

When using the graphic bar for rendering a VU-Meter bar, you will have to set the range of the graphic bar from 0 to 32767 (using the GraphicBarsManager.SetRange method) and use values sent by the VUMeterValueChange event when calling the GraphicBarsManager.SetValue method.

 

When using the graphic bar for rendering a Spectrum bar, you will have to set the range of the graphic bar from 0 to 100 (using the GraphicBarsManager.SetRange method) and, after receiving the SpectrumValueChange event, make a call to the Spectrum.GetTable method in order to obtain the 64 values of the spectrum's table: at this point, depending upon the number of instanced spectrum bars, call the GraphicBarsManager.SetValue method for each of them passing the related value contained inside the spectrum table.

 

Samples of use of the GraphicBarsManagaer object in Visual C++ 6 and Visual Basic 6 can be found inside the following samples installed with the product's setup package:

- Feedbacks

- RecordedSoundEditor

- SimpleMp3Recorder