var items = plman.GetPlaylistItems(plman.ActivePlaylist);
plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, items.count - 1);
Great, thanks, man, playback works!
And the other part of my question concerning removing tracks from the playlist... here's what I did:
if(DJButton.Down()){
var pl_dj;
for (var i = 0; i < plman.PlaylistCount; i++) {
if (plman.GetPlaylistName(i) == "Auto DJ") {
pl_dj = i;
break;
}
}
plman.ActivePlaylist = pl_dj;
var items = plman.GetPlaylistItems(plman.ActivePlaylist);
plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, items.count - 1);
//var itc = fb.PlaylistItemCount(plman.ActivePlaylist)
for (var i = 0; i < items.count; i++) {
if (i < (items.count - 10)) {
plman.SetPlaylistSelectionSingle(plman.ActivePlaylist, i, 1);
plman.RemovePlaylistSelection(plman.ActivePlaylist);
}
}
}
}
aaand it somewhat works, but the playback doesn't _always_ start, when i have some items selected from this playlist it removes more than it's required and doesn't start the playback.
There must be a better and more efficient way of doing this, that's what I tried:
var pl_dj;
for (var i = 0; i < plman.PlaylistCount; i++) {
if (plman.GetPlaylistName(i) == "Auto DJ") {
pl_dj = i;
break;
}
}
plman.ActivePlaylist = pl_dj;
var items = plman.GetPlaylistItems(plman.ActivePlaylist);
plman.ExecutePlaylistDefaultAction(plman.ActivePlaylist, items.count - 1);
var tracks = new Array()
for (var i = 0; i < items.count; i++) {
tracks.push(items.item(i));
}
for (var i = 0; i < (tracks.length - 10); i++) {
plman.SetPlaylistSelection(plman.PlaylingPlaylist, tracks[i], 1)
plman.RemovePlaylistSelection(plman.PlaylingPlaylist);
}
tracks.length = 0;
}
}
aaaand it didn't work :/ (Invalid procedure call or argument Ln: 83, Col: 13 [plman.SetPlaylistSelection(plman.PlaylingPlaylist, tracks, 1) <-- this line] )
So what's the proper way of doing this ?
Once again, sorry for my lack of JS knowledge, it's been quite a while since I've done any coding, not to mention I've never touched JS...