@cuecue/osc 0.0.26 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +178 -0
  2. package/package.json +8 -6
  3. package/lib/index.js +0 -497
package/dist/index.js ADDED
@@ -0,0 +1,178 @@
1
+ import { Server, Client } from 'node-osc';
2
+ import createDebug from 'debug';
3
+ import { BasePlugin } from '@cuecue/core';
4
+ import isObject from 'lodash/isObject';
5
+ import isArray from 'lodash/isArray';
6
+
7
+ class Base extends BasePlugin {
8
+ constructor(opts = {}) {
9
+ super({
10
+ port: process.env.OSC_PORT || 8081,
11
+ host: process.env.OSC_HOST || '0.0.0.0',
12
+ ...opts
13
+ });
14
+ this.osc = null;
15
+ this.debug = createDebug('cuecue:osc');
16
+ }
17
+
18
+ async onInitialized() {
19
+ const {
20
+ host,
21
+ port
22
+ } = this.options;
23
+ this.debug('started on %s:%s', host, port);
24
+ await super.onInitialized();
25
+ }
26
+
27
+ async onDestroy() {
28
+ await super.onDestroy();
29
+ return new Promise(resolve => {
30
+ this.osc.close(() => {
31
+ resolve();
32
+ });
33
+ });
34
+ }
35
+
36
+ }
37
+
38
+ class OscInput extends Base {
39
+ constructor({
40
+ commands = null,
41
+ ...opts
42
+ } = {}) {
43
+ super(opts);
44
+ this.commands = commands;
45
+ this.debug = createDebug('cuecue:input:osc');
46
+ this.onMessage = this.onMessage.bind(this);
47
+ }
48
+
49
+ setInputCommands(commands) {
50
+ this.commands = commands;
51
+ return this;
52
+ }
53
+
54
+ async onInit() {
55
+ await super.onInit();
56
+ const {
57
+ port,
58
+ host
59
+ } = this.options;
60
+ return new Promise(resolve => {
61
+ this.osc = new Server(port, host, () => {
62
+ resolve();
63
+ });
64
+ this.osc.on('message', this.onMessage);
65
+ });
66
+ }
67
+
68
+ async onDestroy() {
69
+ this.osc.off('message', this.onMessage);
70
+ await super.onDestroy();
71
+ }
72
+
73
+ async onMessage(message) {
74
+ const {
75
+ transformCommand = null
76
+ } = this.options;
77
+ const [oscPath = null, ...args] = message;
78
+ const command = oscPath.replace(/^\//, '');
79
+ const value = transformCommand !== null ? await transformCommand(command, args) : {
80
+ command,
81
+ args
82
+ };
83
+ const {
84
+ command: finalCommand = command,
85
+ args: finalArgs = args
86
+ } = value || {};
87
+
88
+ if (this.commands === null || this.commands.indexOf(finalCommand) !== -1) {
89
+ this.debug('command: %s %o', finalCommand, finalArgs);
90
+ this.emit('command', finalCommand, ...finalArgs);
91
+ }
92
+ }
93
+
94
+ }
95
+
96
+ class OscOutput extends Base {
97
+ constructor(opts) {
98
+ super(opts);
99
+ this.debug = createDebug('cuecue:output:osc');
100
+ }
101
+
102
+ async onInit() {
103
+ await super.onInit();
104
+ const {
105
+ host,
106
+ port
107
+ } = this.options;
108
+ this.osc = new Client(host, port);
109
+ }
110
+
111
+ cue(cue, extraData = null) {
112
+ this.command('cue', cue, extraData);
113
+ }
114
+
115
+ cues(cues) {
116
+ this.command('cues', cues);
117
+ }
118
+
119
+ interaction(interaction) {
120
+ this.command('interaction', interaction);
121
+ }
122
+
123
+ interact(data, interactionId = null) {
124
+ this.command('interact', data, interactionId);
125
+ }
126
+
127
+ async command(command, ...args) {
128
+ const {
129
+ transformCommand = null,
130
+ acceptCommand = null
131
+ } = this.options;
132
+ const value = transformCommand !== null ? await transformCommand(command, args) : {
133
+ command,
134
+ args
135
+ };
136
+
137
+ if (value === false) {
138
+ this.debug('command canceled: %s %o', command, args);
139
+ return Promise.resolve();
140
+ }
141
+
142
+ const values = isArray(value) ? value : [value];
143
+ return Promise.all(values.map(val => {
144
+ const {
145
+ command: finalCommand = command,
146
+ args: finalArgs = args
147
+ } = val || {};
148
+
149
+ if (acceptCommand !== null && !acceptCommand(finalCommand, finalArgs)) {
150
+ this.debug('command refused: %s %o', finalCommand, finalArgs);
151
+ return Promise.resolve();
152
+ }
153
+
154
+ this.debug('command: %s %o', finalCommand, finalArgs);
155
+ const path = finalCommand.replace(/^\/?/, '/');
156
+ const sendArgs = finalArgs.filter(it => it !== null && !isObject(it) && !isArray(it));
157
+ return this.send(path, ...sendArgs);
158
+ }));
159
+ }
160
+
161
+ async send(path, ...args) {
162
+ return new Promise((resolve, reject) => {
163
+ this.osc.send(path, ...args, err => {
164
+ if (err) {
165
+ this.debug('send error: %s %o', path, args);
166
+ reject(err);
167
+ return;
168
+ }
169
+
170
+ this.debug('send success: %s %o', path, args);
171
+ resolve();
172
+ });
173
+ });
174
+ }
175
+
176
+ }
177
+
178
+ export { OscInput as Input, OscOutput as Output };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuecue/osc",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -29,16 +29,18 @@
29
29
  }
30
30
  ],
31
31
  "license": "ISC",
32
- "main": "lib/index.js",
32
+ "main": "dist/index.js",
33
33
  "files": [
34
- "lib"
34
+ "dist"
35
35
  ],
36
36
  "scripts": {
37
- "prepare": "../../scripts/prepare-package.sh"
37
+ "clean": "rm -rf dist",
38
+ "build": "rollup --config ../../rollup.config.js",
39
+ "prepare": "npm run clean && npm run build"
38
40
  },
39
41
  "dependencies": {
40
42
  "@babel/runtime": "^7.12.5",
41
- "@cuecue/core": "^0.0.26",
43
+ "@cuecue/core": "^0.0.27",
42
44
  "debug": "^4.3.1",
43
45
  "lodash": "^4.17.20",
44
46
  "node-osc": "^5.2.2"
@@ -46,5 +48,5 @@
46
48
  "publishConfig": {
47
49
  "access": "public"
48
50
  },
49
- "gitHead": "afce8c2fc41b6769e95299e85008d3d82666512f"
51
+ "gitHead": "2c305c0d1c0b13469fe74e2b928c0b45744c8ac0"
50
52
  }
package/lib/index.js DELETED
@@ -1,497 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
6
- var _toArray = require('@babel/runtime/helpers/toArray');
7
- var _regeneratorRuntime = require('@babel/runtime/regenerator');
8
- var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
9
- var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
10
- var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
11
- var _createClass = require('@babel/runtime/helpers/createClass');
12
- var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitialized');
13
- var _get = require('@babel/runtime/helpers/get');
14
- var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
15
- var _inherits = require('@babel/runtime/helpers/inherits');
16
- var _createSuper = require('@babel/runtime/helpers/createSuper');
17
- var nodeOsc = require('node-osc');
18
- var createDebug = require('debug');
19
- var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
20
- var core = require('@cuecue/core');
21
- var isObject = require('lodash/isObject');
22
- var isArray = require('lodash/isArray');
23
-
24
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
25
-
26
- var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
27
- var _toArray__default = /*#__PURE__*/_interopDefaultLegacy(_toArray);
28
- var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
29
- var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
30
- var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
31
- var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
32
- var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
33
- var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
34
- var _get__default = /*#__PURE__*/_interopDefaultLegacy(_get);
35
- var _getPrototypeOf__default = /*#__PURE__*/_interopDefaultLegacy(_getPrototypeOf);
36
- var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
37
- var _createSuper__default = /*#__PURE__*/_interopDefaultLegacy(_createSuper);
38
- var createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
39
- var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
40
- var isObject__default = /*#__PURE__*/_interopDefaultLegacy(isObject);
41
- var isArray__default = /*#__PURE__*/_interopDefaultLegacy(isArray);
42
-
43
- var Base = /*#__PURE__*/function (_BasePlugin) {
44
- _inherits__default['default'](Base, _BasePlugin);
45
-
46
- var _super = _createSuper__default['default'](Base);
47
-
48
- function Base() {
49
- var _this;
50
-
51
- var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
52
-
53
- _classCallCheck__default['default'](this, Base);
54
-
55
- _this = _super.call(this, _objectSpread__default['default']({
56
- port: process.env.OSC_PORT || 8081,
57
- host: process.env.OSC_HOST || '0.0.0.0'
58
- }, opts));
59
- _this.osc = null;
60
- _this.debug = createDebug__default['default']('cuecue:osc');
61
- return _this;
62
- }
63
-
64
- _createClass__default['default'](Base, [{
65
- key: "onInitialized",
66
- value: function () {
67
- var _onInitialized = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
68
- var _this$options, host, port;
69
-
70
- return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
71
- while (1) {
72
- switch (_context.prev = _context.next) {
73
- case 0:
74
- _this$options = this.options, host = _this$options.host, port = _this$options.port;
75
- this.debug('started on %s:%s', host, port);
76
- _context.next = 4;
77
- return _get__default['default'](_getPrototypeOf__default['default'](Base.prototype), "onInitialized", this).call(this);
78
-
79
- case 4:
80
- case "end":
81
- return _context.stop();
82
- }
83
- }
84
- }, _callee, this);
85
- }));
86
-
87
- function onInitialized() {
88
- return _onInitialized.apply(this, arguments);
89
- }
90
-
91
- return onInitialized;
92
- }()
93
- }, {
94
- key: "onDestroy",
95
- value: function () {
96
- var _onDestroy = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2() {
97
- var _this2 = this;
98
-
99
- return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
100
- while (1) {
101
- switch (_context2.prev = _context2.next) {
102
- case 0:
103
- _context2.next = 2;
104
- return _get__default['default'](_getPrototypeOf__default['default'](Base.prototype), "onDestroy", this).call(this);
105
-
106
- case 2:
107
- return _context2.abrupt("return", new Promise(function (resolve) {
108
- _this2.osc.close(function () {
109
- resolve();
110
- });
111
- }));
112
-
113
- case 3:
114
- case "end":
115
- return _context2.stop();
116
- }
117
- }
118
- }, _callee2, this);
119
- }));
120
-
121
- function onDestroy() {
122
- return _onDestroy.apply(this, arguments);
123
- }
124
-
125
- return onDestroy;
126
- }()
127
- }]);
128
-
129
- return Base;
130
- }(core.BasePlugin);
131
-
132
- var OscInput = /*#__PURE__*/function (_Base) {
133
- _inherits__default['default'](OscInput, _Base);
134
-
135
- var _super = _createSuper__default['default'](OscInput);
136
-
137
- function OscInput() {
138
- var _this;
139
-
140
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
141
- _ref$commands = _ref.commands,
142
- commands = _ref$commands === void 0 ? null : _ref$commands,
143
- opts = _objectWithoutProperties__default['default'](_ref, ["commands"]);
144
-
145
- _classCallCheck__default['default'](this, OscInput);
146
-
147
- _this = _super.call(this, opts);
148
- _this.commands = commands;
149
- _this.debug = createDebug__default['default']('cuecue:input:osc');
150
- _this.onMessage = _this.onMessage.bind(_assertThisInitialized__default['default'](_this));
151
- return _this;
152
- }
153
-
154
- _createClass__default['default'](OscInput, [{
155
- key: "setInputCommands",
156
- value: function setInputCommands(commands) {
157
- this.commands = commands;
158
- return this;
159
- }
160
- }, {
161
- key: "onInit",
162
- value: function () {
163
- var _onInit = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
164
- var _this2 = this;
165
-
166
- var _this$options, port, host;
167
-
168
- return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
169
- while (1) {
170
- switch (_context.prev = _context.next) {
171
- case 0:
172
- _context.next = 2;
173
- return _get__default['default'](_getPrototypeOf__default['default'](OscInput.prototype), "onInit", this).call(this);
174
-
175
- case 2:
176
- _this$options = this.options, port = _this$options.port, host = _this$options.host;
177
- return _context.abrupt("return", new Promise(function (resolve) {
178
- _this2.osc = new nodeOsc.Server(port, host, function () {
179
- resolve();
180
- });
181
-
182
- _this2.osc.on('message', _this2.onMessage);
183
- }));
184
-
185
- case 4:
186
- case "end":
187
- return _context.stop();
188
- }
189
- }
190
- }, _callee, this);
191
- }));
192
-
193
- function onInit() {
194
- return _onInit.apply(this, arguments);
195
- }
196
-
197
- return onInit;
198
- }()
199
- }, {
200
- key: "onDestroy",
201
- value: function () {
202
- var _onDestroy = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2() {
203
- return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
204
- while (1) {
205
- switch (_context2.prev = _context2.next) {
206
- case 0:
207
- this.osc.off('message', this.onMessage);
208
- _context2.next = 3;
209
- return _get__default['default'](_getPrototypeOf__default['default'](OscInput.prototype), "onDestroy", this).call(this);
210
-
211
- case 3:
212
- case "end":
213
- return _context2.stop();
214
- }
215
- }
216
- }, _callee2, this);
217
- }));
218
-
219
- function onDestroy() {
220
- return _onDestroy.apply(this, arguments);
221
- }
222
-
223
- return onDestroy;
224
- }()
225
- }, {
226
- key: "onMessage",
227
- value: function () {
228
- var _onMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(message) {
229
- var _this$options$transfo, transformCommand, _message, _message$, oscPath, args, command, value, _ref2, _ref2$command, finalCommand, _ref2$args, finalArgs;
230
-
231
- return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
232
- while (1) {
233
- switch (_context3.prev = _context3.next) {
234
- case 0:
235
- _this$options$transfo = this.options.transformCommand, transformCommand = _this$options$transfo === void 0 ? null : _this$options$transfo;
236
- _message = _toArray__default['default'](message), _message$ = _message[0], oscPath = _message$ === void 0 ? null : _message$, args = _message.slice(1);
237
- command = oscPath.replace(/^\//, '');
238
-
239
- if (!(transformCommand !== null)) {
240
- _context3.next = 9;
241
- break;
242
- }
243
-
244
- _context3.next = 6;
245
- return transformCommand(command, args);
246
-
247
- case 6:
248
- _context3.t0 = _context3.sent;
249
- _context3.next = 10;
250
- break;
251
-
252
- case 9:
253
- _context3.t0 = {
254
- command: command,
255
- args: args
256
- };
257
-
258
- case 10:
259
- value = _context3.t0;
260
- _ref2 = value || {}, _ref2$command = _ref2.command, finalCommand = _ref2$command === void 0 ? command : _ref2$command, _ref2$args = _ref2.args, finalArgs = _ref2$args === void 0 ? args : _ref2$args;
261
-
262
- if (this.commands === null || this.commands.indexOf(finalCommand) !== -1) {
263
- this.debug('command: %s %o', finalCommand, finalArgs);
264
- this.emit.apply(this, ['command', finalCommand].concat(_toConsumableArray__default['default'](finalArgs)));
265
- }
266
-
267
- case 13:
268
- case "end":
269
- return _context3.stop();
270
- }
271
- }
272
- }, _callee3, this);
273
- }));
274
-
275
- function onMessage(_x) {
276
- return _onMessage.apply(this, arguments);
277
- }
278
-
279
- return onMessage;
280
- }()
281
- }]);
282
-
283
- return OscInput;
284
- }(Base);
285
-
286
- var OscOutput = /*#__PURE__*/function (_Base) {
287
- _inherits__default['default'](OscOutput, _Base);
288
-
289
- var _super = _createSuper__default['default'](OscOutput);
290
-
291
- function OscOutput(opts) {
292
- var _this;
293
-
294
- _classCallCheck__default['default'](this, OscOutput);
295
-
296
- _this = _super.call(this, opts);
297
- _this.debug = createDebug__default['default']('cuecue:output:osc');
298
- return _this;
299
- }
300
-
301
- _createClass__default['default'](OscOutput, [{
302
- key: "onInit",
303
- value: function () {
304
- var _onInit = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
305
- var _this$options, host, port;
306
-
307
- return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
308
- while (1) {
309
- switch (_context.prev = _context.next) {
310
- case 0:
311
- _context.next = 2;
312
- return _get__default['default'](_getPrototypeOf__default['default'](OscOutput.prototype), "onInit", this).call(this);
313
-
314
- case 2:
315
- _this$options = this.options, host = _this$options.host, port = _this$options.port;
316
- this.osc = new nodeOsc.Client(host, port);
317
-
318
- case 4:
319
- case "end":
320
- return _context.stop();
321
- }
322
- }
323
- }, _callee, this);
324
- }));
325
-
326
- function onInit() {
327
- return _onInit.apply(this, arguments);
328
- }
329
-
330
- return onInit;
331
- }()
332
- }, {
333
- key: "cue",
334
- value: function cue(_cue) {
335
- var extraData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
336
- this.command('cue', _cue, extraData);
337
- }
338
- }, {
339
- key: "cues",
340
- value: function cues(_cues) {
341
- this.command('cues', _cues);
342
- }
343
- }, {
344
- key: "interaction",
345
- value: function interaction(_interaction) {
346
- this.command('interaction', _interaction);
347
- }
348
- }, {
349
- key: "interact",
350
- value: function interact(data) {
351
- var interactionId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
352
- this.command('interact', data, interactionId);
353
- }
354
- }, {
355
- key: "command",
356
- value: function () {
357
- var _command2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_command) {
358
- var _this2 = this;
359
-
360
- var _len,
361
- args,
362
- _key,
363
- _this$options$transfo,
364
- transformCommand,
365
- value,
366
- values,
367
- _args2 = arguments;
368
-
369
- return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
370
- while (1) {
371
- switch (_context2.prev = _context2.next) {
372
- case 0:
373
- for (_len = _args2.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
374
- args[_key - 1] = _args2[_key];
375
- }
376
-
377
- _this$options$transfo = this.options.transformCommand, transformCommand = _this$options$transfo === void 0 ? null : _this$options$transfo;
378
-
379
- if (!(transformCommand !== null)) {
380
- _context2.next = 8;
381
- break;
382
- }
383
-
384
- _context2.next = 5;
385
- return transformCommand(_command, args);
386
-
387
- case 5:
388
- _context2.t0 = _context2.sent;
389
- _context2.next = 9;
390
- break;
391
-
392
- case 8:
393
- _context2.t0 = {
394
- command: _command,
395
- args: args
396
- };
397
-
398
- case 9:
399
- value = _context2.t0;
400
-
401
- if (!(value === false)) {
402
- _context2.next = 13;
403
- break;
404
- }
405
-
406
- this.debug('command canceled: %s %o', _command, args);
407
- return _context2.abrupt("return", Promise.resolve());
408
-
409
- case 13:
410
- values = isArray__default['default'](value) ? value : [value];
411
- return _context2.abrupt("return", Promise.all(values.map(function (val) {
412
- var _ref = val || {},
413
- _ref$command = _ref.command,
414
- finalCommand = _ref$command === void 0 ? _command : _ref$command,
415
- _ref$args = _ref.args,
416
- finalArgs = _ref$args === void 0 ? args : _ref$args;
417
-
418
- _this2.debug('command: %s %o', finalCommand, finalArgs);
419
-
420
- var path = finalCommand.replace(/^\/?/, '/');
421
- var sendArgs = finalArgs.filter(function (it) {
422
- return it !== null && !isObject__default['default'](it) && !isArray__default['default'](it);
423
- });
424
- return _this2.send.apply(_this2, [path].concat(_toConsumableArray__default['default'](sendArgs)));
425
- })));
426
-
427
- case 15:
428
- case "end":
429
- return _context2.stop();
430
- }
431
- }
432
- }, _callee2, this);
433
- }));
434
-
435
- function command(_x) {
436
- return _command2.apply(this, arguments);
437
- }
438
-
439
- return command;
440
- }()
441
- }, {
442
- key: "send",
443
- value: function () {
444
- var _send = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(path) {
445
- var _this3 = this;
446
-
447
- var _len2,
448
- args,
449
- _key2,
450
- _args3 = arguments;
451
-
452
- return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
453
- while (1) {
454
- switch (_context3.prev = _context3.next) {
455
- case 0:
456
- for (_len2 = _args3.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
457
- args[_key2 - 1] = _args3[_key2];
458
- }
459
-
460
- return _context3.abrupt("return", new Promise(function (resolve, reject) {
461
- var _this3$osc;
462
-
463
- (_this3$osc = _this3.osc).send.apply(_this3$osc, [path].concat(args, [function (err) {
464
- if (err) {
465
- _this3.debug('send error: %s %o', path, args);
466
-
467
- reject(err);
468
- return;
469
- }
470
-
471
- _this3.debug('send success: %s %o', path, args);
472
-
473
- resolve();
474
- }]));
475
- }));
476
-
477
- case 2:
478
- case "end":
479
- return _context3.stop();
480
- }
481
- }
482
- }, _callee3);
483
- }));
484
-
485
- function send(_x2) {
486
- return _send.apply(this, arguments);
487
- }
488
-
489
- return send;
490
- }()
491
- }]);
492
-
493
- return OscOutput;
494
- }(Base);
495
-
496
- exports.Input = OscInput;
497
- exports.Output = OscOutput;