Contents

Parameters

Name of the playlist to get (use empty string to get root of all playlists)

Property description

Retrieves SDBPlaylist object of the given playlist name. If multiple playlists with the same name exist, PlaylistByTitle returns the first one it finds in the database.

Call method with empty string as the argument to get the (virtual) root playlist node. Then you can use its ChildPlaylists property to get all the first-level playlists.

WARNING: Also if no playlist with the specified Title exists, the (virtual) root playlist will be returned. Be aware of this fact, especially if you are planning to remove a playlist. Making an error could remove the root, and so all playlists.

Example code

' Safe PlaylistByTitle wrapper - returns Nothing when playlist with given Title is not foundSubSafePlaylistByTitle(Title)DimRootList:SetRootList=SDB.PlaylistByTitle("")' Get root nodeSafePlaylistByTitle=SDB.PlaylistByTitle(Title)' Get playlist by TitleIfSafePlaylistByTitleIsRootListThenSafePlaylistByTitle=Nothing' Do not return playlist when nothing was foundEndIfEndSub

Example for playlist nodes iteration:

DimPlaylist:SetPlaylist=SDB.PlaylistByTitle("")' Playlist represents the root (virtual) playlistDimList:SetList=Playlist.ChildPlaylists' List represents a list of all first-level playlistsDimi,itmFori=0ToList.Count-1' For all (first-level) playlists in List...Setitm=List.Item(i)' ... print out the number of child playlists and tracksfout.WriteLineitm.Title&" ("&CStr(itm.ChildPlaylists.Count)&"/"&CStr(itm.Tracks.Count)&")"Next' in this case, fout represents a TextStream object (not shown here)