Aller au contenu

Script PAL pour musique à la demande


loutch

Messages recommandés

slt,

ben voici j'ai trouvé ca sur le net, je pense que ca pourrai t'aider :

PAL for Top10 Most Requested :

PAL.Loop := False;
PAL.WaitForTime(T['11:59:49']); {Wait for Noon}
{================================================= =}
var D : TDataSet;
var C : Integer;
D := Query('SELECT songlist.*, count(*) as cnt '+
'FROM songlist,requestlist '+
'WHERE songlist.ID = requestlist.songID '+
' AND requestlist.code < 700 '+
'GROUP BY songlist.ID '+
'ORDER BY cnt DESC LIMIT 10',[],True);
{Add requests to Queue.
We add to the top of the Queue, effectively reversing the
order of the requests - playing #10 first and #1 last}
C := 0;
D.First;
while not D.EOF do
begin
C := C + 1;
WriteLn('#'+IntToStr(C)+'. '+D['artist']+' - '+D['title']);
Queue.AddFile(D['filename'],ipTop);
D.Next;
end;
{================================================= =}

Pour l'arrêter :

Pal.Loop:=True;
var I : Integer;
for I := 0 to Encoders.Count-1 do
if not Encoders[i].Started then
RequestPolicy.Enabled := False;
for I := 0 to Encoders.Count-1 do
if Encoders[i].Started then
RequestPolicy.Enabled := True;

Bon codage :D

Lien vers le commentaire
Partager sur d’autres sites

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

×
×
  • Créer...