Documentation/Globals
typedef

ArtPromiseResult

jsdoc/utils.js:446

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

AudioChannelInfo

jsdoc/vis.js:1

PCM channel entry contained in AudioFormat.

Properties

NameTypeDescription
Indexnumber

Zero-based position of the channel in interleaved PCM samples. This value can be passed directly to visualization channel properties.

Flagnumber

Speaker-position bit from ChannelConfig. Combining the flags of all channel entries produces the format's channel mask.

NamesArray<string>

Known lower-case names for this speaker position. The first value is the canonical full name; subsequent values are short or familiar aliases. The array is empty for an unknown channel flag.

Canonical nameAliases
front-leftfl, left
front-rightfr, right
front-centerfc, center
low-frequency-effectslfe
back-leftbl, rear-left
back-rightbr, rear-right
front-center-leftfcl
front-center-rightfcr
back-centerbc, rear-center
side-leftsl
side-rightsr
top-centertc
top-front-lefttfl
top-front-centertfc
top-front-righttfr
top-back-lefttbl
top-back-centertbc
top-back-righttbr
typedef

AudioFormat

jsdoc/vis.js:36

Current visualization PCM-format snapshot returned by vis.AudioFormat. It describes the post-processing stream received by visualizations and can therefore differ from the source file's format.

Properties

NameTypeDescription
SampleRatenumber

PCM sample rate in hertz.

ChannelCountnumber

Number of interleaved PCM channels.

ChannelConfignumber

foobar2000 channel-mask value describing the speaker positions in the stream.

ChannelsArray<AudioChannelInfo>

Channel entries ordered by PCM index. The array contains ChannelCount entries.

typedef

AudioStreamInfo

jsdoc/fb.js:1

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

jsdoc/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

jsdoc/globals.js:33
clearInterval(timerID)

Parameters

NameTypeDescription
timerIDnumber
functionWORKER

clearTimeout

jsdoc/globals.js:26
clearTimeout(timerID)

Parameters

NameTypeDescription
timerIDnumber
typedefWORKER

D2DStrokeStyleOptions

jsdoc/objects/d2d.js:615

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

jsdoc/globals.js:63

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

jsdoc/globals.js:1
functionWORKER

include

jsdoc/globals.js:5
include(path, options)

Evaluates JavaScript from a file in the current panel or Worker realm.
Evaluates the text loaded by utils.ReadTextFile and provides additional 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

jsdoc/window.js:160

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 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

jsdoc/utils.js:615

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

jsdoc/utils.js:625

Return value of utils.GetPackageInfo.

Properties

NameTypeDescription
Versionstring

Package version

DirectoriesJsPackageDirs

Package directories

typedef

JsWorkerMemoryStats

jsdoc/window.js:142

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

jsdoc/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

jsdoc/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

jsdoc/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

jsdoc/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

jsdoc/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

jsdoc/window.js:249

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

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

Parameters

NameTypeDescription
funcfunction()
delaynumber
func_args...*

Returns

number
functionWORKER

setTimeout

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

Parameters

NameTypeDescription
funcfunction()
delaynumber
func_args...*

Returns

number

Example source

typedef

ShaderCacheStats

jsdoc/vis.js:51

Snapshot of the process-wide native HLSL-to-DXBC LRU cache returned by vis.ShaderCacheStats. Counts cover automatic HLSL compilation performed by vis.CreateAsync; d2d.Compile, d2d.CompileAsync and supplied DXBC are excluded. Hits, Misses and Evictions accumulate during the process lifetime.

Properties

NameTypeDescription
Entriesnumber

Number of cached compiled HLSL programs.

Bytesnumber

Approximate CPU bytes retained for source/profile strings and DXBC buffers; excludes GPU memory and container overhead.

Hitsnumber

Requests served by a cached HLSL compilation result.

Missesnumber

Cache lookups that did not find the requested HLSL program; concurrent requests can both miss.

Evictionsnumber

Entries removed when limits are exceeded or reduced.

typedef

SystemInfo

jsdoc/utils.js:30

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

jsdoc/utils.js:1

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

jsdoc/utils.js:13

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

jsdoc/performance.js:168

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

typedef

VisualizationImagePass

jsdoc/vis.js:77

Optional object form for a feedback or post image pass. A pass may also be supplied directly as VisualizationShaderCode when no image files are needed. The main shader stage does not use this object form.

Properties

NameTypeDescription
shaderVisualizationShaderCode

Program that processes the preceding RGBA image at t0 with sampler s0.

texturesoptionalArray<string>

One to three non-empty image-file paths, bound in order at t1–t3 with samplers s1–s3. Omit this property, or pass null, when no files are needed; an empty array is not accepted. Paths use the usual script image-path resolution. Files are loaded during asynchronous creation and retained as decoded image data. After a graphics-device reset, GPU textures are recreated from that data; files are not read again. To load changed file contents, create a new visualization. Each pass sees only its own images.

typedef

VisualizationShaderCode

jsdoc/vis.js:67

Shader program accepted by vis.CreateAsync in any renderer stage. A string must contain non-empty HLSL with entry point main. Bytecode must be valid DXBC for ps_4_0, ps_4_1 or ps_5_0, in a non-empty, non-shared buffer that has not been detached. The GPU must support the chosen shader profile. Every program must follow the source or image-pass input layout described in Visualization API.

typedef

VisualizationShaderRenderer

jsdoc/vis.js:90

Renderer configuration for vis.CreateAsync. Source analysis settings belong in the second argument. Shader output uses premultiplied RGBA.

Properties

NameTypeDescription
shaderVisualizationShaderCode

Required program that draws from the selected native audio source.

feedbackoptionalVisualizationShaderCode|VisualizationImagePass

One image pass transforming previous history before the current source is composited over it. Omit or pass null to disable feedback.

postoptionalVisualizationShaderCode|VisualizationImagePass|Array<VisualizationShaderCode|VisualizationImagePass>

One image pass or an array of 1–4 passes, executed in order after the current image is complete. Each reads the preceding image. Omit or pass null to disable post-processing.

feedbackIntervalMs = 0optionalnumber

Feedback-history interval: 0 for every Draw, or a finite number from 1 to 1000 milliseconds. A positive value requires feedback. Change it later through FeedbackIntervalMs. This setting does not create a timer; missed intervals are skipped and post passes still run on each draw.

feedbackTransparent = falseoptionalboolean

Start and composite history over transparent black instead of opaque black, retaining shader alpha. A true value requires feedback.

stopOnPause = falseoptionalboolean

Freeze the last completed image, including post effects, while playback is paused. A frozen image is scaled on resize without reprocessing. When false, shaders continue to run using retained audio data. This setting does not stop native audio analysis or schedule panel repaints.

callbackWORKER

WorkerErrorCallback

jsdoc/worker.js:1124
WorkerErrorCallback(event)

Callback used for Worker error handlers.

Parameters

NameTypeDescription
eventErrorEvent

Returns

void
callbackWORKER

WorkerMessageCallback

jsdoc/worker.js:1115
WorkerMessageCallback(event)

Callback used for Worker message and messageerror handlers.

Parameters

NameTypeDescription
eventMessageEvent

Returns

void
callbackWORKER

WorkerPromiseRejectionCallback

jsdoc/worker.js:1133
WorkerPromiseRejectionCallback(event)

Callback used for Worker Promise rejection handlers.

Parameters

NameTypeDescription
eventPromiseRejectionEvent

Returns

void