Copyright © 2001-2018 MultiMedia Soft

MIDI.SoundDurationGet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Obtains the duration of the loaded MIDI stream.

 

This method keeps count of eventual tempo changes so the reported duration may vary depending upon the current tempo. If you should need retrieving the original duration of the loaded song you should use the SoundDurationGet method by setting the bKeepCountOfRateChange parameter to "BOOL_FALSE".

 

For further details about the use of MIDI protocol see the MIDI object section and the How to deal with MIDI protocol tutorial.

 

 

Syntax

 

[Visual Basic]

control.MIDI.SoundDurationGet (

nPlayer as Integer,

fDuration as Double,

nPositionUnit as enumMidiPositionUnits

) as enumErrorCodes


 

[C++]

short control.MIDI.SoundDurationGet (

short nPlayer,

double *fDuration,

short nPositionUnit

);


 

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the involved player

fDuration

Reference that, on return from the method call, will contain the duration of the loaded MIDI stream; its value depends upon the value of the nPositionUnit parameter below.

nPositionUnit

The unit of measure used for the position value stored inside fDuration parameter above.

Supported values are the following:

Mnemonic constant

Value

Meaning

MIDI_POS_UNIT_TICKS

0

The fDuration parameter is expressed in MIDI ticks

MIDI_POS_UNIT_MS

1

The fDuration parameter is expressed in milliseconds.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to get the error code

enumErrorCodes.ERR_NOERROR (0)

The method call was successful