Cad, this is what we have so far;
[code]// AutoFlash - a custom mAirList Notification Script
// Adapted from an original script by Cad Delworth CEng MBCS CITP,
// Clearances Manager, Leith FM, Edinburgh, Scotland
// http://www.leithfm.co.uk
// Each time Automation starts, this script changes the ‘flash on EOF warning’ time
// of Player 1 (single player automation).
// The time is changed to 180 seconds if one Item or fewer* remains in the Playlist;
// otherwise the time is set to zero.
// *NOTE that this script will OCCASIONALLY ‘flash’ the Players when it should not.
// This is because the Playlist count at Player Start includes the PREVIOUS Item.
procedure OnAutomationChange(PlayerControl: IPlayerControl; Item: IPlaylistItem);
var
bSetEofWarning: boolean;
i, iMax: integer;
i64FlashTime: int64;
pbc: IPlaybackControl;
plc: IPlayerControl;
begin
// Change the default (180) in the line below to change the flash time
i64FlashTime := 180 * 10000000;
pbc := CurrentPlaybackControl;
bSetEofWarning := pbc.GetAutomation;
if CurrentPlaylist.GetCount > 2 then
bSetEofWarning := true;
begin
iMax := pbc.GetPlayerCount - 1;
for i := 0 to iMax do
begin
plc := pbc.GetPlayer(i);
if bSetEofWarning = true then
plc.SetEofWarning(i64FlashTime)
else
plc.SetEofWarning(0);
end;
end;
end;
begin
end.[/code]
Almost identical to you code and works the same, note the use of OnAutomationChange and a true statement. However once we go back to automation we need to reset the EOF during Assist to our defaults.
Here is your original script:
[code]// AutoLastItemFlash - a custom mAirList Notification Script for Thornbury FM
// written by Cad Delworth CEng MBCS CITP,
// Clearances Manager, Leith FM, Edinburgh, Scotland
// http://www.leithfm.co.uk
// Each time a Player starts, this script changes the ‘flash on EOF warning’ time
// of all Players in the current Playlist.
// The time is changed to 60 seconds if one Item or fewer* remains in the Playlist;
// otherwise the time is set to zero.
// *NOTE that this script will OCCASIONALLY ‘flash’ the Players when it should not.
// This is because the Playlist count at Player Start includes the PREVIOUS Item.
procedure OnPlayerStart(PlayerControl: IPlayerControl; Item: IPlaylistItem);
var
bSetEofWarning: boolean;
i, iMax: integer;
i64FlashTime: int64;
pbc: IPlaybackControl;
plc: IPlayerControl;
begin
// Change the default (60) in the line below to change the flash time
i64FlashTime := 60 * 10000000;
pbc := CurrentPlaybackControl;
bSetEofWarning := pbc.GetAutomation;
if CurrentPlaylist.GetCount > 2 then
bSetEofWarning := false;
begin
iMax := pbc.GetPlayerCount - 1;
for i := 0 to iMax do
begin
plc := pbc.GetPlayer(i);
if bSetEofWarning = true then
plc.SetEofWarning(i64FlashTime)
else
plc.SetEofWarning(0);
end;
end;
end;
begin
end.[/code]
This is where I am stuck. Any ideas.
Kind regards tony