SetList Class
Used to access and control Cantabile's set list functionality.
Access this object via the Cantabile#setList property.
class SetList extends EndPoint {
get items(): SetListItem[];
get name(): string;
get preLoaded(): boolean;
get currentSongIndex(): number;
get currentSong(): SetListItem;
loadSongByIndex(index: number, delayed?: boolean): void;
loadSongByProgram(program: number, delayed?: boolean): void;
loadFirstSong(delayed?: boolean): void;
loadLastSong(delayed?: boolean): void;
loadNextSong(direction: number, delayed?: boolean, wrap?: boolean): void;
available(): string[];
loadSetList(name: string, loadFirst?: boolean): void;
}
#Properties
#currentSong
The currently loaded SetListItem (or null if the current song isn't in the set list).
See also #currentSongIndex.
get currentSong(): SetListItem;
#currentSongIndex
The index of the currently loaded song (or -1 if the current song isn't in the set list).
See also #currentSong.
get currentSongIndex(): number;
#items
An array of SetListItem items in the set list
get items(): SetListItem[];
#name
The display name of the current set list (ie: its file name with path and extension removed)
get name(): string;
#preLoaded
Indicates if the set list is currently pre-loaded
get preLoaded(): boolean;
#Methods
#available()
Gets a list of available set lists in the user's set list folder
available(): string[];
#loadFirstSong()
Load the first song in the set list
loadFirstSong(delayed?: boolean): void;
delayedWhether to perform a delayed or immediate load
#loadLastSong()
Load the last song in the set list
loadLastSong(delayed?: boolean): void;
delayedWhether to perform a delayed or immediate load
#loadNextSong()
Load the next or previous song in the set list
loadNextSong(direction: number, delayed?: boolean, wrap?: boolean): void;
-
directionDirection to move (1 = next, -1 = previous) -
delayedWhether to perform a delayed or immediate load -
wrapWhether to wrap around at the start/end of the list
#loadSetList()
Loads the specified set list from the user's set list folder
loadSetList(name: string, loadFirst?: boolean): void;
-
nameName of the set to load (relative to user's set list folder, without extension) -
loadFirstTrue to load the first song in the set list (default = true)
#loadSongByIndex()
Load the song at a given index position
loadSongByIndex(index: number, delayed?: boolean): void;
-
indexThe zero based index of the song to load -
delayedWhether to perform a delayed or immediate load
#loadSongByProgram()
Load the song with a given program number
loadSongByProgram(program: number, delayed?: boolean): void;
-
programThe zero based program number of the song to load -
delayedWhether to perform a delayed or immediate load
#Events
#'changed' Event
Fired when anything about the contents of the set list changes
setList.on('changed', () => { });
#'currentSongChanged' Event
Fired when the currently loaded song changes
setList.on('currentSongChanged', () => { });
#'currentSongPartChanged' Event
Fired when the part of the currently loaded song changes
setList.on('currentSongPartChanged', (part: Number, partCount: Number) => { });
-
partThe zero-based current song part index (can be -1) -
partCountThe number of parts in the current song
#'itemAdded' Event
Fired after a new item has been added to the set list
setList.on('itemAdded', (index: Number) => { });
indexThe zero based index of the newly added item
#'itemChanged' Event
Fired when something about an item has changed
setList.on('itemChanged', (index: Number) => { });
indexThe zero based index of the item that changed
#'itemMoved' Event
Fired when an item in the set list has been moved
setList.on('itemMoved', (from: Number, to: Number) => { });
-
fromThe zero based index of the item before being moved -
toThe zero based index of the item's new position
#'itemRemoved' Event
Fired after an item has been removed from the set list
setList.on('itemRemoved', (index: Number) => { });
indexThe zero based index of the removed item
#'nameChanged' Event
Fired when the name of the currently loaded set list changes
setList.on('nameChanged', () => { });
#'preLoadedChanged' Event
Fired when the pre-loaded state of the list has changed
setList.on('preLoadedChanged', () => { });
#'reload' Event
Fired when the entire set list has changed (eg: after a sort operation, or loading a new set list)
setList.on('reload', () => { });