Shedule hook container

Hello,
Is it possible to schedule a container with hooks? I use the built-in scheduler from mAirlist.

Thanks,
Joris

A feature found in other playout software through the use of macros.

So I guess a container could contain 2 scripts.

Script 1 placed before any audio and executing when reached. If possible turning the hook function on inside mAirList.

Script 2 placed after all the audio or other elements and you guessed turning the hook function off when executed.

Obviously the hooks set in the relevant audio.

Not sure if this possible but another tool to be used during periods of automation rather than depending on someone to remix montages, sweepers etc.

Over to Torben firstly to confirm if hooks can be turned on in this manner and then someone to write the scripts. Cad possible :wink:

No scripts necessary to do that. :wink:

Create a Container and add two COMMAND items to it.

In the first Command item, the Command should be:
PLAYER 1-1 OPTION HookMode ON;PLAYER 1-2 OPTION HookMode ON
… and of course if you have three players, you add a third PLAYER/OPTION Command to the list.

In the second Command item, the Command should be:
PLAYER 1-1 OPTION HookMode OFF;PLAYER 1-2 OPTION HookMode OFF
… again amending this to the number of Players you have.

Now SAVE this Container (as a ‘template’ or model).

You can now load this Container and add tracks in between the two Command items, remembering to SAVE the Container (or the Playlist) each time.

Job done. That is all.

BFN
Cad

Or use this script: https://www.mairlist.com/forum/index.php/topic,3427.msg23108.html#msg23108 8)

@Cad, thanks. Thats a good solution :slight_smile:

@Wiele, I’ve already looked at that script but that works not in Mairlist 4… I tried to adjust it but i still get some errors… Can you help me please in this topic?

Thanks!

I modified the script to work with 4.x :slight_smile: Didn’t test it through so maybe there are still some bugs. If you find one, let me know!

Just modify:

sOpener := 'D:\opener.mp3'; sMiddle := 'd:\middle.mp3'; sCloser := 'd:\closer.mp3';

And schedule the script to run at the end of the hour :slight_smile: And make sure you are using a marker at the begin of the hour that’s saying “Top of the hour”. It’s an option when appending the playlist. The script wil use that marker to start searching for hooks.

[code]var
i, iItemCount, iMax, iVol, iToth: integer;
i64Duration: TTimeValue;
sArtist : string;
sMessage, sPlaylist, sTitle : string;
currentItem, ItemHook, ItemHook2: IPlaylistItem;
ads: IContainerPlaylistItem;
adsPlaylist, newPlaylist: IPlaylist;
adsContainerAsPlaylistItem, piNews: IPlaylistItem;
sFileName, sOpener, sMiddle, sCloser: string;
i64HookIn, i64HookFade, i64HookOut: TTimeValue;

const SONG_MIN_LENGTH = 900000000;

procedure startMarkup;
begin

for i := 0 to CurrentPlaylist.GetCount -1 do
begin

if CurrentPlaylist.GetItem(i).GetTitle = ‘Top of the hour’ then begin
iToth := i;
SystemLog(CurrentPlaylist.GetItem(i).GetTitle);
break;
end;
end;

end;

procedure MarkupCurrentPlaylist;
begin

// Set values
sOpener := ‘D:\opener.mp3’;
sMiddle := ‘d:\middle.mp3’;
sCloser := ‘d:\closer.mp3’;

// Reset counters etc.
iMax := iItemCount - 1;
iVol := 0;

// Display our start up message
SystemLog('Hook: ’
+ ‘Checking the playlist, looking for songs with Hooks.’);

ads.GetPlaylist.InsertFile(0, sOpener, [fitMMD, fitTags, fitNativeTags, fitDuration, fitTilde, fitAutoCue, fitDatabaseLookup]);

// Step through each item in the current (selected) Playlist
for i := iToth + 2 to CurrentPlaylist.GetCount -1 do
begin

// Create a local reference to the current item
// This makes all subsequent code easier to read and slightly faster to process
currentItem := CurrentPlaylist.GetItem(i);

// Store the current item’s Artist, Title, and Effective Duration
sArtist := currentItem.GetArtistsString;
sTitle := currentItem.GetTitle;
i64Duration := currentItem.GetDuration;

// Is this a song?
if 0 >= 0 then
begin

// Add the song to the container and set it to a hook.

ItemHook := iPlaylistItem(currentItem.Clone);

i64HookIn := ItemHook.GetCuePosition(ptHookIn);
i64HookFade := ItemHook.GetCuePosition(ptHookFade);
i64HookOut := ItemHook.GetCuePosition(ptHookOut);

if (i64HookIn > 0) then
begin
// SystemLog(‘Added’);
ads.GetPlaylist.Add(ItemHook);
if (iVol < 2) then
begin
ads.GetPlaylist.InsertFile(ads.GetPlaylist.GetCount, sMiddle, [fitMMD, fitTags, fitNativeTags, fitDuration, fitTilde, fitAutoCue, fitDatabaseLookup]);
end;
ItemHook.SetCuePosition(ptCueIn, i64HookIn);
ItemHook.SetCuePosition(ptFadeOut, i64HookFade);
ItemHook.SetCuePosition(ptCueOut, i64HookOut);
ItemHook.GetArtists.Clear;
ItemHook.GetArtists.Add('Coming up: '+ currentItem.GetArtistsString);
iVol := iVol + 1
end;

if (iVol = 3) then
begin
break;
end;

SystemLog('Hook: ’ + ‘Item ’
+ IntToStr(i + 1)
+ ’ (’
+ Trim(currentItem.GetTitle)
+ ’ / ’
+ Trim(currentItem.GetArtistsString)
+ ') ’
+ ‘.’);

end

end; // of for… loop

// All Playlist items processed, inform user

 if (ivol < 3) then
 begin
 end;
 ads.GetPlaylist.InsertFile(ads.GetPlaylist.GetCount, sCloser, [fitMMD, fitTags, fitNativeTags, fitDuration, fitTilde, fitAutoCue, fitDatabaseLookup]);

SystemLog('Hook: ’ + ‘Checking done.’);

end;

begin

// Create a new Container Item
ads := Factory.CreateContainerPlaylistItem;

// create a copy of the reference as an IPlaylistItem interface

adsContainerAsPlaylistItem := IPlaylistItem(ads);
startMarkup;
MarkupCurrentPlaylist;

adsContainerAsPlaylistItem.SetTitle(‘Coming Up Next’);

CurrentPlaylist.Insert(iToth + 1, adsContainerAsPlaylistItem);

end.[/code]

@Wiele, Wow! Thanks :slight_smile:

But unfortunately still an error… I get a “Unknown identifier sClose’” error.

Joris

I changed the code above! :slight_smile: So try it again. 8)

It works! Thanxs :slight_smile:

Both solutions have merit.

The first from Cad would mean several containers being used at random and by inserting the containers at random would be ideal.

The second from Wiele being only useable at the top of an hour which will pick hooks at random.

Good pointers both.