For instance, in the code below the msgbox echoes the playlist i want to remove the track from and then when i refresh the track is gone from the playlist selected in the main tree rather than the playlist echoed.
Code: Select all
Sub RemoveFromPlaylist(PlaylistID)
Set Playlist = SDB.PlaylistByID(CLng(PlaylistID))
If Playlist Is Nothing Then
MsgBox "Invalid Playlist"
Exit Sub
End If
If DEBUG Then
MsgBox "Removed from Playlist: " & Playlist.Title
End If
Select Case ini.IntValue("PlaylistPanel","TrackMode")
Case SELECTED_TRACK_MODE
If SDB.SelectedSongList.Count = 0 Then
MsgBox "No Songs Selected"
Exit Sub
Else
for i = 0 to SDB.SelectedSongList.Count - 1
Playlist.RemoveTrackNoConfirmation SDB.SelectedSongList.Item(i)
next
End If
Case NP_TRACK_MODE
Playlist.RemoveTrackNoConfirmation SDB.Player.CurrentSong
Case MIXED_MODE
If SDB.Player.IsPaused Or SDB.Player.IsPlaying Then
Playlist.RemoveTrackNoConfirmation SDB.Player.CurrentSong
Else
If SDB.SelectedSongList.Count = 0 Then
Exit Sub
Else
for i = 0 to SDB.SelectedSongList.Count - 1
Playlist.RemoveTrackNoConfirmation SDB.SelectedSongList.Item(i)
next
End If
End If
End Select
Set Playlist = Nothing
End Sub