noUIslider modded to limit it move rate (cpu friendly)
This commit is contained in:
parent
93259e9c60
commit
6596f7e5a0
7 changed files with 36 additions and 13 deletions
|
|
@ -1,5 +1,5 @@
|
|||
nmPorts = {
|
||||
'MainMix':'localhost:6666',
|
||||
'MainMix':'SCSon:6666',
|
||||
'Drums':'SCSon:6667',
|
||||
'Basses':'SCSon:6668',
|
||||
'Guitars':'SCSon:6669',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/*! noUiSlider - 7.0.3 - 2014-09-11 16:30:11 */
|
||||
|
||||
/* With rate mod @ 1561 (Jean-Emmanuel Doucet) */
|
||||
|
||||
(function(){
|
||||
|
||||
'use strict';
|
||||
|
|
@ -19,6 +20,8 @@ var
|
|||
'undo'
|
||||
];
|
||||
|
||||
|
||||
|
||||
// General
|
||||
|
||||
// Reverse a string
|
||||
|
|
@ -1555,9 +1558,26 @@ function closure ( target, options, originalOptions ){
|
|||
callback ( e, data );
|
||||
});
|
||||
}
|
||||
|
||||
// BIG FAT & UGLY MOD
|
||||
// Limit move's rate for better performances
|
||||
// It skips events, but we don't need that much precision here
|
||||
function move (event, data) {
|
||||
window.now = +new Date;
|
||||
|
||||
if (window.last && window.now - window.last > 30) {
|
||||
window.last = window.now;
|
||||
moveP(event, data);
|
||||
} else if (!window.last) {
|
||||
// first call
|
||||
window.last = window.now;
|
||||
moveP(event, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Handle movement on document for handle and range drag.
|
||||
function move ( event, data ) {
|
||||
function moveP ( event, data ) {
|
||||
|
||||
var handles = data.handles || $Handles, positions, state = false,
|
||||
proposal = ((event.calcPoint - data.start) * 100) / baseSize(),
|
||||
|
|
@ -1576,6 +1596,7 @@ function closure ( target, options, originalOptions ){
|
|||
if ( state ) {
|
||||
fireEvents(['slide']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Unbind move events on document, call callbacks.
|
||||
|
|
|
|||
|
|
@ -347,12 +347,10 @@ loadPreset = function(preset){
|
|||
var data = d.split(':')
|
||||
setTimeout(function(){
|
||||
if (data[0] == 'fader') {
|
||||
__faders__[data[1]].val(data[2]).trigger('set')
|
||||
|
||||
__faders__[data[1]].val(data[2]).trigger('set')
|
||||
}
|
||||
if (data[0] == 'button') {
|
||||
__buttons__[data[1]].val(data[2])
|
||||
|
||||
}
|
||||
},i)
|
||||
})
|
||||
|
|
@ -360,11 +358,20 @@ loadPreset = function(preset){
|
|||
}
|
||||
|
||||
receiveOsc = function(argsPack){
|
||||
|
||||
argsPack = argsPack.split(',')
|
||||
|
||||
// fetch id
|
||||
var id = $('[path="'+argsPack[0]+'"]').attr('widgetId');
|
||||
|
||||
// lock
|
||||
$('[path="'+argsPack[0]+'"]').addClass('locked');
|
||||
|
||||
// update
|
||||
if (__faders__[id]!=undefined) __faders__[id].val(argsPack.pop())
|
||||
if (__buttons__[id]!=undefined) __buttons__[id].val(argsPack.pop(),false)
|
||||
|
||||
//unlock
|
||||
$('[path="'+argsPack[0]+'"]').removeClass('locked');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -168,13 +168,10 @@ class oscHtmlGui(object):
|
|||
self.async_gtk_msg(self.browser.execute_script)('alert("'+error+'")')
|
||||
|
||||
def async_gtk_msg(self, fun):
|
||||
|
||||
def worker((function, args, kwargs)):
|
||||
apply(function, args, kwargs)
|
||||
|
||||
def fun2(*args, **kwargs):
|
||||
gobject.idle_add(worker, (fun, args, kwargs))
|
||||
|
||||
return fun2
|
||||
|
||||
@_liblo.make_method(None, None)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -170,7 +170,7 @@ a.on, a:active {
|
|||
position:relative;
|
||||
font-size:13px;
|
||||
border:1px solid rgba(0,0,0,0.2);
|
||||
padding:33px 0;
|
||||
padding:35px 0;
|
||||
width:100px;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
fader:Bassess:4.89
|
||||
fader:Drums:0.00
|
||||
fader:Basses:-40.16
|
||||
fader:Guitars:0.00
|
||||
|
|
@ -52,5 +51,4 @@ fader:FX_Vx_Dag_1:0.00
|
|||
fader:FX_Vx_Dag_2:0.00
|
||||
fader:FX_Vx_Dag:0.00
|
||||
fader:Scape_Vx_Dag:0.00
|
||||
fader:Vx_Jeannot:0.00
|
||||
button:button1:0
|
||||
fader:Vx_Jeannot:0.00
|
||||
Loading…
Add table
Add a link
Reference in a new issue