@potatosalad775/eqcaps-device-bridge 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +106 -14
  2. package/dist/browser/webhid.d.ts +2 -2
  3. package/dist/browser/webhid.d.ts.map +1 -1
  4. package/dist/browser/webhid.js +23 -15
  5. package/dist/browser/webhid.js.map +1 -1
  6. package/dist/device.d.ts +49 -6
  7. package/dist/device.d.ts.map +1 -1
  8. package/dist/device.js +92 -18
  9. package/dist/device.js.map +1 -1
  10. package/dist/handler.d.ts +92 -4
  11. package/dist/handler.d.ts.map +1 -1
  12. package/dist/handler.js.map +1 -1
  13. package/dist/handlers/index.d.ts +3 -1
  14. package/dist/handlers/index.d.ts.map +1 -1
  15. package/dist/handlers/index.js +4 -0
  16. package/dist/handlers/index.js.map +1 -1
  17. package/dist/handlers/qudelix-usb-hid.d.ts +20 -13
  18. package/dist/handlers/qudelix-usb-hid.d.ts.map +1 -1
  19. package/dist/handlers/qudelix-usb-hid.js +234 -91
  20. package/dist/handlers/qudelix-usb-hid.js.map +1 -1
  21. package/dist/handlers/qudelix-v2-usb-hid.d.ts +31 -0
  22. package/dist/handlers/qudelix-v2-usb-hid.d.ts.map +1 -0
  23. package/dist/handlers/qudelix-v2-usb-hid.js +276 -0
  24. package/dist/handlers/qudelix-v2-usb-hid.js.map +1 -0
  25. package/dist/handlers/qudelix.d.ts +222 -0
  26. package/dist/handlers/qudelix.d.ts.map +1 -0
  27. package/dist/handlers/qudelix.js +646 -0
  28. package/dist/handlers/qudelix.js.map +1 -0
  29. package/dist/handlers/topping-usb-hid.d.ts +59 -0
  30. package/dist/handlers/topping-usb-hid.d.ts.map +1 -0
  31. package/dist/handlers/topping-usb-hid.js +892 -0
  32. package/dist/handlers/topping-usb-hid.js.map +1 -0
  33. package/dist/index.d.ts +2 -2
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/protocols.d.ts +9 -0
  37. package/dist/protocols.d.ts.map +1 -1
  38. package/dist/protocols.js +82 -33
  39. package/dist/protocols.js.map +1 -1
  40. package/package.json +2 -2
@@ -0,0 +1,276 @@
1
+ // Qudelix 5K Plus over USB HID, as Qudelix's app for Chrome (version 4.0.3.1) drives it: the
2
+ // second protocol, messages of elements sent in acknowledged fragments. The framing, the session
3
+ // and the stored-preset layout are in `qudelix.ts`. Fields are packed least significant bit first,
4
+ // so the multi-byte ones are little-endian.
5
+ //
6
+ // EQ elements of a group, at 0x90 (the user EQ), 0xA0 (the speaker EQ) or 0xB0 (the all-band EQ of
7
+ // single-EQ mode), plus:
8
+ // +0 configuration [version:4, on:1, 11 spare bits, headroom s8, preset index u8]
9
+ // +2 preset attributes: the first 12 bytes of the stored preset, the type bit (1 parametric) first
10
+ // +3 the stored preset
11
+ // +4 preset name [group, custom n, length, 0, UTF-8…]
12
+ // +5 one band [mask:4, type:4, band u8, freq u16, gain s16 ×10, q u16 ×1024]
13
+ // 0x80 is the EQ mode [version:4, mode:4 (0 layered, 1 single-EQ)]; 3 the firmware version
14
+ // [major, minor, revision, …]. A change is a set (0x9004) of one element; the action (0x9006)
15
+ // element 0x30 [group, custom n, 0, 0] saves the working EQ to a custom preset. A request (0x9002)
16
+ // [id, 0]… is answered (0x9003) by those elements. The app takes the mode and the configurations
17
+ // from the opening answer (a layered device's holds 0x90 and 0xA0, no 0xB0) and the notifications
18
+ // (0x9005), and never asks. A change another program makes can go unannounced (a 5K Plus with
19
+ // firmware 1.0.3, 2026-11-21), so every operation here requests the mode, then its EQ's
20
+ // configuration: two requests, since the EQ's element depends on the mode. Only the firmware is
21
+ // taken from the opening answer.
22
+ //
23
+ // The app turns an EQ on by setting its whole configuration, makes it parametric by setting the
24
+ // attributes, and changes its pre-gain by setting the whole stored preset. So a push, with the
25
+ // configuration in hand, requests the preset and sends: the configuration with the switch on; the
26
+ // attributes with the type parametric (not on the speaker EQ, which is parametric only); for a
27
+ // pre-gain, the preset with each channel's; one band element per band and channel mask (on the
28
+ // speaker EQ 3, or with the right channel apart 1 and 2, as the app's channel selector picks
29
+ // them); for a slot, the name (empty: the default "Custom #n") and the save. The codec takes the
30
+ // configuration and the preset as options, so the frames it gives are the frames a push sends.
31
+ import { field, I16, readU16be, U16, U8 } from "../bytes.js";
32
+ import { BridgeError } from "../errors.js";
33
+ import { decimals, sendFrame } from "../io.js";
34
+ import { ACK, ACTION, bandWrites, channelWrites, CUSTOM, customOf, EDITED, elementBytes, elementsOf, filterOf, FIVE_K_PLUS, groupOf, hidOut, maskedChannels, modelFor, packet, PARAMETRIC, presetSize, pullResult, QUDELIX_MODELS, QUDELIX_TYPES, QUDELIX_WIRE, qudelixSession, readPreset, Reassembly, REQ, RSP, sentPacket, SET, struct, withFields, writeBits, writtenState, dropSession } from "./qudelix.js";
35
+ const MODEL = QUDELIX_MODELS[FIVE_K_PLUS];
36
+ /** What the codec assumes without a device: the 5K Plus's report 8 of 127 bytes. */
37
+ const OFFLINE_LINK_V2 = { vendorId: 0x0a12, reportId: 8, reportSize: 127 };
38
+ /** Each group's first element, by group id. */
39
+ const BASE = [0x90, 0xa0, 0xb0];
40
+ const CONFIG = 0;
41
+ const ATTRIBUTES = 2;
42
+ const PRESET = 3;
43
+ const NAME = 4;
44
+ const BAND = 5;
45
+ const EQ_MODE = 0x80;
46
+ const FIRMWARE = 3;
47
+ const SAVE = 0x30;
48
+ const SINGLE = 1;
49
+ const MODE = struct(['version', 4], ['mode', 4], ['', 24]);
50
+ const BAND_ELEMENT = struct(['mask', 4], ['filter', 4], ['band', 8], ['freq', 16], ['gain', 16, 'signed'], ['q', 16]);
51
+ const SMALLEST_PACKET = 40;
52
+ const TIMEOUT = 2000;
53
+ const ACK_TIMEOUT = 1000;
54
+ const ACK_OK = 0;
55
+ /** A message as packets [command, header, slice]: `packetSize - 1` bytes of it in each. */
56
+ export function fragmentsOf(command, message, packetSize) {
57
+ const out = [];
58
+ let at = 0;
59
+ for (let id = 0; id === 0 || at < message.length; id++) {
60
+ const slice = message.slice(at, at + packetSize - 1);
61
+ at += slice.length;
62
+ out.push(packet(command, [(id & 0x1f) | (at >= message.length ? 0x80 : 0), ...slice]));
63
+ }
64
+ return out;
65
+ }
66
+ function target(o) {
67
+ const single = o.device?.single ?? false;
68
+ const group = groupOf(MODEL, o.group ?? 'usr', single);
69
+ const device = o.device ?? {
70
+ link: OFFLINE_LINK_V2,
71
+ packetSize: SMALLEST_PACKET,
72
+ single,
73
+ config: new Uint8Array(4),
74
+ preset: new Uint8Array(presetSize(MODEL, group, group.channels[0]))
75
+ };
76
+ return { device, group, base: BASE[group.id] };
77
+ }
78
+ export const qudelixV2UsbHidCodec = {
79
+ types: QUDELIX_TYPES.types,
80
+ wire: () => QUDELIX_WIRE,
81
+ encode(request, o) {
82
+ const { device, group, base } = target(o);
83
+ const writes = channelWrites(group, group.channels[0], request);
84
+ const messages = [];
85
+ const set = (id, data) => messages.push([SET, elementBytes(id, data)]);
86
+ set(base + CONFIG, withFields(device.config, MODEL.groupConfig, { enable: 1 }));
87
+ // The app's copy of the preset has the parametric type once it sets it.
88
+ const preset = withFields(device.preset, MODEL.preset.head, { type: PARAMETRIC });
89
+ if (group.graphic)
90
+ set(base + ATTRIBUTES, preset.subarray(0, MODEL.preset.head.bits / 8));
91
+ if (writes.some((w) => w.preamp !== undefined)) {
92
+ for (const { mask, preamp } of writes) {
93
+ if (preamp === undefined)
94
+ continue;
95
+ const value = field(preamp, 10, I16, 'preamp');
96
+ for (let ch = 0; ch < MODEL.preset.preGains; ch++) {
97
+ if (mask & (1 << ch))
98
+ writeBits(preset, MODEL.preset.head.bits + 16 * ch, 16, value);
99
+ }
100
+ }
101
+ set(base + PRESET, preset);
102
+ }
103
+ // Bands past the request keep what the device holds (D33).
104
+ for (const { mask, band, filter: f } of bandWrites(writes)) {
105
+ const bytes = new Uint8Array(BAND_ELEMENT.bits / 8);
106
+ BAND_ELEMENT.write(bytes, {
107
+ mask,
108
+ filter: QUDELIX_TYPES.encode(f.type),
109
+ band,
110
+ freq: field(f.freq, 1, U16, 'freq'),
111
+ gain: field(f.gain, 10, I16, 'gain'),
112
+ q: field(f.q, 1024, U16, 'q')
113
+ });
114
+ set(base + BAND, bytes);
115
+ }
116
+ const { slot } = request;
117
+ if (slot !== undefined) {
118
+ const n = customOf(group, slot);
119
+ set(base + NAME, [group.id, n, 0, 0]);
120
+ messages.push([ACTION, elementBytes(SAVE, [group.id, n, 0, 0])]);
121
+ }
122
+ return messages.flatMap(([command, message]) => fragmentsOf(command, message, device.packetSize).map((p) => hidOut(device.link, p)));
123
+ },
124
+ decode(frames, o) {
125
+ const { device, group, base } = target(o);
126
+ const held = [];
127
+ let slot;
128
+ const reassembly = new Reassembly();
129
+ for (const frame of frames) {
130
+ const p = sentPacket(device.link, frame);
131
+ const command = readU16be(p, 0);
132
+ const message = reassembly.push(command, p.subarray(2));
133
+ for (const e of (message && elementsOf(message)) ?? []) {
134
+ if (command === ACTION && e.id === SAVE)
135
+ slot = CUSTOM + e.data[1];
136
+ if (command !== SET)
137
+ continue;
138
+ if (e.id === base + BAND) {
139
+ const b = BAND_ELEMENT.read(e.data);
140
+ for (const ch of maskedChannels(held, b.mask))
141
+ ch.filters[b.band] = filterOf(b);
142
+ }
143
+ else if (e.id === base + PRESET) {
144
+ readPreset(MODEL, group, e.data).forEach(({ preGain }, ch) => {
145
+ maskedChannels(held, 1 << ch)[0].preamp = decimals(preGain / 10, 1);
146
+ });
147
+ }
148
+ }
149
+ }
150
+ const state = writtenState(group, held);
151
+ return slot === undefined ? state : { ...state, slot };
152
+ }
153
+ };
154
+ /** The EQ an operation names (`spk`), or the user EQ. */
155
+ const groupName = (ctx) => (ctx.eq === 'spk' ? 'spk' : 'usr');
156
+ /**
157
+ * Sends fragments, each but the last of a message answered by its ack within 1 s. A missing or
158
+ * bad ack, or a failed send, ends the session, as the app reconnects then.
159
+ */
160
+ async function sendFragments(s, frames) {
161
+ try {
162
+ for (const frame of frames) {
163
+ const header = sentPacket(s.link, frame)[2];
164
+ const id = header & 0x1f;
165
+ if (header & 0x80) {
166
+ await sendFrame(s.transport, frame);
167
+ continue;
168
+ }
169
+ const ack = s.expect((m) => m.command === ACK && m.payload.length === 2, ACK_TIMEOUT, `fragment ${id}`);
170
+ ack.catch(() => { });
171
+ await sendFrame(s.transport, frame);
172
+ const [acked, result] = (await ack).payload;
173
+ if (acked !== id || result !== ACK_OK) {
174
+ throw new BridgeError('rejected', `Qudelix 5K Plus: fragment ${id} got an ack of fragment ${acked} with result ${result}`);
175
+ }
176
+ }
177
+ }
178
+ catch (error) {
179
+ dropSession(s);
180
+ throw error;
181
+ }
182
+ }
183
+ const send = (s, command, message) => sendFragments(s, fragmentsOf(command, message, s.device.packetSize).map((p) => hidOut(s.link, p)));
184
+ /** Elements as the device holds them now: requested, [id, 0] each, and answered. */
185
+ async function fresh(s, ids) {
186
+ for (const id of ids)
187
+ s.elements.delete(id);
188
+ // Only the answer counts. A notification can arrive between the request and its answer,
189
+ // holding the element as an earlier write left it partway: a 5K Plus notifies the whole
190
+ // preset, late, when an edit takes the EQ off a stored preset (seen 2026-11-21).
191
+ const answered = s.expect((m) => m.command === RSP && ids.every((id) => s.elements.has(id)), TIMEOUT, `the request for elements ${ids.map((id) => `0x${id.toString(16)}`).join(', ')}`);
192
+ answered.catch(() => { });
193
+ await send(s, REQ, ids.flatMap((id) => [id, 0]));
194
+ await answered;
195
+ return ids.map((id) => s.elements.get(id));
196
+ }
197
+ /**
198
+ * The 5K Plus's session, the EQ the options name in the device's mode, and that EQ's
199
+ * configuration, both asked for now: another program may have changed them unannounced.
200
+ */
201
+ async function drive(ctx) {
202
+ const s = await qudelixSession(ctx);
203
+ modelFor(s, 2);
204
+ const [mode] = await fresh(s, [EQ_MODE]);
205
+ const single = MODE.read(mode).mode === SINGLE;
206
+ const group = groupOf(MODEL, groupName(ctx), single);
207
+ const base = BASE[group.id];
208
+ const [config] = await fresh(s, [base + CONFIG]);
209
+ return { s, group, single, base, config: config };
210
+ }
211
+ /** The group's stored preset, requested afresh. */
212
+ async function storedPreset(s, group, base) {
213
+ const bytes = (await fresh(s, [base + PRESET]))[0];
214
+ return { bytes, preset: readPreset(MODEL, group, bytes) };
215
+ }
216
+ export const qudelixV2UsbHid = {
217
+ id: 'qudelix-v2-usb-hid',
218
+ transport: 'hid',
219
+ eqs: ['spk'],
220
+ codec: qudelixV2UsbHidCodec,
221
+ capabilities: () => ({
222
+ canRead: true,
223
+ canWrite: true,
224
+ readsPreamp: true,
225
+ readsSlot: false,
226
+ writesPreamp: true,
227
+ writesSlot: true,
228
+ needsBandCount: false,
229
+ readsCurrentSlot: true,
230
+ canEnable: true,
231
+ // The speaker EQ's left and right, as the app's channel selector writes them.
232
+ perChannelEqs: ['spk']
233
+ }),
234
+ async pull(ctx) {
235
+ const { s, group, base, config } = await drive(ctx);
236
+ const { preset } = await storedPreset(s, group, base);
237
+ return pullResult(ctx.log, MODEL, group, preset, MODEL.groupConfig.read(config).preset);
238
+ },
239
+ async push(ctx, request) {
240
+ const { s, group, single, base, config } = await drive(ctx);
241
+ const { bytes } = await storedPreset(s, group, base);
242
+ const frames = qudelixV2UsbHidCodec.encode(request, {
243
+ group: groupName(ctx),
244
+ device: { link: s.link, packetSize: s.device.packetSize, single, config, preset: bytes }
245
+ });
246
+ await sendFragments(s, frames);
247
+ return { reconnect: false };
248
+ },
249
+ async setEnabled(ctx, enabled, slot) {
250
+ const { s, base, config } = await drive(ctx);
251
+ const next = withFields(config, MODEL.groupConfig, {
252
+ enable: enabled ? 1 : 0,
253
+ ...(enabled && slot !== undefined ? { preset: field(slot, 1, U8, 'slot') } : {})
254
+ });
255
+ await send(s, SET, elementBytes(base + CONFIG, next));
256
+ },
257
+ async eqEnabled(ctx) {
258
+ const { config } = await drive(ctx);
259
+ return MODEL.groupConfig.read(config).enable === 1;
260
+ },
261
+ async currentSlot(ctx) {
262
+ const { preset } = MODEL.groupConfig.read((await drive(ctx)).config);
263
+ return preset === EDITED ? null : preset;
264
+ },
265
+ async firmware(ctx) {
266
+ const s = await qudelixSession(ctx);
267
+ modelFor(s, 2);
268
+ // The opening answer carries it, and it doesn't change while the device is open.
269
+ const version = s.elements.get(FIRMWARE) ?? (await fresh(s, [FIRMWARE]))[0];
270
+ return Array.from(version.subarray(0, 3)).join('.');
271
+ },
272
+ async bandCount(ctx) {
273
+ return (await drive(ctx)).group.bands;
274
+ }
275
+ };
276
+ //# sourceMappingURL=qudelix-v2-usb-hid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qudelix-v2-usb-hid.js","sourceRoot":"","sources":["../../src/handlers/qudelix-v2-usb-hid.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,iGAAiG;AACjG,mGAAmG;AACnG,4CAA4C;AAC5C,EAAE;AACF,mGAAmG;AACnG,yBAAyB;AACzB,oFAAoF;AACpF,qGAAqG;AACrG,yBAAyB;AACzB,wDAAwD;AACxD,+EAA+E;AAC/E,2FAA2F;AAC3F,8FAA8F;AAC9F,mGAAmG;AACnG,iGAAiG;AACjG,kGAAkG;AAClG,8FAA8F;AAC9F,wFAAwF;AACxF,gGAAgG;AAChG,iCAAiC;AACjC,EAAE;AACF,gGAAgG;AAChG,+FAA+F;AAC/F,kGAAkG;AAClG,+FAA+F;AAC/F,+FAA+F;AAC/F,6FAA6F;AAC7F,iGAAiG;AACjG,+FAA+F;AAE/F,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EACN,GAAG,EACH,MAAM,EACN,UAAU,EACV,aAAa,EACb,MAAM,EACN,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,EACP,MAAM,EACN,cAA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,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,GAAG;QACpB,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACrE,OAAO,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,GAAG;QACjB,MAAM,CAAC,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;QACpC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACf,iFAAiF;QACjF,MAAM,OAAO,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC;QAC7E,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAG;QAClB,OAAO,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;IACvC,CAAC;CACD,CAAC"}
@@ -0,0 +1,222 @@
1
+ import type { Filter } from '@potatosalad775/eqcaps-core';
2
+ import type { HandlerContext, HidFrame, PullResult, PushRequest, WireGrid, WriteState } from '../handler.ts';
3
+ import type { HidTransport } from '../transport.ts';
4
+ /** Where a device's packets go: its vendor id (which names the framing) and output report. */
5
+ export interface QudelixLink {
6
+ vendorId: number;
7
+ reportId: number;
8
+ /** The output report's size, report id excluded. */
9
+ reportSize: number;
10
+ }
11
+ /** What a codec assumes without a device: a 0x0a12 device's report 8, 63 bytes on a 5K. */
12
+ export declare const OFFLINE_LINK: QudelixLink;
13
+ /** The transport's link. The audio interface, which has no vendor collection, is refused. */
14
+ export declare function linkOf(t: HidTransport): QudelixLink;
15
+ /** `packet` as an output report of `link`, zero-padded to its size. */
16
+ export declare function hidOut(link: QudelixLink, packet: readonly number[]): HidFrame;
17
+ /** The packet an output report of `link` carries. */
18
+ export declare const sentPacket: (link: QudelixLink, frame: HidFrame) => Uint8Array;
19
+ /** A packet: the command, big-endian, and its data. */
20
+ export declare const packet: (command: number, data?: readonly number[]) => number[];
21
+ /** A packed field: its name ('' for padding), width in bits, and whether it is two's complement. */
22
+ type Field<K extends string> = readonly [name: K, bits: number, signed?: 'signed'];
23
+ export declare function readBits(bytes: ArrayLike<number>, at: number, width: number, signed?: boolean): number;
24
+ export declare function writeBits(bytes: Uint8Array, at: number, width: number, value: number): void;
25
+ /** Fields packed one after another, least significant bit first; `at` is a bit offset. */
26
+ export interface Struct<K extends string = string> {
27
+ readonly bits: number;
28
+ has(name: string): boolean;
29
+ read(bytes: ArrayLike<number>, at?: number): Record<K, number>;
30
+ /** Writes the fields named in `values`, leaving the others as they are. */
31
+ write(bytes: Uint8Array, values: Partial<Record<K, number>>, at?: number): void;
32
+ }
33
+ export declare function struct<const K extends string>(...fields: readonly Field<K>[]): Struct<Exclude<K, ''>>;
34
+ /** A copy of `bytes` with some fields of `layout` changed. */
35
+ export declare function withFields<K extends string>(bytes: Uint8Array, layout: Struct<K>, values: Partial<Record<K, number>>): Uint8Array;
36
+ /** The EQ a profile drives: the user EQ or the speaker (headphone) EQ. */
37
+ export type QudelixGroupName = 'usr' | 'spk';
38
+ export interface QudelixGroup {
39
+ /** The group byte: 0 the user EQ, 1 the speaker EQ, 2 the all-band EQ of single-EQ mode. */
40
+ id: 0 | 1 | 2;
41
+ name: string;
42
+ bands: number;
43
+ /** The channel counts the bridge drives. Where there are several, the stored preset says. */
44
+ channels: readonly number[];
45
+ /**
46
+ * Its channels are a left and right pair, which the bridge drives apart (SPEC §9): written
47
+ * together, one frame with both bits, as the app sends them when its channel selector is on
48
+ * both, or one frame each with `right`, as with the selector on one channel; a pull returns
49
+ * both. Else each channel gets its own frame, all alike.
50
+ */
51
+ stereo: boolean;
52
+ /** It may be a graphic EQ (the app's type selector), so a push makes it parametric. */
53
+ graphic: boolean;
54
+ /** Custom presets, from index 22. */
55
+ customs: number;
56
+ /** u16 frequencies stored ahead of the band records; 0 where each record holds its own. */
57
+ freqs: number;
58
+ }
59
+ /** A stored preset: the fields ahead of the pre-gains, the s16 pre-gains, one record per band. */
60
+ export interface PresetLayout {
61
+ /** The T71's says its channel and band counts (`channels`, `bands`). */
62
+ head: Struct;
63
+ preGains: number;
64
+ /** Per channel, then band; holds `freq` where the group stores no frequencies apart. */
65
+ band: Struct;
66
+ }
67
+ export interface QudelixModel {
68
+ name: string;
69
+ protocol: 1 | 2;
70
+ usr: QudelixGroup;
71
+ spk: QudelixGroup;
72
+ /** The one EQ of single-EQ mode, on a model that has the mode. */
73
+ all?: QudelixGroup;
74
+ preset: PresetLayout;
75
+ /** A group's configuration: its switch, headroom and current preset. */
76
+ groupConfig: Struct<'enable' | 'preset'>;
77
+ }
78
+ export declare const FIVE_K = 1;
79
+ export declare const FIVE_K_PLUS = 2;
80
+ export declare const T71 = 256;
81
+ /** By device id. */
82
+ export declare const QUDELIX_MODELS: Readonly<Record<number, QudelixModel>>;
83
+ /**
84
+ * The EQ `name` drives in the device's mode: the user EQ is the all-band EQ in single-EQ mode,
85
+ * which has no speaker EQ.
86
+ */
87
+ export declare function groupOf(model: QudelixModel, name: QudelixGroupName, single: boolean): QudelixGroup;
88
+ /** What a push writes to some of a group's channels: their mask, their bands and pre-gain. */
89
+ export interface ChannelWrite {
90
+ /** 1 << channel; 3 for left and right together. */
91
+ mask: number;
92
+ filters: readonly Filter[];
93
+ /** Left out, the pre-gain isn't written. */
94
+ preamp: number | undefined;
95
+ }
96
+ /**
97
+ * A push's writes, one per channel mask. A left and right pair gets one write for both, or with
98
+ * `right` one each (`right.preamp` left out is `preamp`); any other group one per channel, all
99
+ * alike. Refuses a channel count the bridge doesn't drive, more bands than the group has, and
100
+ * `right` on a group that isn't a pair.
101
+ */
102
+ export declare function channelWrites(group: QudelixGroup, channels: number, { filters, preamp, right }: Pick<PushRequest, 'filters' | 'preamp' | 'right'>): ChannelWrite[];
103
+ /** The band writes of `writes`, in the order they are sent: band by band, each mask in turn. */
104
+ export declare function bandWrites(writes: readonly ChannelWrite[]): {
105
+ mask: number;
106
+ band: number;
107
+ filter: Filter;
108
+ }[];
109
+ /** What a decode has read of each channel of a group, by channel. */
110
+ export type Held = {
111
+ filters: (Filter | null)[];
112
+ preamp?: number;
113
+ }[];
114
+ /** The channels a write's mask names, as `held` keeps them. */
115
+ export declare function maskedChannels(held: Held, mask: number): {
116
+ filters: (Filter | null)[];
117
+ preamp?: number;
118
+ }[];
119
+ /**
120
+ * What a decode returns of `held`: the first channel's, and a pair's right channel where it
121
+ * differs from the left. A frame for left and right together (mask 3) writes them alike.
122
+ */
123
+ export declare function writtenState(group: QudelixGroup, held: Held): Pick<WriteState, 'filters' | 'preamp' | 'right'>;
124
+ export declare const CUSTOM = 22;
125
+ export declare const EDITED = 255;
126
+ export declare const PARAMETRIC = 1;
127
+ /** Which custom preset, from 0, the preset index `slot` is; a built-in or one past the group's is refused. */
128
+ export declare function customOf(group: QudelixGroup, slot: number): number;
129
+ /** Filter codes. 0 is a band switched off (bypass), which reads as no filter. */
130
+ export declare const QUDELIX_TYPES: import("../io.ts").TypeCodes;
131
+ /** The band write's fields: freq u16 Hz, gain s16 ×10, q u16 ×1024; pre-gain s16 ×10. */
132
+ export declare const QUDELIX_WIRE: WireGrid;
133
+ export interface RawBand {
134
+ filter: number;
135
+ freq: number;
136
+ /** ×10 */
137
+ gain: number;
138
+ /** ×1024 */
139
+ q: number;
140
+ }
141
+ export declare function filterOf(b: RawBand): Filter | null;
142
+ /** A stored preset, per channel: the pre-gain (×10) and the bands. */
143
+ export type StoredPreset = {
144
+ preGain: number;
145
+ bands: RawBand[];
146
+ }[];
147
+ export declare function presetSize(model: QudelixModel, group: QudelixGroup, channels: number): number;
148
+ /** Decodes a stored preset of `group`. A channel count the bridge doesn't drive is `unsupported`. */
149
+ export declare function readPreset(model: QudelixModel, group: QudelixGroup, bytes: Uint8Array): StoredPreset;
150
+ /**
151
+ * What a pull returns: the first channel, and a left and right pair's right channel as `right`,
152
+ * equal or not. Another channel of a group that isn't a pair (the T71's five-channel user EQ) that
153
+ * differs from the first is reported through `log`, since a profile has one set of filters.
154
+ */
155
+ export declare function pullResult(log: (message: string) => void, model: QudelixModel, group: QudelixGroup, preset: StoredPreset, index: number): PullResult;
156
+ export declare const INIT_RSP = 36864;
157
+ export declare const ACK = 36865;
158
+ export declare const REQ = 36866;
159
+ export declare const RSP = 36867;
160
+ export declare const SET = 36868;
161
+ export declare const NOTI = 36869;
162
+ export declare const ACTION = 36870;
163
+ export interface Element {
164
+ id: number;
165
+ data: Uint8Array;
166
+ }
167
+ /** The elements of a message; null when one runs past its end. */
168
+ export declare function elementsOf(payload: Uint8Array): Element[] | null;
169
+ /** One element's bytes, its data zero-padded to whole words. */
170
+ export declare function elementBytes(id: number, data: ArrayLike<number>): number[];
171
+ /**
172
+ * Second-protocol packets back into messages, as the app reassembles them: one message at a time,
173
+ * and a fragment out of order, repeated or of another command drops it.
174
+ */
175
+ export declare class Reassembly {
176
+ #private;
177
+ /** One packet's [header, slice…]; the message once its fragments are all in. */
178
+ push(command: number, body: Uint8Array): Uint8Array | undefined;
179
+ }
180
+ export interface QudelixMessage {
181
+ command: number;
182
+ payload: Uint8Array;
183
+ }
184
+ export interface QudelixDevice {
185
+ id: number;
186
+ model: QudelixModel | undefined;
187
+ /** [major, minor, revision], from the first protocol's opening answer. */
188
+ firmware: [number, number, number] | null;
189
+ /** The second protocol's packet size, 40 to 120. */
190
+ packetSize: number;
191
+ }
192
+ /** A transport's open session: one input listener, which reassembles and dispatches messages. */
193
+ export declare class QudelixSession {
194
+ #private;
195
+ readonly transport: HidTransport;
196
+ readonly link: QudelixLink;
197
+ device: QudelixDevice;
198
+ /** The second protocol's elements, latest first: the opening answer, answers, notifications. */
199
+ readonly elements: Map<number, Uint8Array<ArrayBufferLike>>;
200
+ constructor(transport: HidTransport, link: QudelixLink);
201
+ /** Waits until 20 ms pass without input, as the app does before it opens a device. */
202
+ drain(sleep: (ms: number) => Promise<void>): Promise<void>;
203
+ /** The device the opening answer describes. */
204
+ opened(m: QudelixMessage): void;
205
+ /** The first message `match` accepts within `timeoutMs`. Call it before sending the request. */
206
+ expect(match: (m: QudelixMessage) => boolean, timeoutMs: number, what: string): Promise<QudelixMessage>;
207
+ /** Sends `packet` and waits for the answer `match` accepts. */
208
+ ask(data: readonly number[], match: (m: QudelixMessage) => boolean, timeoutMs: number, what: string): Promise<QudelixMessage>;
209
+ send(data: readonly number[]): Promise<void>;
210
+ close(): void;
211
+ }
212
+ /**
213
+ * The transport's session, opened on first use. One that fails to open is forgotten, so the next
214
+ * operation opens it again.
215
+ */
216
+ export declare function qudelixSession(ctx: HandlerContext<HidTransport, unknown>): Promise<QudelixSession>;
217
+ /** Closes and forgets a session, as the app reconnects after a failed transfer. */
218
+ export declare function dropSession(session: QudelixSession): void;
219
+ /** Refuses a device the handler doesn't drive, naming the handler that does. */
220
+ export declare function modelFor(session: QudelixSession, protocol: 1 | 2): QudelixModel;
221
+ export {};
222
+ //# sourceMappingURL=qudelix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qudelix.d.ts","sourceRoot":"","sources":["../../src/handlers/qudelix.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAG1D,OAAO,KAAK,EACX,cAAc,EACd,QAAQ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