config:scripting:overview
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | config:scripting:overview [2020/07/14 08:19] (current) – created tondose | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Scripting ====== | ||
+ | |||
+ | To meet user-specified tasks, mAirList is offering a powerful scripting engine which provides extended control functions. With it, users may write their own programmes and expand mAirList’s functionalities significantly. | ||
+ | |||
+ | The code resembles a subset of the // | ||
+ | |||
+ | **Note:** The full set of mAirList functions and -procedures is featured only in the latest version of mAirList. Therefore, unaltered scripts originating from well-aged portions of the [[https:// | ||
+ | |||
+ | **Note 2:** Currently there is no listing which keywords of the complete // | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== Creating Code ===== | ||
+ | |||
+ | The code can simply be typed into a text editor, Windows-supplied '' | ||
+ | |||
+ | The structure of a simple // | ||
+ | |||
+ | <code delphi> | ||
+ | |||
+ | const | ||
+ | // Constant declarations | ||
+ | |||
+ | var | ||
+ | // Variable declarations | ||
+ | |||
+ | { Subprogramme definitions: | ||
+ | |||
+ | procedure DoSomething; | ||
+ | begin | ||
+ | // Executable statements | ||
+ | end; | ||
+ | |||
+ | (* Main programme: *) | ||
+ | |||
+ | begin | ||
+ | // Executable statements | ||
+ | end. | ||
+ | |||
+ | </ | ||
+ | |||
+ | **Note** the different use of semicolon '';'' | ||
+ | |||
+ | **Comments** may be typed into '' | ||
+ | |||
+ | It is highly recommended to structure the code by indenting the statements with two whitespaces at a time. | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ==== Background Scripts ==== | ||
+ | |||
+ | For particular events within the mAirList programme, i. e. when a player is started or some marker is passed whilst playback, mAirList is calling an associated procedure by default. If no background script is available, no further action is taken. However, if a background script exists, the code therein will be executed on the said event. | ||
+ | |||
+ | An overview of the provided background script procedures is supplied with each version of mAirList within the file '' | ||
+ | |||
+ | |||
+ | As mAirList is calling // | ||
+ | |||
+ | <code delphi> | ||
+ | begin | ||
+ | end. | ||
+ | </ | ||
+ | |||
+ | at the end ('' | ||
+ | |||
+ | === Parameters === | ||
+ | |||
+ | Certain procedures provide parameters related to the regarded event – for instance the '' | ||
+ | |||
+ | <code delphi> | ||
+ | // This code writes the item’s title into the System Log whenever a player is started: | ||
+ | |||
+ | procedure OnPlayerStart(PlaylistIndex: | ||
+ | begin | ||
+ | SystemLog(Item.GetTitle); | ||
+ | end; | ||
+ | |||
+ | begin | ||
+ | end. | ||
+ | |||
+ | </ | ||
+ | |||
+ | **NOTE: It is absolutely essential to adopt the parameters in these '' | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== Running Scripts ===== | ||
+ | |||
+ | **Standalone scripts** are run by external action, such as the menu item | ||
+ | |||
+ | '' | ||
+ | | ||
+ | or the [[reference: | ||
+ | |||
+ | '' | ||
+ | |||
+ | For making **background scripts** actually work with mAirList, the file has to be registered in the mAirList Control Panel: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | While loading, the syntax of the code is checked. In case of errors a message is written into the system log, containing (somewhat obscure) the cause of the error and its location as '' | ||
+ | |||
config/scripting/overview.txt · Last modified: 2020/07/14 08:19 by tondose