widgets: target: make 'null' token disable the global default target (#279)
This commit is contained in:
parent
ba1ebf490b
commit
afc82abd6e
3 changed files with 8 additions and 5 deletions
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
- widgets
|
||||
- `target` and `preArgs` properties are no longer coerced to arrays and can be written as single string values
|
||||
- `linkId` supports master and slave mode with `>>` and `>>` prefixes
|
||||
- `linkId` supports master and slave mode with `>>` and `>>` prefixes
|
||||
- the special `target` token `null` can now be used in conjunction with regular targets, it disables the default global targets set via the `--send` option
|
||||
|
||||
## 0.29.2
|
||||
|
||||
|
|
|
|||
|
|
@ -176,18 +176,20 @@ module.exports = {
|
|||
|
||||
data.args = data.preArgs ? data.preArgs.concat(value) : [value]
|
||||
|
||||
if (!data.target || data.target.indexOf(null) == -1) {
|
||||
if (data.target) {
|
||||
|
||||
var targets = []
|
||||
|
||||
if (settings.read('targets') && !shortdata.target) Array.prototype.push.apply(targets, settings.read('targets'))
|
||||
if (data.target.indexOf(null) === -1 && settings.read('targets') && !shortdata.target) Array.prototype.push.apply(targets, settings.read('targets'))
|
||||
if (data.target) Array.prototype.push.apply(targets, data.target)
|
||||
|
||||
for (var i in targets) {
|
||||
|
||||
if (targets[i] == 'self') {
|
||||
if (targets[i] === 'self') {
|
||||
ipc.send('receiveOsc',data,clientId)
|
||||
continue
|
||||
} else if (targets[i] === null) {
|
||||
continue
|
||||
}
|
||||
|
||||
var host = targets[i].split(':')[0],
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ All widgets share a set of generic properties described below.
|
|||
- if [`midi`](../extras/midi.md) is enabled, targets can be `"midi:device_name"`
|
||||
- special item `"self"` can be used to refer to the emitting client directly
|
||||
- if no target is set (empty array `[]`), messages can still be sent if the server has defaults targets (`-s / --send`)
|
||||
- to disable osc regardless of the previous point, set `target` to `[null]`
|
||||
- to disable the default global osc targets (set via the app's `--send` option), set one of the array's item as `null` (unquoted).
|
||||
|
||||
### `address`<i class="dynamic-prop-icon" title="dynamic"></i>
|
||||
- type: `string`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue