Kategorie: Musik
Ab Engineversion: 4.2 OC
SetPlayList
Beschreibung
Setzt die Liste der Musikstücke, die in zufälliger Reihenfolge abgespielt werden sollen (wenn die Musik aktiviert ist). Zurückgegeben wird die Anzahl der aktivierten Musikstücke (Im Netzwerk wird allerdings immer 0 zurückgegeben).
Syntax
int SetPlayList(any playlist, int at_player, bool force_change, int fadetime_ms, int resume_time_ms);
Parameter
- playlist:
- [opt] If this parameter is a string: 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. The parameter may also be a proplist with any of the following members:
Eigenschaft Typ Bedeutung PlayList string Same as providing the playlist directly as a string. MusicBreakMin int Minimum time of silence between two songs in milliseconds. Defaults to 10000. MusicBreakMax int Maximum time of silence between two songs in milliseconds. Defaults to 10000. A random value between the minimum and maximum is chosen before each new song is selected. MusicBreakChance int Chance in percent that silence is inserted between two songs. Defaults to 50. MusicMaxPositionMemory int Time in seconds that the current position in a piece is remembered and will be used for resume if it becomes available through a call to SetPlayList. Defaults to 420. A value of zero means infinite memory. - 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.
- resume_time_ms:
- [opt] If greater than zero and changing the playlist causes a new piece to be selected immediately, the upcoming piece is resumed from the position where it last stopped playing if at least this amount of time is still left to be played.
Anmerkungen
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.
Durch Aufruf von SetPlayList wird die Musik nicht aktiviert, wenn sie vorher deaktiviert war. Der Aufruf wirkt sich dann erst aus, wenn die Musik wieder aktiviert wird.
Der Aufruf 'SetPlayList("*.*")' ist nicht identisch mit 'SetPlayList()'. Wird 'SetPlayList("*.*")' aufgerufen, so werden wirklich alle Musikstücke aktiviert, auch diejenigen, die mittels eines "@" im Namen von der Standard-PlayList ausgenommen wurden. 'SetPlayList()' aktiviert diese Musikstücke dagegen nicht.
Siehe auch: Music