Documentation/Globals
typedef

ArtPromiseResult

js/foo_uie_jsplitter.js:2880

Properties

NameTypeDescription
image?GdiBitmap

(or D2DBitmap if window.DrawMode == 1). Null on failure

pathstring

path to image file (or track file if image is embedded)

typedef

AudioStreamInfo

js/foo_uie_jsplitter.js:505

Audio-stream descriptor returned by fb.GetAudioStreams.

Properties

NameTypeDescription
indexnumber

Zero-based stream index used by fb.SetAudioStream.

infoFbFileInfo

Full metadata and technical information reported by the input decoder for this stream.

defaultboolean

True when this is the input decoder's default stream.

selectedboolean

True when this is the effective selected stream. A saved user preference takes precedence over the decoder default.

callbackWORKER

BroadcastChannelMessageCallback

js/broadcast_channel.js:1
BroadcastChannelMessageCallback(event)

Callback used by onmessage and onmessageerror.

Parameters

NameTypeDescription
eventMessageEvent

Broadcast message or reconstruction-error event.

Returns

void
functionWORKER

clearInterval

js/foo_uie_jsplitter.js:33
clearInterval(timerID)

Parameters

NameTypeDescription
timerIDnumber
functionWORKER

clearTimeout

js/foo_uie_jsplitter.js:26
clearTimeout(timerID)

Parameters

NameTypeDescription
timerIDnumber
typedefWORKER

D2DStrokeStyleOptions

js/d2d.js:617

Options used by d2d.StrokeStyle.

Properties

NameTypeDescription
startCap = CapStyle.FlatoptionalCapStyle

Cap at the start of an open stroke.

endCap = CapStyle.FlatoptionalCapStyle

Cap at the end of an open stroke.

dashCapoptionalCapStyle

Cap applied to each dash segment. If omitted, JSplitter uses CapStyle.Round for DashStyle.Dot, DashStyle.DashDot and DashStyle.DashDotDot so their zero-length dot segments are visible; other dash styles use CapStyle.Flat. An explicitly supplied dashCap is always used as-is.

lineJoin = LineJoin.MiteroptionalLineJoin

Join used where consecutive line segments meet.

miterLimit = 10optionalnumber

Positive miter limit used by miter-based joins.

dashStyle = DashStyle.SolidoptionalDashStyle

Dash pattern. DashStyle.Custom requires a non-empty dashes array.

dashOffset = 0optionalnumber

Offset into the dash sequence.

dashesoptionalArray<number>

Custom dash lengths expressed as multiples of the stroke width. Supplying this array selects DashStyle.Custom automatically.

typedef

Error

js/foo_uie_jsplitter.js:8065

Standard JavaScript error object thrown by JSplitter API methods. Catch it with a regular JavaScript try...catch statement.

Properties

NameTypeDescription
namestring

Error type name.

messagestring

Human-readable error message.

stackoptionalstring

JavaScript stack trace when available.

typedef

float

js/foo_uie_jsplitter.js:1
functionWORKER

include

js/foo_uie_jsplitter.js:5
include(path, options)

Evaluates JavaScript from a file in the current panel or Worker realm.
Similar to eval(utils.ReadTextFile(path)), but provides more features:
- Has include guards - a file is evaluated only once per realm unless always_evaluate is used.
- Panel-side includes also use compiled-script caching; Worker includes keep their own per-Worker include guard.
- Has better error reporting.

Relative filesystem paths are resolved as described in utils.ReadTextFile. The currently executing script file is tried first when available.
For a file-backed Worker, this makes its own directory the natural root for nested relative include calls.
Configured panel/package script roots are then considered where applicable.
${fb.ComponentPath} is the final fallback.

Parameters

NameTypeDescription
pathstring

Absolute or relative path to JavaScript file.

options = undefinedoptionalobject
options.always_evaluate = falseoptionalboolean

If true, evaluates the script even if it was included before.

Example

Include some JS file
include('samples/complete/properties.js')
typedef

JsMemoryStats

js/foo_uie_jsplitter.js:4667

Return value of window.JsMemoryStats.

Panel scripts run on the main thread and share one SpiderMonkey heap. Per-panel heap usage is therefore not available. Native/external memory is tracked separately for the current panel. Each Worker has its own SpiderMonkey context and is reported separately in JsMemoryStats.Workers.

Related GC settings are under Advanced > JSplitter > Performance: restart is required > GC.

Properties

NameTypeDescription
MainThreadHeapUsagenumber

SpiderMonkey heap usage shared by all JSplitter panel scripts running on the main thread (in bytes). The maximum is configured by Main thread maximum heap size (in MB); see MainThreadHeapLimit. Automatic GC based on heap growth is controlled by Heap growth before GC (in MB).

MainThreadHeapLimitnumber

Maximum SpiderMonkey heap size for main-thread panel scripts (in bytes). External memory does not count toward this limit. This value reflects Main thread maximum heap size (in MB).

WorkerHeapLimitnumber

Maximum SpiderMonkey heap size for each Worker (in bytes). The limit is shared as one setting value by all Workers, but applies independently to each Worker. This value reflects Worker maximum heap size (in MB, per Worker).

CurrentPanelExternalUsagenumber

Tracked native/external memory retained by the current panel (in bytes). This is an accounting estimate, not process working set or physical RAM/VRAM residency. Automatic GC based on external-memory growth is controlled by External memory growth before GC (in MB).

WorkersJsWorkerMemoryStats[]

Memory snapshots for Workers created by the current panel. Worker snapshots are published by each Worker thread without blocking the panel and may lag while a Worker is executing a long-running task.

typedef

JsPackageDirs

js/foo_uie_jsplitter.js:3049

Note: returned directories are not guaranteed to exist.

Properties

NameTypeDescription
Rootstring

Root directory of the package

Assetsstring

Directory inside package folder that contains assets

Scriptsstring

Directory inside package folder that contains scripts

Storagestring

Persistent and unique directory inside foobar2000 profile folder that can be used to store runtime data (e.g. cache)

typedef

JsPackageInfo

js/foo_uie_jsplitter.js:3059

Return value of utils.GetPackageInfo.

Properties

NameTypeDescription
Versionstring

Package version

DirectoriesJsPackageDirs

Package directories

typedef

JsWorkerMemoryStats

js/foo_uie_jsplitter.js:4649

Memory statistics for one Worker created by the current panel.

Related GC settings are under Advanced > JSplitter > Performance: restart is required > GC.

Properties

NameTypeDescription
Namestring

The Worker's immutable constructor name, identical to Worker-global self.name. The value is an empty string if no name was supplied. The same identity is used by unhandled Worker exception diagnostics, where an empty name is displayed as <unnamed>.

HeapUsagenumber

SpiderMonkey heap usage of this Worker (in bytes). The per-Worker heap limit is configured by Worker maximum heap size (in MB, per Worker); see JsMemoryStats.WorkerHeapLimit. Automatic GC based on heap growth is controlled by Heap growth before GC (in MB).

ExternalUsagenumber

Tracked native/external memory retained by this Worker (in bytes). This is an accounting estimate, not process working set or physical RAM/VRAM residency. Automatic GC based on external-memory growth is controlled by External memory growth before GC (in MB).

typedefWORKER

PerformanceEntry

js/performance.js:1

Performance timeline entry created by performance.mark or performance.measure.

Properties

NameTypeDescription
entryTypestring

Entry type. JSplitter currently supports "mark" and "measure".

namestring

User-defined entry name.

startTimenumber

Start timestamp in milliseconds relative to performance.timeOrigin.

durationnumber

Entry duration in milliseconds. Always 0 for marks; for measures it is endTime - startTime and may be negative.

detail*

Optional metadata associated with the entry. Defaults to null.
JSplitter note: unlike the Web User Timing specification, detail is currently retained as the original JavaScript value and is not structured-cloned.

typedefWORKER

PerformanceMarkOptions

js/performance.js:19

Options accepted by performance.mark.

Properties

NameTypeDescription
detail = nulloptional*

Arbitrary metadata associated with the mark.
JSplitter note: the value is not structured-cloned.

startTimeoptionalnumber

Finite non-negative timestamp in milliseconds relative to performance.timeOrigin. Defaults to performance.now.

typedefWORKER

PerformanceMeasureOptions

js/performance.js:31

Options accepted by the standard options form of performance.measure.

Properties

NameTypeDescription
detail = nulloptional*

Arbitrary metadata associated with the measure.
JSplitter note: the value is not structured-cloned.

startoptional(string|number)

Start mark name or finite non-negative timestamp in milliseconds.

durationoptionalnumber

Finite non-negative duration in milliseconds. May be used together with start or end, but not together with both.

endoptional(string|number)

End mark name or finite non-negative timestamp in milliseconds.

callbackWORKER

PerformanceObserverCallback

js/performance.js:92
PerformanceObserverCallback(list, observer)

Callback invoked when observed performance entries are delivered.

Parameters

NameTypeDescription
listPerformanceObserverEntryList

Entries delivered in this callback.

observerPerformanceObserver

Observer receiving the entries.

Returns

void
typedefWORKER

PerformanceObserverOptions

js/performance.js:47

Options accepted by PerformanceObserver.observe.

Properties

NameTypeDescription
entryTypesoptionalArray<string>

Entry types to observe. Unsupported types are ignored. Use either entryTypes or type for an observer, not both.

typeoptionalstring

A single entry type to observe. Unsupported types are ignored. Use either type or entryTypes for an observer, not both.

typedef

ScriptInfo

js/foo_uie_jsplitter.js:4748

Return value of window.ScriptInfo.
PackageId is only present when the panel script is an SMP package.

Path is always present. It contains the full native filesystem path of the panel's main script: the selected file for a File script, the sample file in the component folder for a Sample script, or the actual entry file for a package (main.js for an SMP package). For a script stored in panel memory, it is an empty string. This is a filesystem path, not a file URL. The value always identifies the main script, including when read from an included file or an imported module. Relative filesystem paths used by supported methods are resolved from the calling file as described in utils.ReadTextFile; they do not necessarily use the directory of Path.

Properties

NameTypeDescription
Namestring
Pathstring

Full native filesystem path of the main script, or an empty string for an in-memory script.

Authoroptionalstring
Versionoptionalstring
PackageIdoptionalstring
functionWORKER

setInterval

js/foo_uie_jsplitter.js:40
setInterval(func, delay, ...func_args)

Parameters

NameTypeDescription
funcfunction()
delaynumber
func_args...*

Returns

number
functionWORKER

setTimeout

js/foo_uie_jsplitter.js:50
setTimeout(func, delay, ...func_args)

Parameters

NameTypeDescription
funcfunction()
delaynumber
func_args...*

Returns

number

Example source

typedef

SystemInfo

js/foo_uie_jsplitter.js:2473

System-information snapshot returned by utils.SystemInfo.

Properties

NameTypeDescription
OSstring

Human-readable Windows product name including the edition when available, for example Windows 11 Home or Windows 11 Pro.

Buildnumber

Windows NT build number.

IsOS64Bitboolean

True when the operating system architecture is 64-bit. This describes Windows itself, not the foobar2000 process architecture.

RAMSystemMemoryInfo

Physical-memory and foobar2000 private-working-set information.

VRAMSystemVideoMemoryInfo|null

Dedicated/local video-memory information for the selected graphics adapter, or null when the required video-memory query interface is unavailable.

typedef

SystemMemoryInfo

js/foo_uie_jsplitter.js:2444

Physical-memory information returned in utils.SystemInfo.

Properties

NameTypeDescription
Totalnumber

Total physical memory visible to Windows, in bytes. This can be lower than the installed RAM amount because hardware-reserved memory is not included.

Availablenumber

Physical memory currently available to the system, in bytes. This is Windows' available-memory value and includes reclaimable standby/cache memory; it is more useful for capacity decisions than strictly free pages.

Processnumber

Private working set of the foobar2000 process, in bytes. This corresponds closely to the Memory (active private working set) value shown for foobar2000 in Windows Task Manager.

typedef

SystemVideoMemoryInfo

js/foo_uie_jsplitter.js:2456

Dedicated/local video-memory information returned in utils.SystemInfo.

The selected adapter is the adapter on which the foobar2000 process currently has the highest local video-memory usage. If the process has no local video-memory usage yet, the adapter with the largest dedicated-memory size is selected instead.

Properties

NameTypeDescription
Adapterstring

Display name of the selected graphics adapter.

Totalnumber|null

Dedicated video-memory size of the selected adapter, in bytes. On 32-bit builds JSplitter avoids returning a truncated 32-bit value; if a safe 64-bit total cannot be obtained, this field is null.

ProcessBudgetnumber

Current local video-memory budget assigned to the foobar2000 process by Windows, in bytes. The budget is dynamic and is not a fixed hardware limit.

Processnumber

Current local video-memory usage attributed to the foobar2000 process, in bytes.

unknownWORKERstaticreadonly

unknown@168

js/performance.js:168

Frozen array of entry types supported by PerformanceObserver.
JSplitter currently returns ["mark", "measure"]. Repeated reads return the same frozen array object.

callbackWORKER

WorkerErrorCallback

js/worker.js:1127
WorkerErrorCallback(event)

Callback used for Worker error handlers.

Parameters

NameTypeDescription
eventErrorEvent

Returns

void
callbackWORKER

WorkerMessageCallback

js/worker.js:1118
WorkerMessageCallback(event)

Callback used for Worker message and messageerror handlers.

Parameters

NameTypeDescription
eventMessageEvent

Returns

void
callbackWORKER

WorkerPromiseRejectionCallback

js/worker.js:1136
WorkerPromiseRejectionCallback(event)

Callback used for Worker Promise rejection handlers.

Parameters

NameTypeDescription
eventPromiseRejectionEvent

Returns

void