alexrussell: get the newest CVS revision of gen_activewa.dll from the sourceforge page and see if that fixes your problem. I've had no trouble with the ChangedTrack event.
anyone: since i have pretty much no knowledge of scripting and i just scrapped/hacked this together out of a couple other scripts with some minor ingenuity of my own, i was hoping that someone could look at my script and see if everything makes sense. please and thank you in advance to anyone who's willing.
playlist_Party Shuffle (15).vbs:
PHP Code:
' +--------------------------------------------+
' | Party Shuffle 2.0 (15 track version) |
' +--------------------------------------------+
' Automatically enqueues a new random song each time another is played.
' An ActiveWinamp script brought to you by osmosis and neFAST.
' Changes: 1) Can be triggered via the Script menu.
' 2) Start with base # of current items (builds the backlog as it goes, as per iTunes).
' 3) On track change, maintains PL item total if any have been removed, skipped, etc.
' (note: iTunes updated automatically on remove but AW has no support for PL events).
' 4) Randomization now includes all artists.
' 5) Playlist now definitely contains only audio items.
' 6) Dialog on launch to choose whether to clear the playlist.
' 7) Script quits when playback is completely stopped.
' 8) Switched to a Scripting Dictionary for faster querying and randomized loading.
' Todo: 1) Weighted shuffling (in 3.0).
' May 10, 2006
Dim mlq,i,j,Dict1,keys,startup,idxs,pos,pchg
Set Dict1 = CreateObject("Scripting.dictionary")
Dict1.CompareMode = BinaryCompare
' This is the first launch
startup=MsgBox("Start new Party Shuffle playlist?",_
vbYesNoCancel+vbDefaultButton2+vbQuestion,"Winamp Party Shuffle")
if startup=2 then
' abort if requested
quit
end if
' clear PL if desired
if startup=6 then
playlist.clear
end if
' more inclusive.
mlq = MediaLibrary.RunQueryArray("type=0")
i = 0
For each track in mlq
Dict1(track.artist)=Dict1(track.artist) + ":" + CStr(i)
i = i + 1
next
Randomize
itms = Dict1.Items
' fill the PL if needed (up to 10, any others will be added on track change)
Do while (playlist.count<=9)
Rand = Int(Dict1.Count*Rnd+1)
idxs = Split(itms(Rand), ":", -1, 1)
Rand2 = CInt(idxs(Int(ubound(idxs)+1 * Rnd)))
mlq(Rand2).enqueue
Loop
if startup=6 then
' Now let's play
play
end if
Sub Application_ChangedTrack
if playlist.position>6 then
' We delete however many the PL position has changed by
pos=playlist.position-6
pchg=0
Do while (pos>pchg)
playlist.deleteindex(1)
pchg=pchg+1
Loop
end if
if playlist.count<=(playlist.position+8) then
' We add songs until there's a backlog of 5 (startup)
' or until we've reached 15 again
Do while (playlist.count<=(playlist.position+8))
Rand = Int(Dict1.Count*Rnd+1)
idxs = Split(itms(Rand), ":", -1, 1)
Rand2 = CInt(idxs(Int(ubound(idxs)+1 * Rnd)))
mlq(Rand2).enqueue
Loop
end if
End Sub
Sub Application_ChangedStatus
if PlayState=0 then
' exit if state has changed to stopped
quit
end if
End Sub