X-Now-Playing with AMIP

From 40tude Dialog Wiki

With this little script done by Ray you are able to place the X-Now-Playing-Header to your articles. You will find AMIP here. There are tons of other Winamp-Plugins doing the same (write the actual played song & artist to a file). Take a look at winamp.com to find other plugins.

program OnBeforeSendingMessage;
uses Textfile;
const path='c:\programme\winamp5\plugins\np\winamp_sig.txt' //should reflect your configuration

function OnBeforeSendingMessage(var Message    : TStringlist; 
                                    Servername : string;
                                    IsEmail    : boolean
):boolean;

var
  fi: Textfile;
  st: string;
  i    : integer;
  XNP  : boolean;

begin
   result := true;
   i := 0;
   XNP := false;
   while message[i] <> '' do begin
      if copy (message[i], 1, 15) = 'X-Now-Playing: ' then
         XNP := true;
      i := i + 1;   
   end;    // while  
   If not XNP then begin       
      if FileExists(path) then begin
         AssignFile (fi,path);
         Reset(fi);
         TextReadln (fi,st);
         CloseFile (fi);
         message.insert (1, 'X-Now-Playing: ' + st);
      end; //if   
   end; // if
end;

begin
end.