Copyright © 2005-2019 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 "false".

 

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

 

 

Syntax

 

[Visual Basic]

Public Function SoundDurationGet (

nPlayerIndex as Int16,

ByRef fDuration as Double,

nPositionUnit as enumMidiPositionUnits

) as enumErrorCodes


 

[C#]

public enumErrorCodes SoundDurationGet (

Int16 nPlayerIndex,

ref double fDuration,

enumMidiPositionUnits nPositionUnit

);


 

[C++]

public: enumErrorCodes SoundDurationGet (

Int16 nPlayerIndex,

double __gc *fDuration,

enumMidiPositionUnits nPositionUnit

);


 

 

 

Parameter

Description

 

 

nPlayerIndex

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 (see the LastError property for further error details)

enumErrorCodes.NOERROR (0)

The method call was successful.