@ squishy, I have added the tree menu's, I missed those the first time.
@ nyn, I tried the below but it did not work as expected so I had removed it from the initial release. What happens is that current song is essentially removed from the list and then added back which ends up causing it to play twice.
Code: Select all
If Selected.Count > 0 Then
SDB.Player.PlaylistClear
SDB.Player.PlaylistAddTrack(SDB.Player.CurrentSong)
SDB.Player.PlaylistAddTracks(Selected)
If SDB.Player.isPlaying = False Then SDB.Player.Play
End If
Now I suppose I could loop thru the entire now playing list and remove each track individually instead of using player.playlistclear, but I figured that it would be very in-efficient and slow (especially on large now playing lists) so I didnt bother with it.
Not to mention a bit more complex due to having to account for deleting an unknown number of songs before and after the current track without deleting the current track.
Also, you do know you can right click the player and go to properties to access the track properties that is playing? Perhaps not as easy as using the detail grids, but...
I don't think I will make it part of the script, but if you really wanted to loop thru, I would guess it could work something like the below pseudocode (untested of course)
x=0
do while playlistcount > 1
if x <> currentsongindex then playlistdelete(x)
x=x+1
loop
or something along those lines.
if someone wants to figure it out, test it and post it, others could use it if they desire.
edit: actually I don't think the above will work, because x would be increasing but the index# and count would be changing as songs were removed.
edit2: perhaps something like this instead
do while playlistcount > 1
if currentsongindex <> 0 then
playlistdelete(0)
else
playlistdelete(1)
end if
loop
that might work
@ squishy, I have added the tree menu's, I missed those the first time.
@ nyn, I tried the below but it did not work as expected so I had removed it from the initial release. What happens is that current song is essentially removed from the list and then added back which ends up causing it to play twice.
[code] If Selected.Count > 0 Then
SDB.Player.PlaylistClear
SDB.Player.PlaylistAddTrack(SDB.Player.CurrentSong)
SDB.Player.PlaylistAddTracks(Selected)
If SDB.Player.isPlaying = False Then SDB.Player.Play
End If
[/code]
Now I suppose I could loop thru the entire now playing list and remove each track individually instead of using player.playlistclear, but I figured that it would be very in-efficient and slow (especially on large now playing lists) so I didnt bother with it.
Not to mention a bit more complex due to having to account for deleting an unknown number of songs before and after the current track without deleting the current track.
Also, you do know you can right click the player and go to properties to access the track properties that is playing? Perhaps not as easy as using the detail grids, but...
I don't think I will make it part of the script, but if you really wanted to loop thru, I would guess it could work something like the below pseudocode (untested of course)
x=0
do while playlistcount > 1
if x <> currentsongindex then playlistdelete(x)
x=x+1
loop
or something along those lines.
if someone wants to figure it out, test it and post it, others could use it if they desire.
edit: actually I don't think the above will work, because x would be increasing but the index# and count would be changing as songs were removed.
edit2: perhaps something like this instead
do while playlistcount > 1
if currentsongindex <> 0 then
playlistdelete(0)
else
playlistdelete(1)
end if
loop
that might work