ArtPromiseResult
Properties
| Name | Type | Description |
|---|---|---|
image | ?GdiBitmap | (or D2DBitmap if window.DrawMode == 1). Null on failure |
path | string | path to image file (or track file if image is embedded) |
Global functions, callbacks, types and values that are not members of a class, namespace or module.
| Name | Type | Description |
|---|---|---|
image | ?GdiBitmap | (or D2DBitmap if window.DrawMode == 1). Null on failure |
path | string | path to image file (or track file if image is embedded) |
clearInterval(timerID)
| Name | Type | Description |
|---|---|---|
timerID | number |
clearTimeout(timerID)
| Name | Type | Description |
|---|---|---|
timerID | number |
include(path, options)
Evaluates the script in file.
Similar to eval(utils.ReadTextFile(path)), but provides more features:
- Has include guards - script won't be evaluated a second time if it was evaluated before in the same panel.
- Has script caching - script file will be read only once from filesystem (even if it is included from different panels).
- Has better error reporting.
Note: when the relative path is used it will be searched in the following paths:
- ${current_package_path}/scripts/${path}, if the panel uses a package script.
- ${current_script_path}/${path}, if the script is not a top-level in-memory script.
- ${fb.ComponentPath}/${path}, otherwise.
| Name | Type | Description |
|---|---|---|
path | string | Absolute or relative path to JavaScript file. |
options = undefinedoptional | object | |
options.always_evaluate = falseoptional | boolean | If true, evaluates the script even if it was included before. |
<caption>Include some JS file</caption>
include('samples/complete/properties.js')
Return value of window.JsMemoryStats.
| Name | Type | Description |
|---|---|---|
MemoryUsage | number | Memory usage of the current panel (in bytes) |
TotalMemoryUsage | number | Total memory usage of all panels (in bytes) |
TotalMemoryLimit | number | Maximum allowed memory usage for the component (in bytes). |
Note: returned directories are not guaranteed to exist.
| Name | Type | Description |
|---|---|---|
Root | string | Root directory of the package |
Assets | string | Directory inside package folder that contains assets |
Scripts | string | Directory inside package folder that contains scripts |
Storage | string | Persistent and unique directory inside foobar2000 profile folder that can be used to store runtime data (e.g. cache) |
Return value of utils.GetPackageInfo.
| Name | Type | Description |
|---|---|---|
Version | string | Package version |
Directories | JsPackageDirs | Package directories |
on_run_cmd_async_done(task_id, success, exit_code, stdout, stderr)
Called when a process started by utils.RunCmdAsync finishes, fails to start, or times out.
| Name | Type | Description |
|---|---|---|
task_id | number | Task id returned by utils.RunCmdAsync. |
success | boolean | true only when the process was started, finished before timeout, and exited with code 0. |
exit_code | number | Process exit code. |
stdout | string | Captured standard output. |
stderr | string | Captured standard error and internal error messages. |
Object representing a timestamp marker or measurement entry in the player's performance timeline
| Name | Type | Description |
|---|---|---|
entryType | string | A string representing the type of performance metric. Can be either "mark" or "measure". |
name | string | A string representing the name for a performance entry. |
startTime | number | Timestamp representing the starting time for the performance metric. |
duration | number | Value representing the duration of the performance entry (0.0 for "mark") |
detail | Object | Arbitrary metadata to include in the mark. Defaults to null. Can be an object of any type. |
Return value of window.ScriptInfo.
Note: package_id is only present when the panel script is a package.
| Name | Type | Description |
|---|---|---|
Name | string | |
Authoroptional | string | |
Versionoptional | string | |
PackageIdoptional | string |
setInterval(func, delay, ...func_args)
| Name | Type | Description |
|---|---|---|
func | function() | |
delay | number | |
func_args | ...* |
numbersetTimeout(func, delay, ...func_args)
| Name | Type | Description |
|---|---|---|
func | function() | |
delay | number | |
func_args | ...* |
number