Public Member Functions | List of all members
ScriptingApi::Engine Class Reference

All scripting methods related to the main engine can be accessed here. More...

Inheritance diagram for ScriptingApi::Engine:
ScriptingObject ApiClass

Public Member Functions

void allNotesOff ()
 Sends an allNotesOff message at the next buffer. More...
 
ScriptingObjects::ScriptingMessageHolder * createMessageHolder ()
 Creates a storage object for Message events. More...
 
ScriptingObjects::MidiList * createMidiList ()
 Creates a MIDI List object. More...
 
ScriptingObjects::ScriptSliderPackData * createSliderPackData ()
 Creates a SliderPack Data object. More...
 
ScriptingObjects::TimerObject * createTimerObject ()
 Creates a new timer object. More...
 
String doubleToString (double value, int digits)
 Returns a string of the value with the supplied number of digits. More...
 
void dumpAsJSON (var object, String fileName)
 Exports an object as JSON. More...
 
void extendTimeOut (int additionalMilliseconds)
 Extends the compilation timeout. More...
 
double getCpuUsage () const
 Returns the current CPU usage in percent (0 ... More...
 
String getCurrentUserPresetName ()
 Returns the currently loaded user preset (without extension). More...
 
double getDecibelsForGainFactor (double gainFactor) const
 Converts gain factor (0.0 . More...
 
var getDeviceResolution ()
 Returns the full screen resolution for the current device. More...
 
String getDeviceType ()
 Returns the mobile device that this software is running on. More...
 
var getExpansionHandler ()
 Creates a reference to the expansion handler. More...
 
var getFilterModeList () const
 Returns an object that contains all filter modes. More...
 
double getFrequencyForMidiNoteNumber (int midiNumber) const
 Converts midi note number 0 ... More...
 
double getGainFactorForDecibels (double decibels) const
 Converts decibel (-100.0 ... More...
 
double getHostBpm () const
 Returns the Bpm of the host. More...
 
String getMacroName (int index)
 Returns the name for the given macro index. More...
 
double getMasterPeakLevel (int channel)
 Returns the current peak volume (0...1) for the given channel. More...
 
double getMemoryUsage () const
 Returns the current memory usage in MB. More...
 
int getMidiNoteFromName (String midiNoteName) const
 Converts MIDI note name to MIDI number ("C3" for middle C). More...
 
String getMidiNoteName (int midiNumber) const
 Converts MIDI note number to Midi note name ("C3" for middle C). More...
 
double getMilliSecondsForSamples (double samples) const
 Converts samples to milli seconds. More...
 
double getMilliSecondsForTempo (int tempoIndex) const
 Returns the millisecond value for the supplied tempo (HINT: Use "TempoSync" mode from Slider!)
 
int getNumVoices () const
 Returns the amount of currently active voices. More...
 
String getOS ()
 Returns the current operating system ("OSX" or ("WIN"). More...
 
double getPitchRatioFromSemitones (double semiTones) const
 Converts a semitone value to a pitch ratio (-12 ... More...
 
DynamicObject * getPlayHead ()
 Allows access to the data of the host (playing status, timeline, etc...). More...
 
double getPreloadProgress ()
 Returns the preload progress from 0.0 to 1.0. More...
 
var getRegexMatches (String stringToMatch, String regex)
 Returns an array with all matches. More...
 
double getSampleRate () const
 Returns the current sample rate. More...
 
double getSamplesForMilliSeconds (double milliSeconds) const
 Converts milli seconds to samples.
 
double getSemitonesFromPitchRatio (double pitchRatio) const
 Converts a pitch ratio to semitones (0.5 ... More...
 
var getSettingsWindowObject ()
 Returns a object that contains the properties for the settings dialog. More...
 
double getUptime () const
 Returns the uptime of the engine in seconds. More...
 
var getUserPresetList () const
 Returns a list of all available user presets as relative path. More...
 
String getVersion ()
 Returns the product version (not the HISE version!). More...
 
var getZoomLevel () const
 Returns the current Zoom Level. More...
 
int isControllerUsedByAutomation (int controllerNumber)
 Checks if the given CC number is used for parameter automation and returns the index of the control. More...
 
bool isMpeEnabled () const
 Checks if the global MPE mode is enabled. More...
 
bool isPlugin () const
 Returns true if running as VST / AU / AAX plugin. More...
 
void loadAudioFilesIntoPool ()
 Calling this makes sure that all audio files are loaded into the pool and will be available in the compiled plugin. More...
 
void loadFont (const String &fileName)
 Loads a font file. More...
 
void loadFontAs (String fileName, String fontId)
 Loads the font from the given file in the image folder and registers it under the fontId. More...
 
var loadFromJSON (String fileName)
 Imports a JSON file as object. More...
 
void loadImageIntoPool (const String &id)
 Loads an image into the pool. More...
 
void loadNextUserPreset (bool stayInDirectory)
 Loads the next user preset. More...
 
void loadPreviousUserPreset (bool stayInDirectory)
 Loads the previous user preset. More...
 
void loadUserPreset (const String &relativePathWithoutFileEnding)
 Loads a user preset with the given relative path (use / for directory separation). More...
 
bool matchesRegex (String stringToMatch, String regex)
 Matches the string against the regex token. More...
 
void openWebsite (String url)
 launches the given URL in the system's web browser. More...
 
void redo ()
 Redo the last controller change. More...
 
void saveUserPreset (String presetName)
 Asks for a preset name (if presetName is empty) and saves the current user preset. More...
 
void setAllowDuplicateSamples (bool shouldAllow)
 Sets whether the samples are allowed to be duplicated. More...
 
void setCompileProgress (var progress)
 Displays the progress (0.0 to 1.0) in the progress bar of the editor. More...
 
void setGlobalFont (String fontName)
 Sets the font that will be used as default font for various things. More...
 
void setHostBpm (double newTempo)
 Overwrites the host BPM. More...
 
void setKeyColour (int keyNumber, int colourAsHex)
 Sets a key of the global keyboard to the specified colour (using the form 0x00FF00 for eg. More...
 
void setLowestKeyToDisplay (int keyNumber)
 Changes the lowest visible key on the on screen keyboard. More...
 
void setUserPresetTagList (var listOfTags)
 Sets the tags that appear in the user preset browser. More...
 
void showErrorMessage (String message, bool isCritical)
 Shows a error message on the compiled plugin (or prints it on the console). More...
 
void showMessage (String message)
 Shows a message with an overlay on the compiled plugin with an "OK" button in order to notify the user about important events. More...
 
void undo ()
 Reverts the last controller change. More...
 
- Public Member Functions inherited from ApiClass
void addConstant (String constantName, var value)
 Adds a constant. More...
 
void addFunction (const Identifier &id, call0 newFunction)
 Adds a function with no parameters. More...
 
void addFunction1 (const Identifier &id, call1 newFunction)
 Adds a function with one parameter. More...
 
void addFunction2 (const Identifier &id, call2 newFunction)
 Adds a function with two parameters. More...
 
void addFunction3 (const Identifier &id, call3 newFunction)
 Adds a function with three parameters. More...
 
void addFunction4 (const Identifier &id, call4 newFunction)
 Adds a function with four parameters. More...
 
void addFunction5 (const Identifier &id, call5 newFunction)
 Adds a function with five parameters. More...
 
virtual bool allowIllegalCallsOnAudioThread (int) const
 You can overwrite this method and return true if you want to allow illegal calls that would otherwise fire a warning. More...
 
 ApiClass (int numConstants_)
 Creates a Api class with the given amount of constants. More...
 
var callFunction (int index, var *args, int numArgs)
 Calls the function with the index and the argument data. More...
 
void getAllConstants (Array< Identifier > &ids) const
 Returns all constant names as alphabetically sorted array. More...
 
void getAllFunctionNames (Array< Identifier > &ids) const
 This returns all function names alphabetically sorted. More...
 
int getConstantIndex (const Identifier &id) const
 Return the index for the given name. More...
 
Identifier getConstantName (int index) const
 Returns the name for the constant as it is used in the scripting context. More...
 
const var getConstantValue (int index) const
 Returns the constant at the given index. More...
 
void getIndexAndNumArgsForFunction (const Identifier &id, int &index, int &numArgs) const
 This will fill in the information for the given function. More...
 

Detailed Description

All scripting methods related to the main engine can be accessed here.

Member Function Documentation

void allNotesOff ( )

Sends an allNotesOff message at the next buffer.

ScriptingObjects::ScriptingMessageHolder * createMessageHolder ( )

Creates a storage object for Message events.

ScriptingObjects::MidiList * createMidiList ( )

Creates a MIDI List object.

ScriptingObjects::ScriptSliderPackData * createSliderPackData ( )

Creates a SliderPack Data object.

ScriptingObjects::TimerObject * createTimerObject ( )

Creates a new timer object.

String doubleToString ( double  value,
int  digits 
)

Returns a string of the value with the supplied number of digits.

void dumpAsJSON ( var  object,
String  fileName 
)

Exports an object as JSON.

void extendTimeOut ( int  additionalMilliseconds)

Extends the compilation timeout.

Use this if you have a long task that would get cancelled otherwise. This is doing nothing in compiled plugins.

double getCpuUsage ( ) const

Returns the current CPU usage in percent (0 ...

100)

String getCurrentUserPresetName ( )

Returns the currently loaded user preset (without extension).

double getDecibelsForGainFactor ( double  gainFactor) const
inline

Converts gain factor (0.0 .

. 1.0) to decibel (-100.0 ... 0).

var getDeviceResolution ( )

Returns the full screen resolution for the current device.

String getDeviceType ( )

Returns the mobile device that this software is running on.

var getExpansionHandler ( )

Creates a reference to the expansion handler.

var getFilterModeList ( ) const

Returns an object that contains all filter modes.

double getFrequencyForMidiNoteNumber ( int  midiNumber) const
inline

Converts midi note number 0 ...

127 to Frequency 20 ... 20.000.

double getGainFactorForDecibels ( double  decibels) const
inline

Converts decibel (-100.0 ...

0.0) to gain factor (0.0 ... 1.0).

double getHostBpm ( ) const

Returns the Bpm of the host.

String getMacroName ( int  index)

Returns the name for the given macro index.

double getMasterPeakLevel ( int  channel)

Returns the current peak volume (0...1) for the given channel.

double getMemoryUsage ( ) const

Returns the current memory usage in MB.

int getMidiNoteFromName ( String  midiNoteName) const

Converts MIDI note name to MIDI number ("C3" for middle C).

String getMidiNoteName ( int  midiNumber) const
inline

Converts MIDI note number to Midi note name ("C3" for middle C).

double getMilliSecondsForSamples ( double  samples) const
inline

Converts samples to milli seconds.

int getNumVoices ( ) const

Returns the amount of currently active voices.

String getOS ( )

Returns the current operating system ("OSX" or ("WIN").

double getPitchRatioFromSemitones ( double  semiTones) const
inline

Converts a semitone value to a pitch ratio (-12 ...

12) -> (0.5 ... 2.0)

DynamicObject * getPlayHead ( )

Allows access to the data of the host (playing status, timeline, etc...).

double getPreloadProgress ( )

Returns the preload progress from 0.0 to 1.0.

Use this to display some kind of loading icon.

var getRegexMatches ( String  stringToMatch,
String  regex 
)

Returns an array with all matches.

double getSampleRate ( void  ) const

Returns the current sample rate.

double getSemitonesFromPitchRatio ( double  pitchRatio) const
inline

Converts a pitch ratio to semitones (0.5 ...

2.0) -> (-12 ... 12)

var getSettingsWindowObject ( )

Returns a object that contains the properties for the settings dialog.

double getUptime ( ) const

Returns the uptime of the engine in seconds.

var getUserPresetList ( ) const

Returns a list of all available user presets as relative path.

String getVersion ( )

Returns the product version (not the HISE version!).

var getZoomLevel ( ) const

Returns the current Zoom Level.

int isControllerUsedByAutomation ( int  controllerNumber)

Checks if the given CC number is used for parameter automation and returns the index of the control.

bool isMpeEnabled ( ) const

Checks if the global MPE mode is enabled.

bool isPlugin ( ) const

Returns true if running as VST / AU / AAX plugin.

void loadAudioFilesIntoPool ( )

Calling this makes sure that all audio files are loaded into the pool and will be available in the compiled plugin.

void loadFont ( const String &  fileName)

Loads a font file.

This is deprecated, because it might result in different names on various OS. Use loadFontAs() instead.

void loadFontAs ( String  fileName,
String  fontId 
)

Loads the font from the given file in the image folder and registers it under the fontId.

This is platform agnostic.

var loadFromJSON ( String  fileName)

Imports a JSON file as object.

void loadImageIntoPool ( const String &  id)

Loads an image into the pool.

You can use a wildcard to load multiple images at once.

void loadNextUserPreset ( bool  stayInDirectory)

Loads the next user preset.

void loadPreviousUserPreset ( bool  stayInDirectory)

Loads the previous user preset.

void loadUserPreset ( const String &  relativePathWithoutFileEnding)

Loads a user preset with the given relative path (use / for directory separation).

bool matchesRegex ( String  stringToMatch,
String  regex 
)

Matches the string against the regex token.

void openWebsite ( String  url)

launches the given URL in the system's web browser.

void redo ( )

Redo the last controller change.

void saveUserPreset ( String  presetName)

Asks for a preset name (if presetName is empty) and saves the current user preset.

void setAllowDuplicateSamples ( bool  shouldAllow)

Sets whether the samples are allowed to be duplicated.

Set this to false if you operate on the same samples differently.

void setCompileProgress ( var  progress)

Displays the progress (0.0 to 1.0) in the progress bar of the editor.

void setGlobalFont ( String  fontName)

Sets the font that will be used as default font for various things.

void setHostBpm ( double  newTempo)

Overwrites the host BPM.

Use -1 for sync to host.

void setKeyColour ( int  keyNumber,
int  colourAsHex 
)

Sets a key of the global keyboard to the specified colour (using the form 0x00FF00 for eg.

of the key to the specified colour.

void setLowestKeyToDisplay ( int  keyNumber)

Changes the lowest visible key on the on screen keyboard.

void setUserPresetTagList ( var  listOfTags)

Sets the tags that appear in the user preset browser.

void showErrorMessage ( String  message,
bool  isCritical 
)

Shows a error message on the compiled plugin (or prints it on the console).

Use isCritical if you want to disable the "Ignore" Button.

void showMessage ( String  message)

Shows a message with an overlay on the compiled plugin with an "OK" button in order to notify the user about important events.

void undo ( )

Reverts the last controller change.

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.