Song
Interface to the current song
Access this object via the song property.
Table of Contents
- Methods
- Properties
- Events
Methods
available
()
String[]
Gets a list of available songs in the user's songs folder
Returns:
An array of song names (relative to user's song folder, extension removed)
close
()
Closes the end point and stops listening for events.
This method no longer needs to be explicitly called as end points are now automatically closed when the last event listener is removed.
loadSong
-
name -
state
Loads the specified song from the user's song folder
Parameters:
-
nameStringName of the song to load (relative to user's song folder, without extension)
-
stateStringOptional name of state to load, or null.
open
()
Opens this end point and starts listening for events.
This method no longer needs to be explicitly called as end points are now automatically opened when the first event listener is attached.
Use this method to keep the end point open even when no event listeners are attached.
untilOpen
()
Promise
Returns a promise that will be resolved when this end point is opened
Returns:
Example:
let C = new CantabileApi();
C.application.open();
await C.application.untilOpen();
Properties
currentState
String
The name of the current song state
name
String
The name of the current song
pr
Number
The set list program number of the song (or -1 if not in set list, or not set)
Events
changed
Fired when anything about the current song changes
currentStateChanged
Fired when the current song state changes
nameChanged
Fired when the name of the current song changes
Cantabile JavaScript API