scripting
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
scripting [2020/07/10 09:33] – tondose | scripting [2020/07/10 10:23] – tondose | ||
---|---|---|---|
Line 5: | Line 5: | ||
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. | 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 // | + | The code resembles a subset of the // |
**Note:** The full set of functions and procedures is featured only in the latest version of mAirList. Therefore, unaltered scripts originating from well-aged portions of the [[https:// | **Note:** The full set of functions and procedures is featured only in the latest version of mAirList. Therefore, unaltered scripts originating from well-aged portions of the [[https:// | ||
Line 25: | Line 25: | ||
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. | 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. | ||
- | Furthermore, | + | Furthermore, |
An overview of the provided background script procedures is supplied with each version of mAirList within the file '' | An overview of the provided background script procedures is supplied with each version of mAirList within the file '' | ||
Line 33: | Line 33: | ||
===== Creating Code ===== | ===== Creating Code ===== | ||
- | The code can simply be typed into a text editor. Windows-supplied '' | + | The code can simply be typed into a text editor. Windows-supplied '' |
- | The structure of a simple Delphi/Turbopascal | + | The structure of a simple Delphi/TurboPascal |
<code delphi> | <code delphi> | ||
Line 62: | Line 62: | ||
**Note** the different use of semicolon '';'' | **Note** the different use of semicolon '';'' | ||
- | **Comments** may be typed into '' | + | **Comments** may be typed into '' |
- | It is highly recommended to structure the code by indenting the statements with two whitespaces at a time. [[https:// | + | It is highly recommended to structure the code by indenting the statements with two whitespaces at a time. |
+ | [[https:// | ||
+ | |||
+ | ==== Background Scripts ==== | ||
+ | |||
+ | As mAirList is calling // | ||
+ | |||
+ | <code delphi> | ||
+ | begin | ||
+ | end. | ||
+ | </ | ||
+ | |||
+ | ('' | ||
+ | |||
+ | === Parameters === | ||
+ | |||
+ | Certain background script procedures are passing parameters. These can be used as variables within the procedure’s code as such: | ||
+ | |||
+ | <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; | ||
+ | |||
+ | </ | ||
+ | |||
+ | === Registering Background Scripts === | ||
+ | |||
+ | For making the code actually work with mAirList, the file has to be registered in the mAirList Control Panel: | ||
+ | |||
+ | --> SCREENSHOT <-- | ||
+ | |||
+ | While loading, the syntax of the code is checked. In case of errors a message is written into the system log, containig (somewhat obscure) the cause of the error and its location as '' | ||