Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Expansions

File: Rhapsodist/Core/Includes/Expansions.js · Namespace: Expansions

Overview

Expansions wraps Engine.createExpansionHandler(). Other Core includes and ConfigurationHandler use it rather than calling the expansion handler directly.

It also wires up the shell’s expansion-unload button (btnRhapsody), which prompts for confirmation and calls ExpansionHandler.setCurrentExpansion(""). The unloading function is used only in Rhapsody and not from within HISE.

Usage

Expansions wires itself up once Core.js is included. Call its getters from other scripts to query expansion state.

Example

How Presets locates the external automation file:

const automationDataFile = Expansions.getAppDataFolder().getChildFile("automation.xml");

Public API

FunctionDescriptionReturns
getCurrentExpansionName()The loaded expansion’s Name, or the project’s own name if none is loaded.string
getCurrentExpansionVersion()The loaded expansion’s Version, or the project’s own version if none is loaded.string
getCurrentExpansion()Gets the currently loaded expansion, within Rhapsody.Expansion object or Undefined
getAppDataFolder()The expansion’s root folder if one is loaded, otherwise the app’s data folder.ScriptObject
getAllExpansionIcons()[name, iconPath] pairs for every loaded expansion.Array
getNumberOfExpansions()The number of loaded expansions.number
getCurrentUserPresetsFolder()The correct user presets folder for the current context (HISE IDE, plugin with no expansion loaded, or expansion loaded).File Object or Undefined