Title notations to hide info

Don’t really understand the question. There is a “Delay” setting in every single log interface. What’s the difference between a “real” delay and a “send-out” delay?

Not quite. In log-to-a-file there isn’t.

It seems that the metadata to be logged is gathered at the very start of the item, irrespective of any delay set in the configuration. So if logging takes place the script (which changes the title string in this case) is literally the hedgehog because the hare-like logger has done its task already, even if you had set a logging delay before.

I had experienced this very behaviour before in another application where a jukbox is to be emulated: The items (stored in a second playlist) are marked with a code, i. e. D4, to be tracable by the script. Like such they appear in the main playlist, and this is totally intended – the host knows that this is the jukebox title. But on logging this code surely should be removed but that cannot be achieved by the software as yet.

Sorry, you are absolutely right, the delay has only been available for all HTTP-based methods until now, and the evaluation takes place before the delay counter starts.

Anyway, I have just uploaded build 5202 of v7.1 beta, and now the delay setting is available for all methods including files; and evaluation doesn’t take place until the delay has passed, so any last-minute changes done by scripts should now be reflected.

2 Likes

:heart: :heart: :heart: :heart: :heart:              

Sooo @xdjorik, as soon as you’re running v7.1 you may want to use this script here:


// To be used with mAirList v7.1 only!

// Set logging delay greater than 0 seconds

const
  PREFIX = '##hitintro';
  
procedure OnPlayerStateChange(PlaylistIndex: integer; PlayerIndex: integer;
  OldState: TPlayerState; NewState: TPlayerState; Item: IPlaylistItem);
var
  Title: string;
begin
  if NewState = psPlaying then
  begin
    Title := Item.GetTitle;
    if Copy(Title, 1, Length(PREFIX)) = PREFIX then
      Title := Copy(Title, Length(PREFIX) + 2, Length(Title) - Length(PREFIX));
    Item.SetTitle(Title);
  end;
end;


begin
end.

Amazingly simple, Thank you @Torben!

1 Like

Is it possible to specify different (more than one) prefixes?

That would open a lot of benefits for browsing (b/c you can’t see any comment or remix field in the browser).

*vocalstart
*extendedmix
*12inch
*live

Generally, it is. Would have to sort out an elegant way under the constraints given (i. e. Pascal Script).

1 Like

edited version on author’s request, thank you. /mod


The following script skips every character from the beginning of a title string up to (and including) an arbitrary separator string, in this example ## . (Note the blankspace at the end of the separator. Not needed, but recommended.)

Logging can be underdone freely in mAirList, e. g. %b - %a.

Remember to set a delay for logging (and to switch to v7.1).


// To be used from mAirList v7.1 on

// Set logging delay greater than 0:00!

const
  SEPARATOR = '## ';     // <== Define separator string here
  
function Separate(Title: string): string;

begin
  if Pos(SEPARATOR, Title) <> 0 then
    Result := copy(Title, Pos(SEPARATOR, Title) + Length(SEPARATOR), 
      Length(Title) - Length(SEPARATOR))
  else
    Result := Title;
end;

procedure OnPlayerStateChange(PlaylistIndex: integer; PlayerIndex: integer;
  OldState: TPlayerState; NewState: TPlayerState; Item: IPlaylistItem);
begin
  if NewState = psPlaying then
    Item.SetTitle(Separate(Item.GetTitle));
end;


begin
end.

Thank you again, @Torben. The little tweak you made to the code makes custom logging so much easier.

2 Likes

Edit: Skipped a superfluent line in the code. If you downloaded before 22-10-08, 08:20 GMT, please reload.

1 Like