SetPlayList

Category: Music
Since engine version: 4.2 OC

Description

Sets the play list of pieces of music to be played in random order, if music is activated. The actual number of pieces of music in the playlist is returned, or 0 in network mode.

Syntax

int SetPlayList(string playlist, int at_player, bool force_change, int fadetime_ms);

Parameters

playlist:
[opt] List of pieces of music to be played. The individual file and category names are separated with semicolons (";"). Wildcards are expanded. If the parameter is left out, the standard playlist is restored.
at_player:
[opt] The playlist is changed only on clients where the player with this player number is local. If left out or NO_OWNER, the playlist is changed for all clients. If the player number is invalid, no playlists are changed.
force_change:
[opt] If true and the new playlist does not contain the piece currently playing, a new song is selected and played.
fadetime_ms:
[opt] Fade time to the new piece if force_change is true and the current song is changed in response to this call. Set to zero to change music instantly.

Remarks

Pieces are identified either by matching file name or any matching category. Categories are only available for .ogg files and may be set as a semicolon-delimited list in the comment field. Matching is case-insensitive, but case insensitive matching does not work for extended UTF8 characters.
SetPlayList does not activate music playback when the player has turned the music off. If the player enables music, the new playlist takes effect.
SetPlayList("*.*") is not identical to SetPlayList(). The former activates all music, the latter only those not starting with "@", the standard behavior.
See also: Music
PeterW, 2003-01
Sven2, 2014-08