// PAL Script to automatically start playing a track // and start the encoders when SAM Broadcaster is started // When the software is started // This script starts all encoders // and then cues and plays the first track // This script contains minimal error checking and // is designed to be run once when SAM Broadcaster starts // Variables var I : Integer; // Counter used to start encoders var TrkCat : String; // Declare a variable to hold the track category var Player1 : TPlayer; // Declare an instance of TPlayer for the Active Player var Song : TSongInfo; // Declare an instance of TSongInfo for the queued track TrkCat := 'Music (All)'; // Change this if you wish to select a track from a different category // ********** Pause for 10 Seconds ********** PAL.WaitForTime('+00:00:10'); // ********** Start Encoders ********** for I := 0 to Encoders.Count-1 do if not Encoders[I].Started then begin Encoders[I].Start; WriteLn('Started Encoder: '+InttoStr(I)); end; // ********** Select and Cue a Track from a Designated Category ********** Player1 := IdlePlayer; Song := Cat[TrkCat].ChooseSong(smRandom,NoRules); //select the category here Player1.QueueSong(Song); Player1.Play; WriteLn(''); WriteLn('Track: '+Song['title']); WriteLn('Artist: '+Song['artist']); // ********** Housekeeping ********** Player1.Free; Song.Free;