Initial commit
This commit is contained in:
54
Backend/dist/Integrations/buildin/zoomosc/template/connectionOnly.js
vendored
Normal file
54
Backend/dist/Integrations/buildin/zoomosc/template/connectionOnly.js
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
exports.__esModule = true;
|
||||
exports.ZoomOSC_ConnectionOnly = void 0;
|
||||
var node_osc_1 = require("node-osc");
|
||||
exports.ZoomOSC_ConnectionOnly = {
|
||||
handleAction: function (oscAction) {
|
||||
return function (ActionAPI) {
|
||||
ActionAPI.onExecute(function (properties, status, deck) {
|
||||
return exports.ZoomOSC_ConnectionOnly.onExecute(ActionAPI, oscAction, properties, status, deck);
|
||||
});
|
||||
ActionAPI.onOpenEditor(exports.ZoomOSC_ConnectionOnly.onOpenEditor);
|
||||
};
|
||||
},
|
||||
onExecute: function (ActionAPI, oscAction, properties, status, deck) {
|
||||
if (properties.connectionID != undefined && properties.connectionID.length > 0) {
|
||||
var connection = ActionAPI.getConnection('zoomosc', properties.connectionID);
|
||||
if (connection) {
|
||||
var ip = connection.properties.ip;
|
||||
var port = connection.properties.port;
|
||||
var header = connection.properties.header;
|
||||
var client = new node_osc_1.Client(ip, port);
|
||||
client.send("/" + header + "/" + oscAction, [], function () {
|
||||
status("OSC Action " + oscAction + " has been called", 'info');
|
||||
client.close();
|
||||
});
|
||||
}
|
||||
else
|
||||
status('Connection does not exist', 'error');
|
||||
}
|
||||
else
|
||||
status('No connectionID specified', 'error');
|
||||
},
|
||||
onOpenEditor: function (EditorAPI, properties) {
|
||||
var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
|
||||
var connectionField = {
|
||||
id: 'connectionID',
|
||||
name: 'Connection',
|
||||
type: 'connection',
|
||||
connectionType: 'zoomosc',
|
||||
value: connectionID
|
||||
};
|
||||
EditorAPI.onFieldChanges(function (fields) {
|
||||
var fieldObject = EditorAPI.tools.objectifyFieldsValues(fields);
|
||||
EditorAPI.saveProperties({
|
||||
connectionID: fieldObject.connectionID,
|
||||
target: fieldObject.target,
|
||||
targetValue: fieldObject.targetValue
|
||||
});
|
||||
});
|
||||
EditorAPI.setFields([
|
||||
connectionField
|
||||
]);
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=connectionOnly.js.map
|
||||
Reference in New Issue
Block a user