S2L Waveform

   Print  Previous  Next

Functions Provided By S2L Waveform

The following table provides an overview over all functions the effect provides:

Function

Description

void SetDirection(int direction)

Sets the direction for the effect. Valid values for direction are DIR_UP, DIR_DOWN, DIR_LEFT, and DIR_RIGHT.

int GetDirection()

Returns the current direction.

void SetTimeSlot(float value)

Sets the time slot value. Valid values for value range from 0.01 to 9999.

float GetTimeSlot()

Returns the currently set time slot.

void SetChannelView(int view)

Sets the channels that should be displayed by the effect. See below for further details.

int GetChannelView()

Returns the currently set channel to be displayed by the effect. See below for further details.

void SetShiftOutwards(int enable)

Sets the direction to outwards if enable is set to true. Otherwise, it is disabled. See below for further details.

int GetShiftOutwards()

Returns true if "Shift Outwards" is currently enabled, otherwise false. See below for further details.

void SetShiftInwards(int enable)

Sets the direction to inwards if enable is set to true, otherwise it is disabled. See below for further details.

int GetShiftInwards()

Returns true if "Shift Inwards" is currently enabled, otherwise false. See below for further details.

void SetColor(int idx, color c)

Sets the color at the specified index in the Color Ramp. If idx is out of range, nothing happens.

color GetColor(int idx)

Returns the color with the specified index in the Color Ramp. If the index is out of range, black is returned.

int GetColorCount()

Returns the amount of colors currently used by the Color Ramp.

void AddColor(color c, float position, int fade)

Adds another color c to the Color Ramp at the specified position. Valid values for position range from 0.01 to 0.99. If the index is lower or equal to 0, the new color is added to the first position. If index is greater than the current number of colors, the new color is added at the end. Valid values for fade are 1 (On).

void RemoveColor(int index)

Removes the color at the specified index. If the given index is out of range, nothing happens.

int SetColorPosition(int index, float position)

Sets the color of the given index to a new position and returns the new index. Valid values for position range from 0.01 to 0.99. The first and last color are not allowed to be moved!

float GetColorPosition(int index)

Returns the color position of the given index.

void SetUniformDistances()

Sets uniform distances between each color in the Color Ramp.

void InvertColorPositions()

Inverts the positions of the colors in the Color Ramp.

void InvertColors()

Inverts every single color in the Color Ramp.

 

This Effect uses the Color Ramp. Learn more about Using Colors.

 

Selecting The Sound Channels

The waveform effect is able to show the waveform of the two stereo sound channels. It is possible to select the waveform of the left or right channel. In addition, it is possible to show both channels at the same time (stereo). Selecting mono is also an option. The function SetChannelView enables a macro to set these settings. Therefore, the following values may be used as parameters:

Value

Description

CHM_MONO

Selects mono mode.

CHM_STEREO

Selects stereo mode, which displays both channels at the same time.

CHM_LEFT

Selects the left channel.

CHM_RIGHT

Selects the right channel.

 

Shifting The Direction

In addition to the directions DIR_UP, DIR_DOWN, DIR_LEFT, and DIR_RIGHT, the waveform can move inwards or outwards. With the two functions SetShiftOutwards and SetShiftInwards, it is possible to control these directions. They both use true or false as parameters to disable or to enable the according movement.

Example:

SetShiftInwards(true);    //activates inwards movement
SetShiftInwards(false);   //disables inwards movement

 

SetShiftOutwards(true);    //activates outwards movement
SetShiftOutwards(false);   //disables outwards movement