use "null" value to send osc messages without any argument
This commit is contained in:
parent
4aa27b07a3
commit
abdec11094
2 changed files with 8 additions and 8 deletions
|
|
@ -21,16 +21,16 @@ module.exports = function(ipc, settings) {
|
|||
|
||||
var numberType = precision==0?'integer':'float'
|
||||
|
||||
if (typeof args=='object') {
|
||||
if (typeof args=='object' && args!==null) {
|
||||
for (i in args) {
|
||||
var arg = args[i]
|
||||
if (typeof arg == 'number') {
|
||||
if (typeof arg == 'number' && arg!==null) {
|
||||
message.append({type:numberType,value:arg})
|
||||
} else {
|
||||
} else if (arg!==null){
|
||||
message.append({type:'string',value:String(arg)})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if (args!==null){
|
||||
if (typeof args == 'number') {
|
||||
message.append({type:numberType,value:args})
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@ Buttons are exactly what you think they are.
|
|||
## toggle
|
||||
```js
|
||||
type:'toggle',
|
||||
on: 1, // [string|number|false] value sent when toggle is on (false to prevent sending )
|
||||
off:0, // [string|number|false] value sent when toggle is off (false to prevent sending )
|
||||
on: 1, // [string|number|false|null] value sent when toggle is on (false to prevent sending, null to send no arg)
|
||||
off:0, // [string|number|false|null] value sent when toggle is off (false to prevent sending, null to send no arg)
|
||||
```
|
||||
|
||||
## push
|
||||
```js
|
||||
type:'push',
|
||||
on: 1, // [string|number|false] value sent when toggle is on (false to prevent sending )
|
||||
off:0, // [string|number|false] value sent when toggle is off (false to prevent sending )
|
||||
on: 1, // [string|number|false|null] value sent when toggle is on (false to prevent sending, null to send no arg)
|
||||
off:0, // [string|number|false|null] value sent when toggle is off (false to prevent sending, null to send no arg)
|
||||
```
|
||||
|
||||
## switch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue