matrices: complete matrices options and add traversing option

This commit is contained in:
jean-emmanuel 2016-10-12 21:06:01 +02:00
parent 8db54b2270
commit e8db2543b1
5 changed files with 46 additions and 31 deletions

View file

@ -21,18 +21,13 @@ Multifader creates a row of vertical faders that respond to the same gestures.
- `label`: `i`
- `path`: same as the widget's with `/i` appended to it
#### `traversing`
- type: `boolean`
- default: `true`
- usage: enable traversing gestures
#### `range`
- see fader's [`range`](sliders/#fader)
#### `logScale`
- see fader's [`logScale`](sliders/#fader)
#### `unit`
- see fader's [`unit`](sliders/#fader)
#### `compact`
- see fader's [`compact`](sliders/#fader)
#### `options`
- see fader's [`options`](sliders/#fader)
----
@ -53,12 +48,13 @@ Multifader creates a row of vertical faders that respond to the same gestures.
- `label`: `i`
- `path`: same as the widget's with `/i` appended to it
#### `traversing`
- type: `boolean`
- default: `true`
- usage: enable traversing gestures
#### `on`
- see toggle's [`on`](buttons/#toggle)
#### `off`
- see toggle's [`off`](buttons/#toggle)
#### `options`
- see toggle's [`options`](buttons/#toggle)
----
@ -78,9 +74,11 @@ Multifader creates a row of vertical faders that respond to the same gestures.
- `label`: `i`
- `path`: same as the widget's with `/i` appended to it
#### `traversing`
- type: `boolean`
- default: `true`
- usage: enable traversing gestures
#### `on`
- see push's [`on`](buttons/#push)
#### `off`
- see push's [`off`](buttons/#push)
#### `options`
- see push's [`options`](buttons/#push)

View file

@ -20,7 +20,6 @@ var _matrices_base = module.exports = function(widgetData){
this.widget.trigger({type:'sync',id:this.widgetData.id,widget:this.widget})
}.bind(this))
this.widget.enableTraversingGestures()
}

View file

@ -25,7 +25,7 @@ module.exports.options = {
separator2:'behaviour',
snap:false,
traversing:true,
separator3:'osc',
@ -63,11 +63,15 @@ var Multifader = function(widgetData) {
var element = parsewidgets([data],this.widget)
element[0].setAttribute('style',`width:${100/widgetData.strips}%`)
element[0].classList.add('not-editable')
element.find('.fader-wrapper').off('drag')
if (widgetData.traversing) element.find('.fader-wrapper').off('drag')
this.value[i] = widgetData.range.min
}
if (widgetData.traversing) this.widget.enableTraversingGestures()
}
Multifader.prototype = Object.create(_matrices_base.prototype)

View file

@ -18,10 +18,15 @@ module.exports.options = {
color:'auto',
css:'',
separator2:'osc',
separator2:'behaviour',
traversing:true,
separator3:'osc',
on:1,
off:0,
norelease:false,
precision:2,
path:'auto',
preArgs:[],
@ -54,6 +59,9 @@ var Multipush = function(widgetData) {
}
if (widgetData.traversing) this.widget.enableTraversingGestures()
}
Multipush.prototype = Object.create(_matrices_base.prototype)

View file

@ -18,7 +18,11 @@ module.exports.options = {
color:'auto',
css:'',
separator2:'osc',
separator2:'behaviour',
traversing:true,
separator3:'osc',
on:1,
off:0,
@ -37,13 +41,13 @@ var Multitoggle = function(widgetData) {
for (var i=0;i<widgetData.matrix[0]*widgetData.matrix[1];i++) {
var data = JSON.parse(strData)
var data = JSON.parse(strData)
data.top = data.left = data.height = data.width = 'auto'
data.type = 'toggle'
data.id = widgetData.id + '/' + i
data.label = i
data.path = widgetData.path + '/' + i
data.top = data.left = data.height = data.width = 'auto'
data.type = 'toggle'
data.id = widgetData.id + '/' + i
data.label = i
data.path = widgetData.path + '/' + i
var element = parsewidgets([data],this.widget)
element[0].setAttribute('style',`width:${100/widgetData.matrix[0]}%`)
@ -53,6 +57,8 @@ var Multitoggle = function(widgetData) {
}
if (widgetData.traversing) this.widget.enableTraversingGestures()
}
Multitoggle.prototype = Object.create(_matrices_base.prototype)