The way I currenty use it is as an Action in the action menu, I put all the audio into my playlist and click the button for the colour magic to appear!
[code] // Highlight Audio Types - Matt Green
// This simple script will colour specially tagged items automatically.
// All you have to do is add a User Defined Property (Name of ‘Type’, value of your choice) to all the audio you wish to auto-colour.
// You can then edit the script below to set your ‘Type’ values and the colour you wish to change it too. You can also change other features
// of the item by adding item.[SetPropertyValue]; between then BEGIN and END within the IF statements.
// A sample of how to add extra items is added below (remember to uncomment if you are going to use it).
VAR
i: integer;
item: IPlaylistItem;
BEGIN
FOR i := 0 to CurrentPlaylist.GetCount - 1 DO
BEGIN
item := CurrentPlaylist.GetItem(i);
IF item.GetUserData.Values['Type'] = 'Ident' THEN BEGIN
item.SetColored(true);
item.SetColor($9EE0D3);
END ELSE IF item.GetUserData.Values['Type'] = 'Bed' THEN BEGIN
item.SetColored(true);
item.SetColor($EE22AA);
// END ELSE IF item.GetUserData.Values[‘Type’] = ‘Trail’ THEN BEGIN
// item.SetColored(true);
// item.SetColor($EE22AA);
In other words, Ryan, you need to manually (or with a script) set and save a new User Defined Property (UDP) named Type for each audio item.
Actually, thinking about it … it would be possible to avoid using Type altogether if you write two or three scripts which set the colour of all the items in the current Playlist. For example, one script to set the ‘Ident’ colours, one to set the ‘Bed’ colours, etc.
You would then quickly make a Playlist with (again for example) all your Idents in it, then run the ColourIdents script; empty the Playlist and put all your Beds in it, then run the ColourBeds script; and so on.
Definately a good idea instead of going through well over 1000 songs and “type” them all. I would have no clue how to make a script like that in all honesty :-\
Ok, pinching bits of examples posted by Matt and Charlie here is something that should do as asked.
[table][tr][td]// Highlight Audio - Tony Wilding
// This simple script will colour audio files according to you specifications
// Build a playlist of similar audio, i.e. all promos.
// Specify the colour highlight for this type of audio.
// Remember to remove the comment lines.
// Run the script, it worked for me. With a little re-working you should also be able to specify icons.
var
i: integer;
begin
for i := 0 to CurrentPlaylist.GetCount - 1 do
// If EndType is empty, then do it
//if CurrentPlaylist.GetItem(i).GetEndType = ‘’ then
If the playlist is a basic M3U or you’re re-dragging from the Browser - the new settings should remain, especially as you’ve written them to the MMD data file. If you’re re-loading an MLD, MLP or MLT file - then ALL data is stored within those files - regardless of MMD settings.
This is so that you can pre-produce a playlist with new cue points and information.
the mAirListScript.chm file (which is fairly easy to understand if you are a programmer), which eplains the mairlist-specific stuff, and
delphibasics.co.uk, which explains how Delphi works, but you need to know that lots od ‘standard’ Delphi simply don’t exist in mairlist script. This isn’t Torben’s fault nor can he do anything about it. It’s because the guy who wrote the scriptiong component did not include ALL of Delphi.
A lot of intelligent trial and error is needed. You will find that there is no InputBox or equivalent. There is no MsgBox or equivalent; which is why the only way to display any message to the user is with SystemLog. Lots of the time and date functions aren’t there, so you need to be devious if you need to do date/time conversions and arithmetic.