Tilllate scripts
Aus dmd2
Zur Navigation springenZur Suche springenDieses Dokument enthält alle Scripts, die für tilllate.com Nightlife Radio verwendet werden.
Load Content[bearbeiten]
Class-B Content Load[bearbeiten]
What this script does
- Loads B-Class Content Repertoire to 3 CATs every 12 hours
- There are 3 .m3u Repertoire Files for every channel, containing simple Path info:
y:\___genres\__tilllate.com_mixes\200738\6001_Little Louie Vega_TEST_HOUSE_PRIO01_.mp3 y:\___genres\__tilllate.com_mixes\200738\5431_Antoine,Antoine Clamaran_dfdsfdsf_The Process Of Belief.mp3 y:\___genres\__tilllate.com_mixes\200737\5361_Ferry Corsten_Ferry Corsten's Countdown 08_Corstens Countdown 008-SAT-08-.mp3 y:\___genres\__tilllate.com_mixes\200737\5371_Paul van Dyk_New York City_In Between.mp3
- No Loop; starts with ES every 12 hours (at midnight & at noon)
- At Midnight also a Queue.Clear command is performed to let new mixes play fast.
// what this script does
// loads .m3u content as repertoires to the respective categories
// triggered by the ES
// (c) 2007 A. Dal Farra / Digital Media Distribution AG
//define Vars
var ChannelID : String = '11';
//Clear the Category
CAT['Cat_B_Prio_1'].Clear;
//add all files from the carts .m3u to the respective list
CAT['Cat_B_Prio_1'].AddList('Y:\98_various_channels\08_tilllate\repertoire\Class_B\channel'+ChannelID+'-b-1.m3u', ipTop);
//Clear the Category
CAT['Cat_B_Prio_2'].Clear;
//add all files from the carts .m3u to the respective list
CAT['Cat_B_Prio_2'].AddList('Y:\98_various_channels\08_tilllate\repertoire\Class_B\channel'+ChannelID+'-b-2.m3u', ipTop);
//Clear the Category
CAT['Cat_B_Prio_3'].Clear;
//add all files from the carts .m3u to the respective list
CAT['Cat_B_Prio_3'].AddList('Y:\98_various_channels\08_tilllate\repertoire\Class_B\channel'+ChannelID+'-b-3.m3u', ipTop);
Class-A Content Load[bearbeiten]
What this script does
- Loads a TXT-File every 12 hours. This TXT File contains the A-Class Shows that tillate wants to be played at specific times.
- Example of a TXT File:
14:20:00.0|y:\___genres\__tilllate.com_mixes\200738\6111_Above and Beyond_TEST_TRANCE_PRIO02_.mp3 18:11:17.0|y:\___genres\__tilllate.com_mixes\200738\6031_Cut Killer_TEST_URBAN_CLASSA_REGULAR_.mp3
- The scripts splits time and path information and runs a loop thru the list-items.
- No Loop; starts with ES every 12 hours
//what this script does
//loads Class-A Show-Files (.txt), splits the entries and plays at certain time
//written by Alex Dal Farra / September 2007
//(c) Digital Media Distribution AG
//****************************************************************
//setting Vars and Cons
const PlaylistFile = 'Y:\98_various_channels\08_tilllate\repertoire\Class_A\channel1-a.txt';
var List : TStringList;
var T : Integer;
var Play_Time : String;
var Path : String;
Var Stringlength, I, II : Integer;
Var Delimiterposition : Integer;
Pal.LockExecution;
//now we create the List of entries
List := TStringList.Create;
if FileExists(PlaylistFile) then
List.LoadFromFile(PlaylistFile)
else
WriteLn('List does not exist '+PlaylistFile);
//Remove all entries that are extended data or blank lines
T := 0;
while T < List.Count do
begin
if (Trim(List[T])='') or (List[T][1]='#') then
begin
WriteLn('Deleting entry: '+List[T]);
List.Delete(T);
end
else
T := T + 1;
end;
WriteLn('-----------------------------');
//now the loop begins, according to the # of entries in the list
Pal.UnlockExecution;
for T := 0 to List.Count-1 do
begin
//make it run fast - only for testing
//this section cuts the list's entries according to the delimiter character (|).
// Here, timing and path are extracted
Delimiterposition := Pos('|',List[T]); {Find the index of the first match}
Stringlength := Length(List[T]);
I := (Stringlength-(Stringlength - Delimiterposition)-3);
II := (Stringlength-Delimiterposition);
//this is only for debugging purposes and can be uncommented on demand
//WriteLn(Delimiterposition);
//WriteLn(Stringlength);
Play_Time := Copy(List[T],1,(I)); {Copy only certain characters to a string. (Copy 3 characters, starting at position 2) }
Path := Copy(List[T],(Delimiterposition + 1),(II));
//famous last prints
WriteLn(Play_Time);
WriteLn(Path);
//wait for time ...
Pal.WaitForTime(Play_Time);
//.. and play the show!
Queue.AddFile(Path,ipTop);
Cat['ID'].QueueTop(smRandom, NoRules);
ActivePlayer.FadeToNext;
// WriteLn(List[T]);
end;
WriteLn('This file contained '+List.Count +'entries');
List.Free;
Overlays[bearbeiten]
Generic Overlays[bearbeiten]
What this script does
- plays an Overlay from the Standard-Category every [n] minutes
- Loops
// This PAL will check which player is active
// Then put a liner in the aux player1
// Reduce the Volume in the main player - Play the Liner
// Then set the Volume back again
// Modified to detect if Playing Song is Greater than 30 mnutes
PAL.loop := true;
var P1, P2 : TPlayer;
var i : integer;
var Song : TSongInfo;
//Wait here until a track that is over 20 minutes arrives in any deck
//repeat until ActivePlayer.Duration > 1200000;
P1 := ActivePlayer;
// Get what the Volume is set to
i := ActivePlayer.GetVolume;
// Detect the empty player and queue a station ID in it
P2 := Aux1;
IdlePlayer.Volume := i;
if P2 <> nil then
Song := CAT['overlays'].ChooseSong(smRandom,NoRules);
if Song <> nil then
P2.QueueSong(Song);
// Reduce the Active Player by 50%
// Divide by 3 to get 33%, etc.
//ActivePlayer.Volume := i / 2;
P2.play;
//Keep checking until the line is finished
repeat
// writeln(inttostr(p2.status));
until P2.status = psReady;
// Reset Volume Back To Normal
//ActivePlayer.Volume := i;
Song.Free;
PAL.WaitForTime('+00:05:00');
Overlays-Label-Specific[bearbeiten]
What this script does
- plays an Overlay according to the Label
- If Label = Defected, Script tries to pull an ID from the Defected CAT. Plays it on the AUX player as an overlay
- Loops
// Define those VARs
PAL.Loop := True;
var theSong : TSongInfo;
var theString : String;
//Variabeln
var overlaytrigger : String = 'overlay_runs';
const overlaytriggerfile = 'Y:\98_various_channels\08_tilllate\controlfiles\overlaytrigger.txt';
// der Value "live" wird nun in das File geschrieben, damit PAL Scripts keine Jingles und Stundenlogos spielen w�hrend der Live�bertragung
if not StrToFile(overlaytriggerfile,overlaytrigger) then
WriteLn('Unable to save value');
writeLN(overlaytrigger);
theSong := ActivePlayer.GetSongInfo;
// Queue.AddFile(theSong['filename'],ipTop);
//Get the artist's name file and place at top of queue
theString :=(theSong['label']);
WriteLn(theString);
theSong.Free;
// This PAL will check which player is active
// Then put a liner in the aux player1
// Reduce the Volume in the main player - Play the Liner
// Then set the Volume back again
// Modified to detect if Playing Song is Greater than 30 mnutes
var P1, P2 : TPlayer;
var i : integer;
var Song : TSongInfo;
//Wait here until a track that is over 20 minutes arrives in any deck
//repeat until ActivePlayer.Duration > 1200000;
P1 := ActivePlayer;
// Get what the Volume is set to
i := ActivePlayer.GetVolume;
// Detect the empty player and queue a station ID in it
P2 := Aux1;
IdlePlayer.Volume := i;
if P2 <> nil then
Song := CAT[theString].ChooseSong(smRandom,NoRules);
if Song <> nil then
P2.QueueSong(Song);
// Reduce the Active Player by 50%
// Divide by 3 to get 33%, etc.
//ActivePlayer.Volume := i / 2;
P2.play;
//Keep checking until the line is finished
repeat
// writeln(inttostr(p2.status));
until P2.status = psReady;
// Reset Volume Back To Normal
//ActivePlayer.Volume := i;
Song.Free;
// wait 30 sec before possible next overlay can run
PAL.WaitForTime('+00:00:30');
overlaytrigger := 'no_overlay';
if not StrToFile(overlaytriggerfile,overlaytrigger) then
WriteLn('Unable to save value');
writeLN(overlaytrigger);
PAL.WaitForTime('+00:01:20');
Playlist Update[bearbeiten]
TXT Output[bearbeiten]
- with the HTML Output function of SAM, the next 30 (or less) tracks in the queue are written to a simple tab-delimited textfile, containing
* current time-stamp, channel-ID, mixID (ISRC field is used for this), artist, title, time, last-time played * this is what the template HTML file looks like:
<!--QUEUE.SONGTYPE="S,N,P"--> $now$ $station.NAME$ <!--LOOP(queue,30)--> <!--LOOP_ROW-->$queue.ISRC$ $queue.artist$ $queue.title$ $queue.MMSS$ $queue.date_played$<!--LOOP_FOOTER--> <!--LOOP_END-->
Post playlist to Application & Call SOAP[bearbeiten]
What this script does
- loads TXT file (see above) and sends content over a POST command to the Application
const uploadurl = 'Y:\98_various_channels\08_tilllate\playlist_update\post_url.conf';
var URL, URL2 : String;
var ChannelID : String = '1';
var PlaylistID : String = '/mnt/obelix01/08_tillate/playlist_update/queue_channel'+ChannelID+'.txt';
//loop start goes here
PAL.Loop := True;
//Wait for 10 seconds
PAL.WaitForTime('+00:00:03');
if FileExists(uploadurl) then
begin
URL := FileToStr(uploadurl)+PlaylistID;
//this we don't need here
// URL2 := urlencode(URL);
{ Hit the Road Jack! }
WebToFile('Y:\98_various_channels\08_tilllate\controlfiles\plcontrol_channel'+ChannelID+'.txt',URL);
WriteLn(URL);
WriteLn(URL2);
end
else
WriteLn('Data file does not exist.');
URL := 'blank';
PAL.WaitForPlayCount(1);
archive.pal[bearbeiten]
What this script does:
- Waits for Song-change
- Starts Encoders #1 (the 2nd encoder in list).
- Creates a backupfile, 128kbps 44.1 KHz stereo
- Waits 30 minutes 00 seconds
- Waits for Song-change
- Stopps Archiving, stopps Encoder #1
- sends e-mail to tilllate.com@dmd2.net (currently not enabled)
- No Pal.Loop, triggered over the ES every monday morning @ 00:30:00 (12:30:00 AM)
//declare Variables
//declare Variables
var channel, URL, URLpart, URLPartEnc : String;
PAL.WaitForPlayCount(1);
Encoders[1].Start;
PAL.WaitForTime('+00:30:00');
PAL.WaitForPlayCount(1);
Encoders[1].Stop;
FTP Scripts[bearbeiten]
weekly fallback file upload (ScriptFTP)[bearbeiten]
what this script does
- uploads three backup files from fileserver to streaming server
- script runs every monday morning @ 4 AM
#
# Script language reference http://www.ScriptFTP.com/?go=LANGUAGE
# Script Examples http://www.ScriptFTP.com/?go=EXAMPLES
#
# Save it and click Run on the ScriptFTP window.
# Connect to FTP server
host="192.168.0.140"
user="icecast"
password="icecast4backup"
openhost(host, user, password)
# Send all the files and subdirectories in C:\MyDir to the server
PUTFILE("Y:\yy_backupfiles\tilllate\tilllate_channel1_fallback.mp3")
PUTFILE("Y:\yy_backupfiles\tilllate\tilllate_channel11_fallback.mp3")
PUTFILE("Y:\yy_backupfiles\tilllate\tilllate_channel21_fallback.mp3")
# Transfer finished, close the connection
CLOSEHOST