Copyright © 2005-2019 MultiMedia Soft

StreamVolumeSlideEx method

Previous pageReturn to chapter overviewNext page

Remarks

 

Starts a volume sliding procedure that brings the current volume to a target volume in a given amount of time. You can know if a volume sliding is already being performed through the StreamVolumeIsSliding method.

 

During the sliding the FadingVolumeChanged event is generated every 15 milliseconds. When the volume sliding reaches the target volume, the VolumeSlideCompleted event is generated.

 

 

Syntax

 

[Visual Basic]

Public Function StreamVolumeSlideEx (

nPlayerIndex as Int16,

nSlideDuration as Int32,

fVolumeTarget as Single,

nScaleType as enumVolumeScales,

nCurveType as enumVolumeCurves,

nLeftX as Int16,

nLeftY as Int16,

nRightX as Int16,

nRightY as Int16

) as enumErrorCodes


 

[C#]

public enumErrorCodes StreamVolumeSlideEx (

Int16 nPlayerIndex,

Int32 nSlideDuration,

float fVolumeTarget,

enumVolumeScales nScaleType,

enumVolumeCurves nCurveType,

Int16 nLeftX,

Int16 nLeftY,

Int16 nRightX,

Int16 nRightY

);


 

[C++]

public: enumErrorCodes StreamVolumeSlideEx (

Int16 nPlayerIndex,

Int32 nSlideDuration,

float fVolumeTarget,

enumVolumeScales nScaleType,

enumVolumeCurves nCurveType,

Int16 nLeftX,

Int16 nLeftY,

Int16 nRightX,

Int16 nRightY

);


 

 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the involved player

nSlideDuration

The time required to perform the volume sliding from the current volume level to the target level set into the fVolumeTarget parameter below.

fVolumeTarget

Target volume reached when the sliding is completed; the meaning of this value depends upon the nScaleType parameter below.

nScaleType

The volume scaling type.

Supported values are the following:

Mnemonic constant

Value

Meaning

SCALE_LINEAR

0

The volume is based upon a linear scale and can be in the range from 0.0 (silence) to 100.0 (max volume)

SCALE_LOG

1

The returned volume, expressed in dB, is based upon a logarithmic scale and can be in the range from -100  (silence) to 0 (max volume)

The actual applied formula for converting a linear volume into a logarithmic volume is the following:

VolumeInDB = 20 * log10 (VolumeLinear/100)

The C syntax for converting a logarithmic volume into a linear volume is the following:

VolumeLinear = 100 * pow (10, VolumeInDB/20);

nCurveType

Type of curve applied to the volume sliding.

Supported values are the following:

Mnemonic constant

Value

Meaning

 

 

 

VOLUME_CURVE_LINEAR

1

Linear curve

adjstudnet_i000086

VOLUME_CURVE_EXPONENTIAL

2

Exponential curve

adjstudnet_i000087

VOLUME_CURVE_COSINE

3

Cosine curve

adjstudnet_i000088

VOLUME_CURVE_SMOOTH

4

Smooth curve

adjstudnet_i000089

VOLUME_CURVE_CUSTOM

5

Custom Bézier curve.

adjstudnet_i00008a

nLeftX

The horizontal position, expressed in percentage of the custom curve designer's area, of the left control point (*). This parameter is ignored if the nScaleType parameter above has been set to a value different from VOLUME_CURVE_CUSTOM.

nLeftY

The vertical position, expressed in percentage of the custom curve designer's area, of the left control point (*). This parameter is ignored if the nScaleType parameter above has been set to a value different from VOLUME_CURVE_CUSTOM.

nRightX

The horizontal position, expressed in percentage of the custom curve designer's area, of the right control point (*). This parameter is ignored if the nScaleType parameter above has been set to a value different from VOLUME_CURVE_CUSTOM.

nRightY

The vertical position, expressed in percentage of the custom curve designer's area, of the right control point (*). This parameter is ignored if the nScaleType parameter above has been set to a value different from VOLUME_CURVE_CUSTOM.

 

(*) The custom curve designer manages a windowed control, whose visual aspect can be defined programmatically, which allows designing volume curves based upon Bézier curves whose shape is defined through the manual positioning of 2 control points (displayed in cyan color on the graphic below). For further information about the use of the embedded CurveDesigner refer to the tutorial How to create custom volume curves.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

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

enumErrorCodes.NOERROR (0)

The method call was successful.