Show:
Extends EventEmitter

Represents a connection to Cantabile.

Constructor

Cantabile
(
  • host
)

Defined in CantabileApi.js:7

Parameters:

  • [host] String optional

    The host to connect to. This can be either or http:// or ws:// When running in a browser, the defaults to ${window.location.host}. In other environments it defaults to localhost:35007.

Methods

connect ()

Defined in CantabileApi.js:149

Initiate connection and retry if fails

disconnect ()

Defined in CantabileApi.js:159

Disconnect and stop retries

request
(
  • obj
)
Promise | Object

Defined in CantabileApi.js:181

Stringify an object as a JSON message, send it to the server and returns a promise which will resolve to the result.

Parameters:

  • obj Object

    The object to send

Returns:

Promise | Object
send
(
  • obj
)

Defined in CantabileApi.js:169

Stringify an object as a JSON message and send it to the server

Parameters:

  • obj Object

    The object to send

untilConnected () Promise

Defined in CantabileApi.js:208

Returns a promise that will be resolved when connected

Returns:

Promise

Example:

let C = new CantabileApi();
await C.untilConnected();

Properties

application

Application

Defined in CantabileApi.js:121

Provides access to the application object

bindings

Bindings

Defined in CantabileApi.js:81

Provides access to global binding points

bindings4

Bindings4

Defined in CantabileApi.js:89

Provides access to global binding v4 points

commands

Commands

Defined in CantabileApi.js:97

Provides access to global commands

engine

Engine

Defined in CantabileApi.js:129

Provides access to the engine object

host

String

Defined in CantabileApi.js:262

The current host

host

String

Defined in CantabileApi.js:324

The base socket url

host

String

Defined in CantabileApi.js:335

The base host url

keyRanges

KeyRanges

Defined in CantabileApi.js:49

Gets the currently active key ranges

onscreenKeyboard

OnscreenKeyboard

Defined in CantabileApi.js:73

Provides access to controllers managed by Cantabile's onscreen keyboard device

setList

SetList

Defined in CantabileApi.js:33

Gets the setList object

showNotes

ShowNotes

Defined in CantabileApi.js:57

Gets the current set of show notes

song

Song

Defined in CantabileApi.js:105

Provides access to information about the current song

songStates

SongStates

Defined in CantabileApi.js:41

Gets the states of the current song

state

String

Defined in CantabileApi.js:138

The current connection state, either "connecting", "connected" or "disconnected"

transport

Song

Defined in CantabileApi.js:113

Provides access to master transport controls

variables

Variables

Defined in CantabileApi.js:65

Provides access to variable expansion facilities

Events

connected

Defined in CantabileApi.js:514

Fired when entering the connected state

connecting

Defined in CantabileApi.js:521

Fired when entering the connecting state

disconnected

Defined in CantabileApi.js:528

Fired when entering the disconnected state

stateChanged

Defined in CantabileApi.js:506

Fired when the state property value changes

Event Payload:

  • state String

    The new connection state ("connecting", "connected" or "disconnected")