Copyright © 2008-2023 MultiMedia Soft

WaveformAnalyzer.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.

 

When the WaveformAnalyzer.ViewModeSet method has been invoked with the nMode parameter set to WANALYZER_VIEW_MODE_SPECTRAL, wave ranges are not fully displayed because their presence would cause a loss of colors of the spectral view so they will be only rendered on the top and of the bottom of the waveform area as seen on the screenshot below:

 

 

Wave ranges can be moved through code using the WaveformAnalyzer.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 CloseSound method.

 

A wave range can be removed through the WaveformAnalyzer.GraphicItemRemove method and hidden or shown through the WaveformAnalyzer.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.

For details about the use of the Waveform Analyzer refer to the How to use the Waveform Analyzer section.

For further details about methods of the Waveform Analyzer refer to the WaveformAnalyzer class section.

 

 

Syntax

 

[Visual Basic]

Public Function GraphicItemWaveRangeAdd (

strFriendlyName as String,

strDescription as String,

nStartPosInMs as Int32,

nEndPosInMs as Int32,

settings as WANALYZER_WAVE_RANGE

) as Int16


 

[C#]

public Int16 GraphicItemWaveRangeAdd (

string strFriendlyName,

string strDescription,

Int32 nStartPosInMs,

Int32 nEndPosInMs,

WANALYZER_WAVE_RANGE settings

);


 

[C++]

public: Int16 GraphicItemWaveRangeAdd (

string strFriendlyName,

string strDescription,

Int32 nStartPosInMs,

Int32 nEndPosInMs,

WANALYZER_WAVE_RANGE settings

);


 

 

Parameter

Description

 

 

strFriendlyName

Friendly name of the wave range.

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

strDescription

Description of the wave range.

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

nStartPosInMs

Start position expressed in milliseconds.

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

nEndPosInMs

End position expressed in milliseconds.

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

settings

Settings for the new wave range.

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

 

 

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 line.