SetList
Used to access and control Cantabile's set list functionality.
Access this object via the setList property.
Table of Contents
- Methods
- Properties
- Events
Methods
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.
loadFirstSong
-
delayed=false
Load the first song in the set list
Parameters:
-
[delayed=false]
Boolean optionalWhether to perform a delayed or immediate load
loadLastSong
-
delayed=false
Load the last song in the set list
Parameters:
-
[delayed=false]
Boolean optionalWhether to perform a delayed or immediate load
loadNextSong
-
direction
-
delayed=false
-
wrap=false
Load the next or previous song in the set list
Parameters:
-
direction
NumberDirection to move (1 = next, -1 = previous)
-
[delayed=false]
Boolean optionalWhether to perform a delayed or immediate load
-
[wrap=false]
Boolean optionalWhether to wrap around at the start/end of the list
loadSongByIndex
-
index
-
delayed=false
Load the song at a given index position
Parameters:
-
index
NumberThe zero based index of the song to load
-
[delayed=false]
Boolean optionalWhether to perform a delayed or immediate load
loadSongByProgram
-
index
-
delayed=false
Load the song with a given program number
Parameters:
-
index
NumberThe zero based program number of the song to load
-
[delayed=false]
Boolean optionalWhether to perform a delayed or immediate load
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
currentSong
SetListItem
The currently loaded item (or null if the current song isn't in the set list)
currentSongIndex
Number
The index of the currently loaded song (or -1 if the current song isn't in the set list)
name
String
The display name of the current set list (ie: its file name with path and extension removed)
preLoaded
Boolean
Indicates if the set list is currently pre-loaded
Events
changed
Fired when anything about the contents of the set list changes
currentSongChanged
Fired when the currently loaded song changes
currentSongPartChanged
Fired when the part of the currently loaded song changes
Event Payload:
-
part
NumberThe zero-based current song part index (can be -1)
-
partCount
NumberThe number of parts in the current song
itemAdded
Fired after a new item has been added to the set list
Event Payload:
-
index
NumberThe zero based index of the newly added item
itemChanged
Fired when something about an item has changed
Event Payload:
-
index
NumberThe zero based index of the item that changed
itemMoved
Fired when an item in the set list has been moved
Event Payload:
-
from
NumberThe zero based index of the item before being moved
-
to
NumberThe zero based index of the item's new position
itemRemoved
Fired after an item has been removed from the set list
Event Payload:
-
index
NumberThe zero based index of the removed item
nameChanged
Fired when the name of the currently loaded set list changes
preLoadedChanged
Fired when the pre-loaded state of the list has changed
reload
Fired when the entire set list has changed (eg: after a sort operation, or loading a new set list)