Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.4' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed May 11, 2023
2 parents 4e91c8a + 98d70c6 commit 92f1414
Show file tree
Hide file tree
Showing 21 changed files with 907 additions and 231 deletions.
246 changes: 228 additions & 18 deletions CHANGELOG.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/library/hiddentablemodel.cpp
src/library/itunes/itunesdao.cpp
src/library/itunes/itunesfeature.cpp
src/library/itunes/itunesplaylistmodel.cpp
src/library/itunes/itunesxmlimporter.cpp
src/library/library_prefs.cpp
src/library/library.cpp
Expand Down
6 changes: 6 additions & 0 deletions packaging/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
mixxx (2.3.4-1~bionic) bionic; urgency=medium

* Build of 2.3.4

-- RJ Skerry-Ryan <rryan@mixxx.org> Fri, 03 Mar 2023 15:00:16 +0000

mixxx (2.3.3-1~bionic) bionic; urgency=medium

* Build of 2.3.3
Expand Down
22 changes: 20 additions & 2 deletions res/controllers/common-hid-packet-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@
this.HIDDebug = function(message) {
console.log(`HID ${message}`);
};
/**
* creates a `DataView` from any ArrayBuffer, TypedArray
* or plain Array (clamped to 8-bit width).
*
* @param {number[] | ArrayBuffer | TypedArray} bufferLike Object that can be represented as a sequence of bytes
* @returns {DataView} dataview over the bufferLike object
*/
const createDataView = function(bufferLike) {
return new DataView((() => {
if (Array.isArray(bufferLike)) {
return new Uint8ClampedArray(bufferLike).buffer;
} else if (ArrayBuffer.isView(bufferLike)) {
return bufferLike.buffer;
} else {
return bufferLike;
}
})());
};

/**
* Callback function to call when, the packet represents an HID InputReport, and new data for this
Expand Down Expand Up @@ -413,7 +431,7 @@ class HIDPacket {
return;
}

const dataView = new DataView(data.buffer);
const dataView = createDataView(data);
switch (field.pack) {
case "b":
dataView.setInt8(field.offset, value);
Expand Down Expand Up @@ -453,7 +471,7 @@ class HIDPacket {
* @returns {number} Value for the field in data, represented according the fields packing type
*/
unpack(data, field) {
const dataView = new DataView(data.buffer);
const dataView = createDataView(data);
switch (field.pack) {
case "b":
return dataView.getInt8(field.offset);
Expand Down
Loading

0 comments on commit 92f1414

Please sign in to comment.