From 93fa58a12884998260a2bb91cb3858d5533113d1 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 14 Mar 2023 14:00:21 +0100 Subject: [PATCH] Pass Uint8Arrays to TraktorS3.incomingData As suggested in https://github.com/mixxxdj/mixxx/pull/11199#discussion_r1133314678. The function does accept both typed arrays and plain arrays. --- res/controllers/Traktor-Kontrol-S3-hid-scripts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/res/controllers/Traktor-Kontrol-S3-hid-scripts.js b/res/controllers/Traktor-Kontrol-S3-hid-scripts.js index 68b3ae99b70..ee1d26202f2 100644 --- a/res/controllers/Traktor-Kontrol-S3-hid-scripts.js +++ b/res/controllers/Traktor-Kontrol-S3-hid-scripts.js @@ -292,8 +292,8 @@ TraktorS3.Controller = class { // with different values once. Report 2 contains the state of the mixer // controls. const report2Values = new Uint8Array(controller.getInputReport(2)); - TraktorS3.incomingData([2, ...Array.from(report2Values.map(x => ~x))]); - TraktorS3.incomingData([2, ...Array.from(report2Values)]); + TraktorS3.incomingData(new Uint8Array([2, ...Uint8Array.from(report2Values.map(x => ~x))])); + TraktorS3.incomingData(new Uint8Array([2, ...Uint8Array.from(report2Values)])); // Report 1 is the state of the deck controls. These shouldn't have any // initial effect, and most of these values will be 0 anyways. We'll