Hi there,
Its working! the live DJ is added to the Que, and starts playing when the current song is finished.
so far so good. The scripts checks the relay number and if it's active it adds it to the que.
*Situation: We have sam running as AutoDJ, We have 8 DJs, every dj has his own mountpoint.
/me,/you, /etc.
So the first relaynumber is :
- url:port/me #0
- url:port/you #1
- url:port/etc #2
and so on.
Is it possible that the script checks what relay is active in one palscript? (0,1,2,3,4,5,6,7)
I have 8 palscripts running now doing the same thing. and that gives me some hickups.
This is the code im using at the moment.
Code:
// =================================================================================================================================
// - Geef de stream bij 'song info' als type : 'C' ( = Unknown Content) - Add the stream to the tracks and give in the type C
// - Zorg dat de stream die gecheckt moet worden bij "statistic relay" ingevuld staat! het ip nummer en poortnr - make sure that the stream is added in static relay.
// - De nummering van statistic relay begint bij 0 in dit script gaan we er van uit dat de statistic relay als eerste staat. - the static relay counts starts at 0
// - als 2e statistic relay dan moet je in dit script bij "statistic relay nummer" de 0 veranderen in een 1 - So the 2nd relay should be changed into 1 instead of 0
// =================================================================================================================================
pal.Loop:=True;
var I : Integer;
var SongA : TsongInfo;
SongA := Activeplayer.GetSonginfo();
PAL.LockExecution;
I := 6; // relaynumber! (#) 1 is 0 !!!!
begin;
WriteStr('Relay number '); WriteLn(I);
WriteStr('--Active: '); WriteLn(Relays[I].Active);
// WriteStr('--Status: '); WriteLn(Relays[I].Status);
end;
PAL.UnlockExecution;
If Relays[I].Active = False or (SongA['songtype'] = 'C') then
//do nothing
Else
Queue.Clear;
If Relays[I].Active = False or (SongA['songtype'] = 'C') then
//do nothing
Else
Queue.AddUrl('http://addurl:port/mountpoint',ipTop); // IP + poort van stream die gestart moet worden. -the url that needs to be added
PAL.WaitForTime(T['+00:00:05']);
If Relays[I].Active = False or (SongA['songtype'] = 'C') then
//do nothing
Else
PAL.WaitForPlayCount(1); // Stream is in de queue !!! Wacht 1 plaat - stream is added to que, wait 1 song.
If Relays[I].Active = False or (SongA['songtype'] = 'C') then
else
PAL.WaitForPlayCount(1); // Stream is aan het spelen !!! Wacht tot stream stopt ... - stream is playing ! wait till stream stops
SongA.Free;
PAL.WaitForTime(T['XX:XX:30']);
Pal.LockExecution;
I hope there is someone that could help me out with this.
thanks in advance.
Robert