From 3bd74925910aca29bce72606dffe410545c6c267 Mon Sep 17 00:00:00 2001 From: bordun Date: Wed, 1 Jun 2022 14:33:29 +0200 Subject: [PATCH] patchbay: `outputs` property not handling object value properly --- CHANGELOG.md | 1 + src/client/widgets/containers/patchbay.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb620566..e2808811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bug fixes - modal: display issue when a modal receives the same value mutliple times + - patchbay: `outputs` property not handling object value properly - widgets - patchbay: trigger `onValue` script when a connection changes diff --git a/src/client/widgets/containers/patchbay.js b/src/client/widgets/containers/patchbay.js index 931591b3..df5321e2 100644 --- a/src/client/widgets/containers/patchbay.js +++ b/src/client/widgets/containers/patchbay.js @@ -32,7 +32,7 @@ class PatchBayNode extends Widget { this.value = Array.isArray(v) ? v : v ? [v] : [] - var allowed = this.parent.getProp('outputs') + var allowed = this.parent.outputsValues for (var i = this.value.length -1; i > -1; i--) { if (allowed.indexOf(this.value[i]) === -1) { this.value.splice(i, 1) @@ -77,7 +77,7 @@ class PatchBay extends Container(Canvas) { class_specific: { inputs: {type: 'array|object', value: ['input_1', 'input_2'], help: [ '- `Array` of input names : `[\'input_1\', \'input_2\']`', - '- `Object` of `"label_1": "input_1"` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won\'t be kept', + '- `Object` of `"label_1": "input_1"` pairs (example: `{"label a": "value 1", "label b": "value 2"}`). Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won\'t be kept', '', 'Patchbay inputs can be connected to one or more outputs and will send messages of the following form when they are connected/disconnected: ', '`/patchbay_address input_x output_x output_y etc`',