Property Get PlaylistByID(ID As Long) As ISDBPlaylist
|ID||Long||ID of the playlist to get (use -1 to get root of all playlists)|
Retrieves SDBPlaylist object of the given playlist ID.
Call method with -1 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 ID 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.
Introduced in MediaMonkey 4.0.
Dim Playlist : Set Playlist = SDB.PlaylistByID(-1) ' Playlist represents the root (virtual) playlist Dim List : Set List = Playlist.ChildPlaylists ' List represents a list of all first-level playlists Dim i, itm For i = 0 To List.Count - 1 ' For all (first-level) playlists in List... Set itm = List.Item(i) ' ... print out the number of child playlists and tracks fout.WriteLine itm.Title & " (" & CStr(itm.ChildPlaylists.Count) & "/" & CStr(itm.Tracks.Count) & ")" Next ' in this case, fout represents a TextStream object (not shown here)