judas wrote:Hey...i checked out the clear now playing script in your page, its a great idea...one small suggestion to add to the next version: why not leave say 10 (or five) files? that way you wouldn't start with an empty now playing...or i dont know if it can be done, but is there a way to know what was the last song in now playing that was played? this way you could remove all songs before that one and you get to keep the ones you didnt get to hear.
- Code: Select all
'
' MediaMonkey Script
'
' NAME: ClearNowPlaying 2.0
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 22/11/2005
'
' FIXES: Added user definable parameters
'
' INSTALL: Copy to Scripts\Auto directory
'
limit = 100 'maximum number of songs to leave in now playing
clearall = 0 'set to 1 if you wish to clear all files
clearplayed = 1 'set to 1 if you wish to clear just those before the current
clearextra = 0 'set to 1 if you wish to clear all but the first (limit) songs
'NB. Only one of these options can be set to 1, the rest must be 0
sub OnStartup
If SDB.Player.PlaylistCount > limit Then
If clearall = 1 Then
SDB.Player.PlaylistClear
ElseIf clearplayed = 1 Then
If not fPlayed() Then fExtra()
ElseIf clearextra = 1 Then
fExtra()
End If
End If
End Sub
Function fPlayed ()
cur = CInt(SDB.IniFile.StringValue("Player","NowPlayingPosition"))
For i = 0 To cur-1
SDB.Player.PlaylistDelete(0)
Next
If ( SDB.Player.PlaylistCount > limit ) Then
fPlayed = false
Else
fPlayed = true
End If
End Function
Function fExtra ()
For i = limit To SDB.Player.PlaylistCount
SDB.Player.PlaylistDelete(limit)
Next
fExtra = true
End Function


