Alle Foren » Creating Skins, Scripts and Modules » Clearing whole PL and the first Song on the PL....

Seite 1 von 1

Nachricht

Clearing whole PL and the first Song on the PL....

Grobekelle am 11. Feb · Antworten

Hi guys,

i tried to clear the whole Playlist with this script...

C:\Programme\Silverjuke\silverjuke.exe --execute="player.removeAll();"


It clears the PL but also the song whos actually playing,
but i want to clear the pl without stoping the song whos playing,
any ideas?

I also want to delete the first song in the playlist, without stopping the song whos playing at the moment, i tried this script....

C:\Programme\Silverjuke\silverjuke.exe --execute="player.removeAtPos(1+1);"


Sometimes it works, but sometimes it just skips the song which is playing. If it works, the song whos cleared is still in the playlist but SJ ignores it and jumps on to the next song. is there a way to refresh the playlist? And whats wrong with my Batch, why does it work sometimes why it sometimes skips the song which is playing?

greetings grobe


Re: Clearing whole PL and the first Song on the PL....

SilverEagle am 11. Feb · Antworten

Hi Grobekelle,

(Sorry, forgot to answer your original question in the other thread...)

> C:\Programme\Silverjuke\silverjuke.exe
> --execute="player.removeAtPos(1+1);"
>
> Sometimes it works, but sometimes it just skips
> the song which is playing. If it works, the song
> whos cleared is still in the playlist but SJ
> ignores it and jumps on to the next song. is
> there a way to refresh the playlist? And whats
> wrong with my Batch, why does it work sometimes
> why it sometimes skips the song which is
> playing?


Say you have a playlist like:
0 song A
1 song B
2 song C
3 song D <-- currently playing
4 song E

Your 1+1=2 (if I remember kindergarten correctly Wink) so your call will always remove song C, whatever you current position in the list. Which means you must always take your current playing position (player.queuePos) into account when making these type of changes.

For the deletion of a single song (at least if I understood you correctly and you want to remove the next upcoming song) you were close:

player.removeAtPos(player.queuePos+1)

To delete the complete playlist except the playing song this would be the code to run:

// remove the first song until the currently playing song is the first song
while (player.queuePos > 0)
{
    player.removeAtPos(0);
}

// remove the second song until there is only one song left
while (player.queueLength > 1)
{
    player.removeAtPos(1);
}

For your commandline purpose you might shorten this to: "while (player.queuePos > 0) player.removeAtPos(0); while (player.queueLength > 1) player.removeAtPos(1);".

I'll leave putting all this into commandline batchfiles to you.

SilverEagle


Re: Clearing whole PL and the first Song on the PL....

Grobekelle am 11. Feb · Antworten

Thanks SilverEagle,

it works, but the song stays in the playlist for so long till the next one beginns playing or another song is added to the playlist. Is there a way to refresh the playlist, after clearing a song? iam using blue touch...

greetings and thanks again....

Grobe


Re: Clearing whole PL and the first Song on the PL....

SilverEagle am 11. Feb · Antworten

Grobekelle wrote:
> it works, but the song stays in the playlist for
> so long till the next one beginns playing or
> another song is added to the playlist. Is there a
> way to refresh the playlist, after clearing a
> song? iam using blue touch...


Ah, I was not expecting you to use my 'special' skin...

You just found an issue with Silverjuke scripting not functioning as specified Sad. I'll report this in a separate thread on the forum but I'll try to create a workaround for you somehow, if I do I'll get back to you.

SilverEagle


Re: Clearing whole PL and the first Song on the PL....

Grobekelle am 11. Feb · Antworten

Thanks, youre my man!


Ihre Antwort:


Login



Sie können sich für die Benutzung unserer Foren kostenlos anmelden: Sie können dann Beiträge unter Ihrem Namen einstellen oder bearbeiten, geschützte Daten einsehen und erhalten Zugriff auf viele weitere Komfortfunktionen. Zur Anmeldung...

Foren durchsuchen

Letzte Beiträge

RSS+Newsletter