Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function updateNotes (touches, e, ignoreNotes) {
var rects = self.rectangles;
var notes = self.notes;
var noteEls = self.noteElements;
touches = slice(touches);
//save last touches as active
activeTouches = touches;
//FIXME: Safari doesn't know what's that
// var notesOff = new Set(self.activeNotes);
var notesOff = new Set();
self.activeNotes.forEach(function (note) {
notesOff.add(note);
});
var notesOn = new Set();
var blackTouches = new Set();
//for all notes - find ones to turn on and ones to turn off
for (var i = 0; i < notes.length; i++) {
workerIpc.on('log', function() {
// eslint-disable-next-line prefer-rest-params
debugElectronLog.apply(debugElectronLog, sliced(arguments));
});
}
workerIpc.on('page-log', function() {
// eslint-disable-next-line prefer-rest-params
let newArgs = sliced(arguments),
windowId = newArgs.splice(0, 1);
newArgs.unshift(`console log from browser window [${windowId}]:`);
debugPage.apply(debugPage, newArgs);
});
noteOff (note) {
var self = this, keyEl;
if (self.isBlocked) return self;
//disable all active notes
if (note === undefined) {
self.activeNotes.forEach(self.noteOff, self);
return self;
}
if (isArray(note)) {
slice(note).forEach(function (note, i) {
self.noteOff(note);
});
return self;
}
note = self.parseNote(note);
if (note === undefined) {
return self;
}
var keyEl = self.element.querySelector('[data-key="' + note + '"]');
if (!keyEl) {
// throw Error(key.getName(note) + ' does not exist');
return self;
noteOn (note, value) {
var self = this;
if (self.isBlocked) return self;
if (value === undefined) {
value = 127;
}
if (isArray(note)) {
slice(note).forEach(function (note, i) {
self.noteOn(note, value[i] !== undefined ? value[i] : value );
});
return self;
}
note = self.parseNote(note);
if (note === undefined) {
return self;
}
var keyEl = self.element.querySelector('[data-key="' + note + '"]');
if (!keyEl) {
// throw Error(key.getName(note) + ' does not exist');
return;
childIpc.on('log', function() {
// eslint-disable-next-line prefer-rest-params
debugElectronLog.apply(debugElectronLog, sliced(arguments));
});