Dit is het script:
Code: Selecteer alles
{*******************************************************************************
PAL script for putting Music 1 SE hourly playlists into the queue at 3 minutes before the hour
based on the naming scheme of Music 1 for hourly playlists
yymmdd.hh.m3u
You will need to change the constants to meet your needs.
The load time can be changed as well as clearing que or waiting for 1 song play clear queue and add.
This is a basic script . A starting Place
******************************************************************}
PAL.Loop := True;
const PlaylistPath = 'F:\Playlisten\'; // location your Music 1 playlists are saved
const Fileextension = '.m3u' ; // the playlist extension
var Present: DateTime;
var Year, Month, Day, Hour, Min, Sec, MSec,DayLength,MonthLength, HourLength : Integer;
var HoldYear,TheYear,TheMonth, TheDay, TheHour, Playlist :String;
var LessThan : Boolean;
//Present:= Now + 1; // since we are loading a few minutes before the next day we want the next days list
Present:= Now;
DecodeTime(Present, Hour, Min, Sec, MSec);
writeln ( IntToStr(Hour));
Hour := Hour + 1;
If (Hour = 24) then
Hour := 0; // set it to mid night
writeln ('Hour to get ' + IntToStr(Hour));
if (Hour = 0) Then
Present:= Now + 1;
DecodeDate(Present, Year, Month, Day);
HoldYear := IntToStr(Year);
TheYear := Copy(HoldYear,3,2); // copy the last 2 digits of the year 2007 would copy the 07
TheMonth := IntToStr(Month);
TheDay := IntToStr(Day);
TheHour := IntToStr(Hour);
MonthLength := length(TheMonth) ;
DayLength := length(TheDay);
HourLength := length(TheHour);
LessThan := MonthLength < 2;
If (LessThan) Then
TheMonth := '0'+ TheMonth; // if a single digit add 0 to front
LessThan := DayLength < 2;
If (LessThan) Then
TheDay := '0'+ TheDay; // if a single digit add 0 to front
LessThan := HourLength < 2;
If (LessThan) Then
TheHour := '0'+ TheHour; // if a single digit add 0 to front
Playlist := PlayListPath + TheYear+TheMonth+TheDay+ '.' + TheHour + Fileextension;
writeln (TheYear);
writeln (TheMonth);
writeln (TheDay);
writeln (Playlist);
PAL.WaitforTime(T['xx:55:00']); // wait for 5 minutes befor the hour
if(FileExists(Playlist))then
begin
Queue.Clear;
Queue.AddList(Playlist,ipBottom); // add playlist to bottom of the queue
ActivePlayer.FadeToNext;
WriteLn('Loaded: '+Playlist);
end
else
begin
WriteLn('PLAYLIST NOT VALID!');
WriteLn(Playlist);
end;
PAL.WaitforTime(T['xx:59:59']);
Is er een conflict tussen de twee scripts? of is er ergens anders een fout. Ik moet playlisten per uur maken omdat ik ook nog opgenomen programma's heb die ik afspeel of heeft iemand een andere oplossing?PAL.Loop:=True;
PAL.LockExecution;
// 01 uur `s nachts
while (Now >= T['00:00:01']) and (Now <= T['00:59:59']) do
begin
PAL.WaitForTime(T['01:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\13uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 02 uur `s nachts
while (Now >= T['01:00:01']) and (Now <= T['01:59:59']) do
begin
PAL.WaitForTime(T['02:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\14uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 03 uur `s nachts
while (Now >= T['02:00:01']) and (Now <= T['02:59:59']) do
begin
PAL.WaitForTime(T['03:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\15uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 04 uur `s nachts
while (Now >= T['03:00:01']) and (Now <= T['03:59:59']) do
begin
PAL.WaitForTime(T['04:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\16uur',ipTop);
ActivePlayer.FadeToNext;
end;
// 05 uur `s nachts
while (Now >= T['04:00:01']) and (Now <= T['04:59:59']) do
begin
PAL.WaitForTime(T['05:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\5uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 06 uur ochtend
while (Now >= T['05:00:01']) and (Now <= T['05:59:59']) do
begin
PAL.WaitForTime(T['06:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\6uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 07 uur `s nachts
while (Now >= T['06:00:01']) and (Now <= T['06:59:59']) do
begin
PAL.WaitForTime(T['07:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\7uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 08 uur `s nachts
while (Now >= T['07:00:01']) and (Now <= T['07:59:59']) do
begin
PAL.WaitForTime(T['08:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\8uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 09 uur `s nachts
while (Now >= T['08:00:01']) and (Now <= T['08:59:59']) do
begin
PAL.WaitForTime(T['09:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\9uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 10 uur `s nachts
while (Now >= T['09:00:01']) and (Now <= T['09:59:59']) do
begin
PAL.WaitForTime(T['10:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\10uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 11 uur `s nachts
while (Now >= T['10:00:01']) and (Now <= T['10:59:59']) do
begin
PAL.WaitForTime(T['11:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\11uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 12 uur `s nachts
while (Now >= T['11:00:01']) and (Now <= T['11:59:59']) do
begin
PAL.WaitForTime(T['12:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\12uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 13 uur `s nachts
while (Now >= T['12:00:01']) and (Now <= T['12:59:59']) do
begin
PAL.WaitForTime(T['13:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\13uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 14 uur `s nachts
while (Now >= T['13:00:01']) and (Now <= T['13:59:59']) do
begin
PAL.WaitForTime(T['14:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\14uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 15 uur `s nachts
while (Now >= T['14:00:01']) and (Now <= T['14:59:59']) do
begin
PAL.WaitForTime(T['15:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\15uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 16 uur `s nachts
while (Now >= T['15:00:01']) and (Now <= T['15:59:59']) do
begin
PAL.WaitForTime(T['16:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\16uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 17 uur `s nachts
while (Now >= T['16:00:01']) and (Now <= T['16:59:59']) do
begin
PAL.WaitForTime(T['17:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\5uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 18 uur `s nachts
while (Now >= T['17:00:01']) and (Now <= T['17:59:59']) do
begin
PAL.WaitForTime(T['18:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\6uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 19 uur `s nachts
while (Now >= T['18:00:01']) and (Now <= T['18:59:59']) do
begin
PAL.WaitForTime(T['19:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\7uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 20 uur `s nachts
while (Now >= T['19:00:01']) and (Now <= T['19:59:59']) do
begin
PAL.WaitForTime(T['20:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\8uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 21 uur `s nachts
while (Now >= T['20:00:01']) and (Now <= T['20:59:59']) do
begin
PAL.WaitForTime(T['21:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\9uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 22 uur `s nachts
while (Now >= T['21:00:01']) and (Now <= T['21:59:59']) do
begin
PAL.WaitForTime(T['22:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\10uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 23 uur `s nachts
while (Now >= T['22:00:01']) and (Now <= T['22:59:59']) do
begin
PAL.WaitForTime(T['23:00:00']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\11uur.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
// 24 uur `s nachts
while (Now >= T['23:00:01']) and (Now <= T['23:59:58']) do
begin
PAL.WaitForTime(T['23:59:59']);
Queue.AddFile('C:\Program Files (x86)\SpacialAudio\SAMBC\VoiceTracks\24u.mp3',ipTop);
ActivePlayer.FadeToNext;
end;
Ik heb de opgenomen programma's ook geprobeerd met de event schudeler te starten maar dan starten die op uren die ik niet heb opgegeven en dat is ook niet de bedoeling.
Ik gebreuk de laatste SAM versie 4.6
Alvast bedankt,
Eric