User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
midi_scripting [2018/11/25 15:36] [Soft-takeover] clarify when softTakeoverIgnoreNextValue should be called
midi_scripting [2019/03/19 14:58] (current)
swiftb0y Added connection.isConnected Docs
Line 201: Line 201:
 syncConnection = engine.makeConnection('​[Channel3]',​ '​sync_enabled',​ syncButtonOutputCallback);​ syncConnection = engine.makeConnection('​[Channel3]',​ '​sync_enabled',​ syncButtonOutputCallback);​
 syncConnection.trigger();​ syncConnection.trigger();​
 +You can check if a connection is disconnected by checking ''​isConnected''​ or by comparing the return value of ''​disconnect()'':​
 +<code javascript>​
 +var syncConnection = engine.makeConnection('​[Channel1]',​ '​sync_enabled',​ function () {});
 +print(syncConnection.isConnected);​ // prints true
 +var successful_disconnect = syncConnection.disconnect();​
 +if (successful_disconnect) {
 +    print("​syncConnection has been successfully disconnected"​);​
 +} else {
 +    print("​There was an error disconnecting SyncConnection"​);​
 +    // can happen when the connection has already been disconnected
 +print(syncConnection.isConnected);​ // prints false in most cases
 </​code>​ </​code>​
midi_scripting.1543178206.txt.gz ยท Last modified: 2018/11/25 15:36 by