MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / PlaylistClear

Method PlaylistClear

src/music_gui.cpp:398–406  ·  view source on GitHub ↗

* Remove all songs from the current custom playlist. * Effectively stops playback too. */

Source from the content-addressed store, hash-verified

396 * Effectively stops playback too.
397 */
398void MusicSystem::PlaylistClear()
399{
400 if (!this->IsCustomPlaylist()) return;
401
402 this->standard_playlists[this->selected_playlist].clear();
403 this->ChangePlaylist(this->selected_playlist);
404
405 this->SaveCustomPlaylist(this->selected_playlist);
406}
407
408/**
409 * Change playlist position pointer by the given offset, making sure to keep it within valid range.

Callers 1

OnClickMethod · 0.80

Calls 4

IsCustomPlaylistMethod · 0.95
ChangePlaylistMethod · 0.95
SaveCustomPlaylistMethod · 0.95
clearMethod · 0.45

Tested by

no test coverage detected