Copyright © 2013-2017 MultiMedia Soft

GraphicItemWaveRangeAdd method

Previous pageReturn to chapter overviewNext page

Remarks

 

Adds a new wave range that will be displayed over the waveform's graphics.

 

Inside the screenshot below you can see 2 examples of wave ranges, each with its own set of colors. Please note that "wave ranges" are a different concept respect to "waveform selection": you can only have one single "waveform selection", whose positioning can be managed through code or through mouse movement, but you can have multiple "wave ranges" managed through code without any mouse management for changing the positioning.

 

 

This wave range can be manually moved on the screen through code using the GraphicItemHorzPositionSet method.

 

During playback of the loaded sound, the WaveAnalyzerWaveRangeReached event is generated when playback position reaches the start position of the wave range and the WaveAnalyzerWaveRangeLeaved event is generated when playback position leaves the end position of the wave range.

 

This method fails if no sound is currently loaded into the editor

The wave range is automatically destroyed, as all of the other existing graphic items, when the loaded sound is discarded from memory through the FreeMemory method.

 

A wave range can be removed through the GraphicItemRemove method and hidden or shown through the GraphicItemShow method.

 

For details about graphic items management on the waveform analyzer refer to the How to add graphic items to the Waveform analyzer section.

 

 

Syntax

 

[Visual Basic]

control.GraphicItemWaveRangeAdd (

strFriendlyName as String,

strDescription as String,

nStartPosInMs as Long,

nEndPosInMs as Long,

settings as Long

) as Integer


 

[C++]

short control.GraphicItemWaveRangeAdd (

LPCTSTR strFriendlyName,

LPCTSTR strDescription,

long nStartPosInMs,

long nEndPosInMs,

void *settings

);


 

 

Parameter

Description

 

 

strFriendlyName

Friendly name of the wave range.

This friendly name can be modified or retrieved at a later time through the GraphicItemNameGet and GraphicItemNameSet methods.

strDescription

Description of the wave range.

This description can be modified or retrieved at a later time through the GraphicItemDescriptionGet and GraphicItemDescriptionSet methods.

nStartPosInMs

Start position expressed in milliseconds.

This position can be modified or retrieved at a later time through the GraphicItemHorzPositionGet and GraphicItemHorzPositionSet methods.

nEndPosInMs

End position expressed in milliseconds

This position can be modified or retrieved at a later time through the GraphicItemHorzPositionGet and GraphicItemHorzPositionSet methods.

settings

Address of a structure of type WANALYZER_WAVE_RANGE that contains the settings for the new wave range.

These settings can be modified or retrieved at a later time through the GraphicItemWaveRangeParamsSet and GraphicItemWaveRangeParamsGet methods.

By setting this value to 0 the graphic item will be rendered with default setting.

 

 

Return value

 

Value

Meaning

 

 

0

An error occurred (see the LastError property for further error details)

Value > 0

Unique identification number assigned to this new wave range.