Skip to main content

HostUtils

After including resource://{main}/sdk/hostutils.js, the HostUtils global provides accessor methods for host-managed service surfaces.

include_file("resource://{main}/sdk/hostutils.js");

Methods

MethodReturnsParametersDescription
HostUtils.getPackageManager()objectnoneGet the package manager surface
HostUtils.getPresetManager()objectnoneGet the preset manager surface
HostUtils.getDemosFileHandler()objectnoneGet the demos file handler surface
HostUtils.getDocumentManager()objectnoneGet the document manager surface
HostUtils.getMixerConsole()objectnoneGet the mixer console surface
HostUtils.getAudioDeviceName()stringnoneGet the current audio device name
HostUtils.showPatternAutomationLane(show)show1 to show, 0 to hideShow or hide the pattern automation lane
HostUtils.showSpatialAudioRenderer(show)show1 to show, 0 to hideShow or hide the spatial audio renderer
HostUtils.showPluginDetails(show)show1 to show, 0 to hideShow or hide plugin details

Return Object Surfaces

The following objects are returned by HostUtils accessor methods.

PackageManager

Returned by HostUtils.getPackageManager().

MethodReturnsParametersDescription
finishStartup()noneFinish package startup
findPackage(id)objectid — package identifierFind a package by ID
canInstall(id)numberid — package identifierCheck whether a package can be installed
isInstalled(id)numberid — package identifierCheck whether a package is installed

PresetManager

Returned by HostUtils.getPresetManager().

MethodReturnsParametersDescription
presetExists(name)numbername — preset nameCheck whether a preset exists
find(name)objectname — preset nameFind a preset by name

DemosFileHandler

Returned by HostUtils.getDemosFileHandler().

MethodReturnsParametersDescription
extractSong()noneExtract a demo song

DocumentManager

Returned by HostUtils.getDocumentManager().

MethodReturnsParametersDescription
newDocumentClassIterator()objectnoneCreate a document-class iterator
find(name)objectname — document nameFind a document object by name

DocumentClassIterator

Returned by DocumentManager.newDocumentClassIterator().

MethodReturnsParametersDescription
done()numbernoneCheck whether iteration is complete
first()noneMove to the first item
last()noneMove to the last item
next()objectnoneMove to the next item
previous()objectnoneMove to the previous item

MixerConsole

Returned by HostUtils.getMixerConsole().

| Method | Returns | Parameters | Description | |---|---|---|---|---| | audioMixer.getMasterSpeakerType() | number | none | Master speaker format identifier. |