Copyright © 2001-2019 MultiMedia Soft

PlayListAddItemEx method

Previous pageReturn to chapter overviewNext page

Remarks

 

Adds a song or another playlist or the full content of a directory to the loaded playlist.

 

For further details about playlists management see the How to create and manage a playlist tutorial.

For details about using Volume Automation refer to the How to manage Volume Automation tutorial.

 

Syntax

 

[Visual Basic]

control.PlayListAddItemEx (

nPlayer as Integer,

strPathname as String,

nIndex as Integer,

nItemType as enumPlayListItemType

) as enumErrorCodes


 

[C++]

short control.PlayListAddItemEx (

short nPlayer,

LPCTSTR strPathname,

short nIndex,

short nItemType

);


 

 

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the player that owns the playlist

strPathname

String containing the absolute pathname of the element to add.

 

If the playlist has been loaded or created with volume automation enabled, you can add a new item containing all the needed mixing positions, volume automation points and cue points in one single shot by passing a well formatted XML string to this parameter; an example of well formatted string is the following:

 

 <Item pathname="C:\sounds\drumtrik01_120bpm.wav" DurationSec="16.00" StartPosSec="2.0" MixPosSec="12.0" EndPosSec="16.0" >

   <VolumePoints>

     <VolumePoint name="start fade-in" VolumeLevelLinear="0.0" PosSec="2.0" CurveType="5"

                LeftX="11" LeftY="3" RightX="93" RightY="43" />

     <VolumePoint name="end fade-in" VolumeLevelLinear="100.0" PosSec="5.5" CurveType="0" />

     <VolumePoint name="start fade-out" VolumeLevelLinear="100.0" PosSec="11.9" CurveType="5"

                LeftX="83" LeftY="13" RightX="32" RightY="41" />

     <VolumePoint name="end fade-out" VolumeLevelLinear="0.0" PosSec="15.9" CurveType="0" />

   </VolumePoints>

   <CuePoints>

     <CuePoint name="Silence end" PosMs="1000" />

     <CuePoint name="Fading point" PosMs="12000" />

     <CuePoint name="Silence start" PosMs="15900" />

   </CuePoints>

 </Item>

 

For details about XML syntax of the string above refer to the How to manage Volume Automation tutorial.

 

If the playlist has been loaded or created without volume automation enabled, you can add a new encrypted item by passing a well formatted XML string to this parameter; an example of well formatted string is the following:

 

 <Item pathname="C:\sounds\drumtrik01_120bpm.wav" DecryptKey="JHDG78TR45JHGaf654MAAKHNF235TY" />

 

nIndex

Number representing the zero-based insertion position: if the nIndex parameter value exceed the playlist length, the song will be placed at the bottom of the playlist

nItemType

Type of item to add

Supported values are the following:

Mnemonic constant

Value

Meaning

PLAYLIST_ITEM_SOUND_FILE

0

Adds a single sound file whose pathname is found inside the strPathname parameter

PLAYLIST_ITEM_PLAYLIST_FILE

1

Adds full contents of an existing playlist file whose pathname is specified inside the strPathname parameter.

This operation is performed inside a secondary thread so, when the method returns, the list of items could be still not completed. In this case the container application is informed about the loading advancement through the PlayListLoadStart, PlayListLoadPerc and PlayListLoadDone events.

PLAYLIST_ITEM_DIRECTORY

2

Adds sound related contents of an existing directory whose path is specified inside the strPathname parameter.

This operation is performed inside a secondary thread so, when the method returns, the list of items could be still not completed. In this case the container application is informed about the loading advancement through the PlayListLoadStart, PlayListLoadPerc and PlayListLoadDone events.

 

 

Return value

 

Value

Meaning

 

 

Negative value

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

enumErrorCodes.NOERROR (0)

The call was successful.