activePlayer := -1;
for i := 0 to CurrentPlaylist.GetPlayerCount - 1 do
if CurrentPlaylist.GetPlayer(i).GetState = psPlaying then begin
activePlayer := i;
if activePlayer = -1 then begin
SystemLog('No player is active!');
// no need to call AutomationNext here
// Index of item that is currently playing
activeItem := CurrentPlaylist.GetPlayer(activePlayer).GetItem;
// Insert new item below
CurrentPlaylist.Insert(CurrentPlaylist.IndexOf(activeItem) + 1, newItem);
Can you please enter the serial number of your mAirList license into your forum profile? Thank you.
I’m currently evaluating the 30min demo version of the personal edition, so I do not have a license file yet. I’m trying to find out if I manage to understand the scripting enough before buying.
I’ll get one as soon as I figure out how to place sound files I just generated with an external tool into a running playlist to play as the next object after a fixed soft time. As a former Turbo Pascal programmer I should be able to do this, but so far I’ve not managed to find enough working code examples to modify a running playlist.
As soon as I buy a licence I’ll update the info in the profile.
The GetNextIndex method returns the index of the item that is to be played next. If you insert the new item at exactly that position, it will be played next. The method didn’t exist in earlier versions of mAirList, this is why the original author of the script used a different way to determine the insert index.
Thanks for the quick reply. I just ordered a licence a few minutes ago.
Is there any reference to what I can do with scripts regarding the current playlist? I didn’t find anything in the manual and the wiki, so my only source for info was google-searching this forum which turns up a lot of outdated scripts that don’t work…
You don’t say whether you’re using mAirList V4 or V3.1: which is it?
If it’s V3.1, you’ll find that scripts such as IVP and YearJingleAdder (in the Scripts forum) can be downloaded and run as-is. I haven’t personally tried V4 yet: when I have the time to do that, I’ll write ‘V4’ versions of those scripts and post them in the Forum.
st : string;
t1 : TDateTime;
// Generate a DateTime so use for a playlist item later
// Example 2011.10.02 at 16:15
t1 := now;
t1 := EncodeDate(2011, 10,2) + EncodeTime(16,15,0,0);
st := FormatDateTime('c', t1) ;
SystemLog('My time '+st);