From 581e6b9ddcb3e7643a1c93864abceac33f617fc2 Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Sun, 14 May 2023 00:32:38 +0200 Subject: [PATCH] Test with typescript output --- requirements.txt | 1 + source/chapters/advanced_topics.rst | 5 + source/chapters/controller_api/.nojekyll | 1 + .../classes/color_mapper_api.ColorMapper.md | 84 + .../common_hid_packet_parser.HIDBitVector.md | 134 ++ .../common_hid_packet_parser.HIDController.md | 1422 +++++++++++++++++ ...ommon_hid_packet_parser.HIDModifierList.md | 156 ++ .../common_hid_packet_parser.HIDPacket.md | 570 +++++++ .../common_hid_packet_parser.bitObject.md | 185 +++ .../common_hid_packet_parser.packetField.md | 291 ++++ .../interfaces/engine_api.ScriptConnection.md | 53 + source/chapters/controller_api/modules.md | 14 + .../modules/color_mapper_api.md | 9 + .../modules/common_hid_packet_parser.md | 231 +++ .../modules/console_api.console.md | 344 ++++ .../controller_api/modules/console_api.md | 9 + .../modules/engine_api.engine.md | 692 ++++++++ .../controller_api/modules/engine_api.md | 13 + .../modules/hid_controller_api.controller.md | 163 ++ .../modules/hid_controller_api.md | 9 + .../modules/midi_controller_api.md | 9 + .../modules/midi_controller_api.midi.md | 86 + 22 files changed, 4481 insertions(+) create mode 100644 source/chapters/controller_api/.nojekyll create mode 100644 source/chapters/controller_api/classes/color_mapper_api.ColorMapper.md create mode 100644 source/chapters/controller_api/classes/common_hid_packet_parser.HIDBitVector.md create mode 100644 source/chapters/controller_api/classes/common_hid_packet_parser.HIDController.md create mode 100644 source/chapters/controller_api/classes/common_hid_packet_parser.HIDModifierList.md create mode 100644 source/chapters/controller_api/classes/common_hid_packet_parser.HIDPacket.md create mode 100644 source/chapters/controller_api/interfaces/common_hid_packet_parser.bitObject.md create mode 100644 source/chapters/controller_api/interfaces/common_hid_packet_parser.packetField.md create mode 100644 source/chapters/controller_api/interfaces/engine_api.ScriptConnection.md create mode 100644 source/chapters/controller_api/modules.md create mode 100644 source/chapters/controller_api/modules/color_mapper_api.md create mode 100644 source/chapters/controller_api/modules/common_hid_packet_parser.md create mode 100644 source/chapters/controller_api/modules/console_api.console.md create mode 100644 source/chapters/controller_api/modules/console_api.md create mode 100644 source/chapters/controller_api/modules/engine_api.engine.md create mode 100644 source/chapters/controller_api/modules/engine_api.md create mode 100644 source/chapters/controller_api/modules/hid_controller_api.controller.md create mode 100644 source/chapters/controller_api/modules/hid_controller_api.md create mode 100644 source/chapters/controller_api/modules/midi_controller_api.md create mode 100644 source/chapters/controller_api/modules/midi_controller_api.midi.md diff --git a/requirements.txt b/requirements.txt index 57b8716673..6c3e08f2dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,3 +8,4 @@ sphinxcontrib-svg2pdfconverter sphinx-rtd-theme==0.5.2 sphinx-multiversion==0.2.1 ./sphinx-mixxx +myst_parser \ No newline at end of file diff --git a/source/chapters/advanced_topics.rst b/source/chapters/advanced_topics.rst index 96c5051866..c9c5c9f8cd 100644 --- a/source/chapters/advanced_topics.rst +++ b/source/chapters/advanced_topics.rst @@ -21,6 +21,11 @@ You can download and share custom controller mappings in the For a list of controls that can be used in a controller mapping, see :ref:`appendix-mixxxcontrols`. +Controller API documentation +---------------------------- + +.. include:: ./controller_api/modules.md + .. _advanced-controller-wizard: diff --git a/source/chapters/controller_api/.nojekyll b/source/chapters/controller_api/.nojekyll new file mode 100644 index 0000000000..e2ac6616ad --- /dev/null +++ b/source/chapters/controller_api/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/source/chapters/controller_api/classes/color_mapper_api.ColorMapper.md b/source/chapters/controller_api/classes/color_mapper_api.ColorMapper.md new file mode 100644 index 0000000000..6b75f2aa58 --- /dev/null +++ b/source/chapters/controller_api/classes/color_mapper_api.ColorMapper.md @@ -0,0 +1,84 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [color-mapper-api](../modules/color_mapper_api.md) / ColorMapper + +# Class: ColorMapper + +[color-mapper-api](../modules/color_mapper_api.md).ColorMapper + +ColorMapperJSProxy + +## Table of contents + +### Constructors + +- [constructor](color_mapper_api.ColorMapper.md#constructor) + +### Methods + +- [getNearestColor](color_mapper_api.ColorMapper.md#getnearestcolor) +- [getValueForNearestColor](color_mapper_api.ColorMapper.md#getvaluefornearestcolor) + +## Constructors + +### constructor + +• **new ColorMapper**(`availableColors`) + +Constructs a ColorMapper object which maps RGB colors to device specific color codes + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `availableColors` | `Object` | List of number pairs (e.g. {0xFF0000: 1, 0x00FF00: 2} ) | + +#### Defined in + +[color-mapper-api.d.ts:10](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/color-mapper-api.d.ts#L10) + +## Methods + +### getNearestColor + +▸ **getNearestColor**(`colorCode`): `Object` + +For a given RGB color code (e.g. 0xFF0000), this finds the nearest +available color and returns a JS object with properties "red", "green", +"blue" (each with value range 0-255). + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `colorCode` | `number` | Device specific color code | + +#### Returns + +`Object` + +#### Defined in + +[color-mapper-api.d.ts:19](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/color-mapper-api.d.ts#L19) + +___ + +### getValueForNearestColor + +▸ **getValueForNearestColor**(`rgbColor`): `number` + +For a given RGB color code (e.g. 0xFF0000), this finds the nearest +available color, then returns the value associated with that color +(which could be a MIDI byte value for example). + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `rgbColor` | `number` | RGB color (e.g. 0xFF00CC) | + +#### Returns + +`number` + +#### Defined in + +[color-mapper-api.d.ts:28](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/color-mapper-api.d.ts#L28) diff --git a/source/chapters/controller_api/classes/common_hid_packet_parser.HIDBitVector.md b/source/chapters/controller_api/classes/common_hid_packet_parser.HIDBitVector.md new file mode 100644 index 0000000000..388a77349e --- /dev/null +++ b/source/chapters/controller_api/classes/common_hid_packet_parser.HIDBitVector.md @@ -0,0 +1,134 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [common-hid-packet-parser](../modules/common_hid_packet_parser.md) / HIDBitVector + +# Class: HIDBitVector + +[common-hid-packet-parser](../modules/common_hid_packet_parser.md).HIDBitVector + +HID Bit Vector Class + +Collection of bits in one parsed packet field. These objects are +created by HIDPacket addControl and addOutput and should not be +created manually. + +## Table of contents + +### Constructors + +- [constructor](common_hid_packet_parser.HIDBitVector.md#constructor) + +### Properties + +- [bits](common_hid_packet_parser.HIDBitVector.md#bits) +- [size](common_hid_packet_parser.HIDBitVector.md#size) + +### Methods + +- [addBitMask](common_hid_packet_parser.HIDBitVector.md#addbitmask) +- [addOutputMask](common_hid_packet_parser.HIDBitVector.md#addoutputmask) +- [getOffset](common_hid_packet_parser.HIDBitVector.md#getoffset) + +## Constructors + +### constructor + +• **new HIDBitVector**() + +#### Defined in + +[common-hid-packet-parser.js:153](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L153) + +## Properties + +### bits + +• **bits**: `Object` + +Object of bitObjects, referred by a string of group and control name separated by a dot + +#### Defined in + +[common-hid-packet-parser.js:165](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L165) + +___ + +### size + +• **size**: `number` + +Number of bitObjects in bits array + +#### Defined in + +[common-hid-packet-parser.js:159](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L159) + +## Methods + +### addBitMask + +▸ **addBitMask**(`group`, `name`, `bitmask`): `void` + +Add a control bitmask to the HIDBitVector + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name e.g. "play" | +| `bitmask` | `number` | A bitwise mask of up to 32 bit. All bits set to'1' in this mask are considered. | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:192](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L192) + +___ + +### addOutputMask + +▸ **addOutputMask**(`group`, `name`, `bitmask`): `void` + +Add an output control bitmask to the HIDBitVector + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name e.g. "play" | +| `bitmask` | `number` | A bitwise mask of up to 32 bit. All bits set to'1' in this mask are considered. | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:218](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L218) + +___ + +### getOffset + +▸ **getOffset**(`bitmask`): `number` + +Get the index of the least significant bit that is 1 in `bitmask` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bitmask` | `number` | A bitwise mask of up to 32 bit. All bits set to'1' in this mask are considered. | + +#### Returns + +`number` + +Index of the least significant bit that is 1 in `bitmask` + +#### Defined in + +[common-hid-packet-parser.js:174](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L174) diff --git a/source/chapters/controller_api/classes/common_hid_packet_parser.HIDController.md b/source/chapters/controller_api/classes/common_hid_packet_parser.HIDController.md new file mode 100644 index 0000000000..76fe63d936 --- /dev/null +++ b/source/chapters/controller_api/classes/common_hid_packet_parser.HIDController.md @@ -0,0 +1,1422 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [common-hid-packet-parser](../modules/common_hid_packet_parser.md) / HIDController + +# Class: HIDController + +[common-hid-packet-parser](../modules/common_hid_packet_parser.md).HIDController + +HID Controller Class with packet parser + +## Table of contents + +### Constructors + +- [constructor](common_hid_packet_parser.HIDController.md#constructor) + +### Properties + +- [InputPackets](common_hid_packet_parser.HIDController.md#inputpackets) +- [LEDColors](common_hid_packet_parser.HIDController.md#ledcolors) +- [OutputFieldLookup](common_hid_packet_parser.HIDController.md#outputfieldlookup) +- [OutputPackets](common_hid_packet_parser.HIDController.md#outputpackets) +- [OutputUpdateInterval](common_hid_packet_parser.HIDController.md#outputupdateinterval) +- [activeDeck](common_hid_packet_parser.HIDController.md#activedeck) +- [auto\_repeat\_interval](common_hid_packet_parser.HIDController.md#auto_repeat_interval) +- [buttonStates](common_hid_packet_parser.HIDController.md#buttonstates) +- [connectDeck](common_hid_packet_parser.HIDController.md#connectdeck) +- [deckOutputColors](common_hid_packet_parser.HIDController.md#deckoutputcolors) +- [deckSwitchMap](common_hid_packet_parser.HIDController.md#deckswitchmap) +- [defaultPacket](common_hid_packet_parser.HIDController.md#defaultpacket) +- [disconnectDeck](common_hid_packet_parser.HIDController.md#disconnectdeck) +- [enableScratchCallback](common_hid_packet_parser.HIDController.md#enablescratchcallback) +- [initialized](common_hid_packet_parser.HIDController.md#initialized) +- [isScratchEnabled](common_hid_packet_parser.HIDController.md#isscratchenabled) +- [modifiers](common_hid_packet_parser.HIDController.md#modifiers) +- [postProcessDelta](common_hid_packet_parser.HIDController.md#postprocessdelta) +- [processDelta](common_hid_packet_parser.HIDController.md#processdelta) +- [scalers](common_hid_packet_parser.HIDController.md#scalers) +- [scratchAlpha](common_hid_packet_parser.HIDController.md#scratchalpha) +- [scratchBeta](common_hid_packet_parser.HIDController.md#scratchbeta) +- [scratchRPM](common_hid_packet_parser.HIDController.md#scratchrpm) +- [scratchRampOnDisable](common_hid_packet_parser.HIDController.md#scratchrampondisable) +- [scratchRampOnEnable](common_hid_packet_parser.HIDController.md#scratchramponenable) +- [scratchintervalsPerRev](common_hid_packet_parser.HIDController.md#scratchintervalsperrev) +- [timers](common_hid_packet_parser.HIDController.md#timers) +- [toggleButtons](common_hid_packet_parser.HIDController.md#togglebuttons) +- [valid\_groups](common_hid_packet_parser.HIDController.md#valid_groups) +- [virtualDecks](common_hid_packet_parser.HIDController.md#virtualdecks) + +### Methods + +- [autorepeatTimer](common_hid_packet_parser.HIDController.md#autorepeattimer) +- [close](common_hid_packet_parser.HIDController.md#close) +- [enableScratch](common_hid_packet_parser.HIDController.md#enablescratch) +- [getActiveFieldControl](common_hid_packet_parser.HIDController.md#getactivefieldcontrol) +- [getActiveFieldGroup](common_hid_packet_parser.HIDController.md#getactivefieldgroup) +- [getInputPacket](common_hid_packet_parser.HIDController.md#getinputpacket) +- [getOutputField](common_hid_packet_parser.HIDController.md#getoutputfield) +- [getOutputPacket](common_hid_packet_parser.HIDController.md#getoutputpacket) +- [getScaler](common_hid_packet_parser.HIDController.md#getscaler) +- [jog\_wheel](common_hid_packet_parser.HIDController.md#jog_wheel) +- [linkControl](common_hid_packet_parser.HIDController.md#linkcontrol) +- [linkModifier](common_hid_packet_parser.HIDController.md#linkmodifier) +- [linkOutput](common_hid_packet_parser.HIDController.md#linkoutput) +- [parsePacket](common_hid_packet_parser.HIDController.md#parsepacket) +- [processButton](common_hid_packet_parser.HIDController.md#processbutton) +- [processControl](common_hid_packet_parser.HIDController.md#processcontrol) +- [processIncomingPacket](common_hid_packet_parser.HIDController.md#processincomingpacket) +- [registerInputPacket](common_hid_packet_parser.HIDController.md#registerinputpacket) +- [registerOutputPacket](common_hid_packet_parser.HIDController.md#registeroutputpacket) +- [resolveDeck](common_hid_packet_parser.HIDController.md#resolvedeck) +- [resolveDeckGroup](common_hid_packet_parser.HIDController.md#resolvedeckgroup) +- [resolveGroup](common_hid_packet_parser.HIDController.md#resolvegroup) +- [setAutoRepeat](common_hid_packet_parser.HIDController.md#setautorepeat) +- [setCallback](common_hid_packet_parser.HIDController.md#setcallback) +- [setOutput](common_hid_packet_parser.HIDController.md#setoutput) +- [setOutputToggle](common_hid_packet_parser.HIDController.md#setoutputtoggle) +- [setPacketCallback](common_hid_packet_parser.HIDController.md#setpacketcallback) +- [setScaler](common_hid_packet_parser.HIDController.md#setscaler) +- [stopAutoRepeatTimer](common_hid_packet_parser.HIDController.md#stopautorepeattimer) +- [switchDeck](common_hid_packet_parser.HIDController.md#switchdeck) +- [toggle](common_hid_packet_parser.HIDController.md#toggle) +- [togglePlay](common_hid_packet_parser.HIDController.md#toggleplay) +- [unlinkControl](common_hid_packet_parser.HIDController.md#unlinkcontrol) +- [unlinkModifier](common_hid_packet_parser.HIDController.md#unlinkmodifier) +- [unlinkOutput](common_hid_packet_parser.HIDController.md#unlinkoutput) +- [fastForIn](common_hid_packet_parser.HIDController.md#fastforin) + +## Constructors + +### constructor + +• **new HIDController**() + +#### Defined in + +[common-hid-packet-parser.js:1134](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1134) + +## Properties + +### InputPackets + +• **InputPackets**: `Object` + +HIDPackets representing HID InputReports, by packet name + +#### Defined in + +[common-hid-packet-parser.js:1154](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1154) + +___ + +### LEDColors + +• **LEDColors**: `Object` + +List of named output colors to send +- must contain 'off' value + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `off` | `number` | +| `on` | `number` | + +#### Defined in + +[common-hid-packet-parser.js:1258](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1258) + +___ + +### OutputFieldLookup + +• **OutputFieldLookup**: `Map`<`string`, [`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md) \| [`packetField`](../interfaces/common_hid_packet_parser.packetField.md)\> + +A map to determine the output Bit or bytewise field by group and name, +across all OutputPackets + +#### Defined in + +[common-hid-packet-parser.js:1169](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1169) + +___ + +### OutputPackets + +• **OutputPackets**: `Object` + +HIDPackets representing HID OutputReports, by packet name + +#### Defined in + +[common-hid-packet-parser.js:1161](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1161) + +___ + +### OutputUpdateInterval + +• **OutputUpdateInterval**: `number` + +Set to value in ms to update Outputs periodically +- By default undefined. +- If set, it's a value for timer executed every n ms to update Outputs with updateOutputs() + +**`Deprecated`** + +This is unused and updateOutputs() doesn't exist - Remove? + +#### Defined in + +[common-hid-packet-parser.js:1335](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1335) + +___ + +### activeDeck + +• **activeDeck**: `number` + +#### Defined in + +[common-hid-packet-parser.js:1147](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1147) + +[common-hid-packet-parser.js:2246](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2246) + +___ + +### auto\_repeat\_interval + +• **auto\_repeat\_interval**: `number` + +Auto repeat interval default for fields, where not specified individual (in milliseconds) + +**`Default`** + +100 + +#### Defined in + +[common-hid-packet-parser.js:1366](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1366) + +___ + +### buttonStates + +• **buttonStates**: `Object` + +List of valid state values for buttons, should contain fields: +- 'released' (default 0) +- 'pressed' (default 1) + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `pressed` | `number` | +| `released` | `number` | + +#### Defined in + +[common-hid-packet-parser.js:1252](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1252) + +___ + +### connectDeck + +• **connectDeck**: `any` + +#### Defined in + +[common-hid-packet-parser.js:1181](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1181) + +___ + +### deckOutputColors + +• **deckOutputColors**: `Object` + +List of colors to use for each deck +- Default is 'on' for first four decks. + +Override to set specific colors for multicolor button output per deck: +- Values are like {1: 'red', 2: 'green' } and must reference valid OutputColors fields. + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `1` | `string` | +| `2` | `string` | +| `3` | `string` | +| `4` | `string` | + +#### Defined in + +[common-hid-packet-parser.js:1278](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1278) + +___ + +### deckSwitchMap + +• **deckSwitchMap**: `Object` + +Mapping of automatic deck switching with switchDeck function + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `1` | `number` | +| `2` | `number` | +| `3` | `number` | +| `4` | `number` | +| `undefined` | `number` | + +#### Defined in + +[common-hid-packet-parser.js:1291](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1291) + +___ + +### defaultPacket + +• **defaultPacket**: `string` + +Default input packet name: can be modified for controllers +which can swap modes (wiimote for example) + +#### Defined in + +[common-hid-packet-parser.js:1177](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1177) + +___ + +### disconnectDeck + +• **disconnectDeck**: `any` + +#### Defined in + +[common-hid-packet-parser.js:1180](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1180) + +___ + +### enableScratchCallback + +• **enableScratchCallback**: [`scratchingCallback`](../modules/common_hid_packet_parser.md#scratchingcallback) + +Callback function to call when, jog wheel scratching got enabled or disabled + +#### Defined in + +[common-hid-packet-parser.js:1245](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1245) + +___ + +### initialized + +• **initialized**: `boolean` + +- By default 'false' +- Should be set 'true', when controller is found and everything is OK + +#### Defined in + +[common-hid-packet-parser.js:1142](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1142) + +___ + +### isScratchEnabled + +• **isScratchEnabled**: `boolean` + +Set to true, when button 'jog_touch' is active + +#### Defined in + +[common-hid-packet-parser.js:1190](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1190) + +[common-hid-packet-parser.js:2027](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2027) + +[common-hid-packet-parser.js:2039](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2039) + +___ + +### modifiers + +• **modifiers**: [`HIDModifierList`](common_hid_packet_parser.HIDModifierList.md) + +Reference to HIDModifierList object + +#### Defined in + +[common-hid-packet-parser.js:1342](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1342) + +___ + +### postProcessDelta + +• **postProcessDelta**: [`packetCallback`](../modules/common_hid_packet_parser.md#packetcallback) + +Callback that is executed after parsing incoming packet +(see Traktor-Kontrol-F1-scripts.js for an example) + +#### Defined in + +[common-hid-packet-parser.js:1381](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1381) + +___ + +### processDelta + +• **processDelta**: [`packetCallback`](../modules/common_hid_packet_parser.md#packetcallback) + +**`Deprecated`** + +Use [postProcessDelta](common_hid_packet_parser.HIDController.md#postprocessdelta) instead +(not used in any official mapping) + +#### Defined in + +[common-hid-packet-parser.js:1373](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1373) + +___ + +### scalers + +• **scalers**: `Object` + +Object of scaling function callbacks by name + +#### Defined in + +[common-hid-packet-parser.js:1349](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1349) + +___ + +### scratchAlpha + +• **scratchAlpha**: `number` + +The alpha coefficient of the filter +- Default is 1/8 (0.125) - start tune from there + +#### Defined in + +[common-hid-packet-parser.js:1214](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1214) + +___ + +### scratchBeta + +• **scratchBeta**: `number` + +The beta coefficient of the filter +- Default is scratchAlpha/32 - start tune from there + +#### Defined in + +[common-hid-packet-parser.js:1222](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1222) + +___ + +### scratchRPM + +• **scratchRPM**: `number` + +The speed of the imaginary record at 0% pitch - in revolutions per minute (RPM) +- Default 33+1/3 - adjust for comfort + +#### Defined in + +[common-hid-packet-parser.js:1206](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1206) + +___ + +### scratchRampOnDisable + +• **scratchRampOnDisable**: `boolean` + +- Set 'true' to ramp the deck speed up. +- Set 'false' to jump to normal play speed instantly (default) + +#### Defined in + +[common-hid-packet-parser.js:1238](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1238) + +___ + +### scratchRampOnEnable + +• **scratchRampOnEnable**: `boolean` + +- Set 'true' to ramp the deck speed down. +- Set 'false' to stop instantly (default) + +#### Defined in + +[common-hid-packet-parser.js:1230](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1230) + +___ + +### scratchintervalsPerRev + +• **scratchintervalsPerRev**: `number` + +The resolution of the jogwheel HID control (in intervals per revolution) +- Default is 128 + +#### Defined in + +[common-hid-packet-parser.js:1198](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1198) + +___ + +### timers + +• **timers**: `Object` + +Object of engine timer IDs of running auto repeat timers +Key is a user specified timer_id. +Used only in the controller.startAutoRepeatTimer code stubs of Sony-SixxAxis.js and Nintendo-Wiimote.js. + +#### Defined in + +[common-hid-packet-parser.js:1358](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1358) + +___ + +### toggleButtons + +• **toggleButtons**: `string`[] + +List of button names you wish to act as 'toggle' + +i.e. pressing the button and releasing toggles state of the control and doesn't set it off again when released. + +#### Defined in + +[common-hid-packet-parser.js:1265](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1265) + +___ + +### valid\_groups + +• **valid\_groups**: `string`[] + +Standard target groups available in mixxx. + +This is used by HID packet parser to recognize group parameters we should try sending to mixxx. + +#### Defined in + +[common-hid-packet-parser.js:1300](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1300) + +___ + +### virtualDecks + +• **virtualDecks**: `string`[] + +Used to map the virtual deck names 'deck', 'deck1' or 'deck2' to actual [ChannelX] + +#### Defined in + +[common-hid-packet-parser.js:1286](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1286) + +## Methods + +### autorepeatTimer + +▸ **autorepeatTimer**(): `void` + +Callback for auto repeat timer to send again the values for +buttons and controls marked as 'auto_repeat' +Timer must be defined from actual controller side, because of +callback call namespaces and 'this' reference + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2147](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2147) + +___ + +### close + +▸ **close**(): `void` + +Function to close the controller object cleanly + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1385](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1385) + +___ + +### enableScratch + +▸ **enableScratch**(`group`, `status`): `void` + +Processing of the 'jog_touch' special button name, which is used to detect +when scratching should be enabled. +Deck is resolved from group with 'resolveDeck' + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `status` | `boolean` | Enable or Disable scratching: - true enables scratching (press 'jog_touch' button) Sets the internal 'isScratchEnabled' attribute to true, and calls scratchEnable with the scratch attributes (see class definition) - false disables scratching (release 'jog_touch' button) Sets the internal 'isScratchEnabled attribute to false, and calls scratchDisable to end scratching mode | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2024](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2024) + +___ + +### getActiveFieldControl + +▸ **getActiveFieldControl**(`field`): `string` + +Get active control name from field + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `field` | [`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md) \| [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) | Object that describes a field inside of a packet, which can often mapped to a Mixxx control. | + +#### Returns + +`string` + +Name of field + +#### Defined in + +[common-hid-packet-parser.js:1843](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1843) + +___ + +### getActiveFieldGroup + +▸ **getActiveFieldGroup**(`field`): `string` + +Get active group for this field + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `field` | [`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md) \| [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) | Object that describes a field inside of a packet, which can often mapped to a Mixxx control. | + +#### Returns + +`string` + +Group + +#### Defined in + +[common-hid-packet-parser.js:1820](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1820) + +___ + +### getInputPacket + +▸ **getInputPacket**(`name`): [`HIDPacket`](common_hid_packet_parser.HIDPacket.md) + +Find input packet matching given name. +Returns undefined if input packet name is not registered. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | Name of packet (it makes sense to refer the HID report type and HID Report-ID here e.g. 'InputReport_0x02') | + +#### Returns + +[`HIDPacket`](common_hid_packet_parser.HIDPacket.md) + +The input packet + +#### Defined in + +[common-hid-packet-parser.js:1475](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1475) + +___ + +### getOutputField + +▸ **getOutputField**(`m_group`, `m_name`): [`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md) \| [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) + +Find Output control matching give group and name + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `m_group` | `string` | Mapped group, must be a valid Mixxx control group name e.g. "[Channel1]" | +| `m_name` | `string` | Name of mapped control, must be a valid Mixxx control name "VuMeter" | + +#### Returns + +[`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md) \| [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) + +Bit or bytewise field - Returns undefined if output field + can't be found. + +#### Defined in + +[common-hid-packet-parser.js:1464](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1464) + +___ + +### getOutputPacket + +▸ **getOutputPacket**(`name`): [`HIDPacket`](common_hid_packet_parser.HIDPacket.md) + +Find output packet matching given name +Returns undefined if output packet name is not registered. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | Name of packet (it makes sense to refer the HID report type and HID Report-ID here e.g. 'OutputReport_0x81') | + +#### Returns + +[`HIDPacket`](common_hid_packet_parser.HIDPacket.md) + +The output packet + +#### Defined in + +[common-hid-packet-parser.js:1489](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1489) + +___ + +### getScaler + +▸ **getScaler**(`name`, `_callback?`): [`scalingCallback`](../modules/common_hid_packet_parser.md#scalingcallback) + +Lookup scaling function for control + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `name` | `string` | `undefined` | Reference of the scaling function in scalers list of HIDController | +| `_callback` | `any` | `undefined` | Unused | + +#### Returns + +[`scalingCallback`](../modules/common_hid_packet_parser.md#scalingcallback) + +Scaling function. Returns undefined if function is not + registered. + +#### Defined in + +[common-hid-packet-parser.js:1544](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1544) + +___ + +### jog\_wheel + +▸ **jog_wheel**(`field`): `void` + +Default jog scratching function. Used to handle jog move events from special +input control field called 'jog_wheel'. Handles both 'scratch' and 'jog' mixxx +functions, depending on isScratchEnabled value above (see enableScratch()) + +Since most controllers require value scaling for jog and scratch functions, +you are warned if following scaling function names are not registered: + +jog + Scaling function from 'jog_wheel' for rate bend events with mixxx 'jog' + function. Should return value range suitable for 'jog', whatever you + wish it to do. +jog_scratch + Scaling function from 'jog_wheel' for scratch movements with mixxx + 'scratchTick' function. Should return -1,0,1 or small ranges of integers + both negative and positive values. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `field` | [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) | Object that describes a field inside of a packet, which can often mapped to a Mixxx control. | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2066](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2066) + +___ + +### linkControl + +▸ **linkControl**(`group`, `name`, `m_group`, `m_name`, `callback`): `void` + +Link a previously declared HID control to actual mixxx control + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name | +| `name` | `string` | Control name | +| `m_group` | `string` | Mapped group, must be a valid Mixxx control group name e.g. "[Channel1]" | +| `m_name` | `string` | Name of mapped control, must be a valid Mixxx control name "pregain" | +| `callback` | [`fieldChangeCallback`](../modules/common_hid_packet_parser.md#fieldchangecallback) | Callback function for the control | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1593](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1593) + +___ + +### linkModifier + +▸ **linkModifier**(`group`, `name`, `modifier`): `void` + +Change type of a previously defined field to modifier and register it + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name | +| `modifier` | `string` | Name of the modifier e.g. 'shiftbutton' | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1557](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1557) + +___ + +### linkOutput + +▸ **linkOutput**(`group`, `name`, `m_group`, `m_name`, `callback`): `void` + +Link a virtual HID Output to mixxx control + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name | +| `name` | `string` | Control name | +| `m_group` | `string` | Mapped group, must be a valid Mixxx control group name e.g. "[Channel1]" | +| `m_name` | `string` | Name of mapped control, must be a valid Mixxx control name "VuMeter" | +| `callback` | [`controlCallback`](../modules/common_hid_packet_parser.md#controlcallback) | Callback function for the control | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2260](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2260) + +___ + +### parsePacket + +▸ **parsePacket**(`data`, `length`): `void` + +Parse a packet representing an HID InputReport, and processes each field with "unpack": + - Calls packet callback and returns, if packet callback was defined + - Calls processIncomingPacket and processes automated events there. + - If defined, calls postProcessDelta for results after processing automated fields + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `Uint8Array` | The data received from an HID InputReport. In case of HID devices, which use ReportIDs to enumerate the reports, the ReportID is stored in the first byte and the data start at the second byte | +| `length` | `number` | Length of the data array in bytes | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1713](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1713) + +___ + +### processButton + +▸ **processButton**(`field`): `void` + +Process given button field, triggering events + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `field` | [`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md) | Object that describes a field inside of a packet, which can often mapped to a Mixxx control. | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1856](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1856) + +___ + +### processControl + +▸ **processControl**(`field`): `void` + +Process given control field, triggering events + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `field` | [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) | Object that describes a field inside of a packet, which can often mapped to a Mixxx control. | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1927](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1927) + +___ + +### processIncomingPacket + +▸ **processIncomingPacket**(`packet`, `delta`): `void` + +Process the modified field values (delta) from input packet fields for +input control packet, if packet name is in this.defaultPacket. + +Button (Boolean value) field processing: +- Sets modifiers from buttons +- Calls button callbacks, if defined +- Finally tries to run matching engine.setValue() function for buttons + in default mixxx groups, honoring toggleButtons and other button + details. Not done if a callback was defined for button. + +Control (Numeric value) field processing +- Calls scaling functions for control fields, if defined for field. + Scaling function for encoders (isEncoder attribute is true) scales + field delta instead of raw value. +- Calls callback functions for control fields, if defined for field +- Finally tries run matching engine.setValue() function for control + fields in default mixxx groups. Not done if a callback was defined. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `packet` | `any` | Unused | +| `delta` | `Object` | | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1790](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1790) + +___ + +### registerInputPacket + +▸ **registerInputPacket**(`packet`): `void` + +Register HID input packet type to controller. +Input packets can be responses from device to queries, or control +data details. The default control data packet must be named in +variable this.defaultPacket to allow automatic processing. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `packet` | [`HIDPacket`](common_hid_packet_parser.HIDPacket.md) | The input packet to register | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1637](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1637) + +___ + +### registerOutputPacket + +▸ **registerOutputPacket**(`packet`): `void` + +Register HID output packet type to controller +There are no special Output control output packets, just register Outputs to any +valid packet and we detect them here. +This module only supports sending bitvector values and byte fields to device. +If you need other data structures, patches are welcome, or you can just do it +manually in your script without registering the packet. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `packet` | [`HIDPacket`](common_hid_packet_parser.HIDPacket.md) | The output packet to register | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1671](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1671) + +___ + +### resolveDeck + +▸ **resolveDeck**(`group`): `number` + +Return deck number from deck name. Deck name can't be virtual deck name +in this function call. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | + +#### Returns + +`number` + +Number of deck + +#### Defined in + +[common-hid-packet-parser.js:1402](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1402) + +___ + +### resolveDeckGroup + +▸ **resolveDeckGroup**(`deck`): `string` + +Return the group name from given deck number. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `deck` | `number` | Number of deck | + +#### Returns + +`string` + +Group name of the deck (e.g. Channel2 for deck number 2) + +#### Defined in + +[common-hid-packet-parser.js:1419](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1419) + +___ + +### resolveGroup + +▸ **resolveGroup**(`group`): `string` + +Map virtual deck names to real deck group. If group is already +a real mixxx group value, just return it as it without mapping. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | + +#### Returns + +`string` + +Channel + +#### Defined in + +[common-hid-packet-parser.js:1432](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1432) + +___ + +### setAutoRepeat + +▸ **setAutoRepeat**(`group`, `name`, `callback`, `interval`): `void` + +Toggle field autorepeat on or off + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | | +| `name` | `string` | | +| `callback` | [`fieldChangeCallback`](../modules/common_hid_packet_parser.md#fieldchangecallback) | Callback function for the control | +| `interval` | `number` | | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2124](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2124) + +___ + +### setCallback + +▸ **setCallback**(`packet`, `group`, `name`, `callback`): `void` + +Register packet field's callback. +If packet has callback, it is still parsed but no field processing is done, +callback is called directly after unpacking fields from packet. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `packet` | `string` | The name of the input packet e.g. 'InputReport_0x02' | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name "pregain" | +| `callback` | [`fieldChangeCallback`](../modules/common_hid_packet_parser.md#fieldchangecallback) | Callback function for the control | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1515](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1515) + +___ + +### setOutput + +▸ **setOutput**(`group`, `name`, `value`, `send_packet?`): `void` + +Set output state to given value + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name "cue_indicator" | +| `value` | `number` \| `boolean` | Value to set as new output state of the control | +| `send_packet?` | `boolean` | If true, the packet (an HID OutputReport) is send immediately | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2313](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2313) + +___ + +### setOutputToggle + +▸ **setOutputToggle**(`group`, `name`, `toggle_value`): `void` + +Set Output to toggle between two values. Reset with setOutput(name,'off') + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name "cue_indicator" | +| `toggle_value` | `any` | | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2332](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2332) + +___ + +### setPacketCallback + +▸ **setPacketCallback**(`packet`, `callback`): `void` + +Set input packet callback afterwards + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `packet` | `string` | The name of the input packet e.g. 'InputReport_0x02' | +| `callback` | [`packetCallback`](../modules/common_hid_packet_parser.md#packetcallback) | Callback function for the control | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1501](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1501) + +___ + +### setScaler + +▸ **setScaler**(`name`, `callback`): `void` + +Register scaling function for a control name +This does not check if given control name is valid + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | Reference of the scaling function in scalers list of HIDController | +| `callback` | [`scalingCallback`](../modules/common_hid_packet_parser.md#scalingcallback) | Scaling function | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1530](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1530) + +___ + +### stopAutoRepeatTimer + +▸ **stopAutoRepeatTimer**(`timer_id`): `void` + +Stops the specified auto repeat timer + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `timer_id` | `string` | Reference of the timer to stop | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2108](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2108) + +___ + +### switchDeck + +▸ **switchDeck**(`deck`): `void` + +Toggle active deck and update virtual output field control mappings + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `deck` | `number` | Number of deck | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2173](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2173) + +___ + +### toggle + +▸ **toggle**(`group`, `control`, `value`): `void` + +Toggle control state from toggle button + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `control` | `string` | Name of the control (button) | +| `value` | `number` | Value defined in this.buttonStates | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1984](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1984) + +___ + +### togglePlay + +▸ **togglePlay**(`group`, `field`): `void` + +Toggle play/pause state + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `field` | [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) | Object that describes a field inside of a packet, which can often mapped to a Mixxx control. | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1998](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1998) + +___ + +### unlinkControl + +▸ **unlinkControl**(`_group`, `_name`): `void` + +**`Todo`** + +Implement unlinking of controls + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `_group` | `string` | Mixxx control group name e.g. "[Channel1]" | +| `_name` | `string` | Mixxx control name "pregain" | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1628](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1628) + +___ + +### unlinkModifier + +▸ **unlinkModifier**(`_group`, `_name`, `_modifier`): `void` + +**`Todo`** + +Implement unlinking of modifiers + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `_group` | `string` | Unused | +| `_name` | `string` | Unused | +| `_modifier` | `string` | Unused | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1580](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1580) + +___ + +### unlinkOutput + +▸ **unlinkOutput**(`group`, `name`, `callback`): `void` + +Unlink a virtual HID Output from mixxx control + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Mixxx control group name e.g. "[Channel1]" | +| `name` | `string` | Mixxx control name "VuMeter" | +| `callback` | [`controlCallback`](../modules/common_hid_packet_parser.md#controlcallback) | Callback function for the control | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2288](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2288) + +___ + +### fastForIn + +▸ `Static` **fastForIn**(`object`, `body`): `void` + +Fast loop implementation over object + +Don't use 'continue' and 'break' don't work as in normal loops, +because body is a function +'return' statements in the body function behaves as 'continue' in normal loops + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `object` | `Object` | +| `body` | (`arg0`: `string`) => `void` | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:2352](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L2352) diff --git a/source/chapters/controller_api/classes/common_hid_packet_parser.HIDModifierList.md b/source/chapters/controller_api/classes/common_hid_packet_parser.HIDModifierList.md new file mode 100644 index 0000000000..d345dbc98b --- /dev/null +++ b/source/chapters/controller_api/classes/common_hid_packet_parser.HIDModifierList.md @@ -0,0 +1,156 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [common-hid-packet-parser](../modules/common_hid_packet_parser.md) / HIDModifierList + +# Class: HIDModifierList + +[common-hid-packet-parser](../modules/common_hid_packet_parser.md).HIDModifierList + +HID Modifiers object + +e.g. a shift button can be defined as modifier for the behavior of other controls. + +Wraps all defined modifiers to one object with uniform API. +Don't call directly, this is available as HIDController.modifiers + +## Table of contents + +### Constructors + +- [constructor](common_hid_packet_parser.HIDModifierList.md#constructor) + +### Properties + +- [callbacks](common_hid_packet_parser.HIDModifierList.md#callbacks) +- [modifiers](common_hid_packet_parser.HIDModifierList.md#modifiers) + +### Methods + +- [add](common_hid_packet_parser.HIDModifierList.md#add) +- [get](common_hid_packet_parser.HIDModifierList.md#get) +- [set](common_hid_packet_parser.HIDModifierList.md#set) +- [setCallback](common_hid_packet_parser.HIDModifierList.md#setcallback) + +## Constructors + +### constructor + +• **new HIDModifierList**() + +#### Defined in + +[common-hid-packet-parser.js:251](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L251) + +## Properties + +### callbacks + +• **callbacks**: `Object` + +Function to be called after modifier value changes + +#### Defined in + +[common-hid-packet-parser.js:264](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L264) + +___ + +### modifiers + +• **modifiers**: `Object` + +Actual value of the modifier + +#### Defined in + +[common-hid-packet-parser.js:257](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L257) + +## Methods + +### add + +▸ **add**(`name`): `void` + +Add a new modifier to controller. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | Name of modifier | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:271](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L271) + +___ + +### get + +▸ **get**(`name`): `boolean` + +Get modifier value + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | Name of modifier | + +#### Returns + +`boolean` + +Value of modifier + +#### Defined in + +[common-hid-packet-parser.js:301](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L301) + +___ + +### set + +▸ **set**(`name`, `value`): `void` + +Set modifier value + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | Name of modifier | +| `value` | `boolean` | Value to be set | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:284](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L284) + +___ + +### setCallback + +▸ **setCallback**(`name`, `callback`): `void` + +Set modifier callback function + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | Name of reference in HIDModifierList | +| `callback` | [`modifierCallback`](../modules/common_hid_packet_parser.md#modifiercallback) | Function to be called after modifier value changes | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:314](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L314) diff --git a/source/chapters/controller_api/classes/common_hid_packet_parser.HIDPacket.md b/source/chapters/controller_api/classes/common_hid_packet_parser.HIDPacket.md new file mode 100644 index 0000000000..9caf662022 --- /dev/null +++ b/source/chapters/controller_api/classes/common_hid_packet_parser.HIDPacket.md @@ -0,0 +1,570 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [common-hid-packet-parser](../modules/common_hid_packet_parser.md) / HIDPacket + +# Class: HIDPacket + +[common-hid-packet-parser](../modules/common_hid_packet_parser.md).HIDPacket + +HID Packet object + +An HIDPacket represents one HID report of type InputReport or OutputReport (FeatureReports are +currently not supported) + +Each HIDPacket must be registered to HIDController. + +## Table of contents + +### Constructors + +- [constructor](common_hid_packet_parser.HIDPacket.md#constructor) + +### Properties + +- [callback](common_hid_packet_parser.HIDPacket.md#callback) +- [groups](common_hid_packet_parser.HIDPacket.md#groups) +- [header](common_hid_packet_parser.HIDPacket.md#header) +- [length](common_hid_packet_parser.HIDPacket.md#length) +- [name](common_hid_packet_parser.HIDPacket.md#name) +- [packSizes](common_hid_packet_parser.HIDPacket.md#packsizes) +- [reportId](common_hid_packet_parser.HIDPacket.md#reportid) +- [signedPackFormats](common_hid_packet_parser.HIDPacket.md#signedpackformats) + +### Methods + +- [addControl](common_hid_packet_parser.HIDPacket.md#addcontrol) +- [addOutput](common_hid_packet_parser.HIDPacket.md#addoutput) +- [getField](common_hid_packet_parser.HIDPacket.md#getfield) +- [getFieldByOffset](common_hid_packet_parser.HIDPacket.md#getfieldbyoffset) +- [getGroup](common_hid_packet_parser.HIDPacket.md#getgroup) +- [lookupBit](common_hid_packet_parser.HIDPacket.md#lookupbit) +- [pack](common_hid_packet_parser.HIDPacket.md#pack) +- [parse](common_hid_packet_parser.HIDPacket.md#parse) +- [parseBitVector](common_hid_packet_parser.HIDPacket.md#parsebitvector) +- [removeControl](common_hid_packet_parser.HIDPacket.md#removecontrol) +- [send](common_hid_packet_parser.HIDPacket.md#send) +- [setCallback](common_hid_packet_parser.HIDPacket.md#setcallback) +- [setIgnored](common_hid_packet_parser.HIDPacket.md#setignored) +- [setMinDelta](common_hid_packet_parser.HIDPacket.md#setmindelta) +- [unpack](common_hid_packet_parser.HIDPacket.md#unpack) + +## Constructors + +### constructor + +• **new HIDPacket**(`name`, `reportId?`, `callback?`, `header?`) + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `name` | `string` | `undefined` | Name of packet (it makes sense to refer the HID report type and HID ReportID here e.g. 'InputReport_0x02' or 'OutputReport_0x81') | +| `reportId` | `number` | `0` | ReportID of the packet. If the device does not use ReportIDs this must be 0. [default = 0] | +| `callback` | [`packetCallback`](../modules/common_hid_packet_parser.md#packetcallback) | `undefined` | function to call when the packet type represents an InputReport, and a new report is received. If packet callback is set, the packet is not parsed by delta functions. Note, that a callback is not meaningful for output packets. | +| `header` | `number`[] | `[]` | (optional) List of bytes to match from beginning of packet. Do NOT put the report ID in this - use the reportId parameter instead. | + +#### Defined in + +[common-hid-packet-parser.js:348](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L348) + +## Properties + +### callback + +• **callback**: [`packetCallback`](../modules/common_hid_packet_parser.md#packetcallback) + +Function to call when the packet type represents an InputReport, and a new report is received. + +#### Defined in + +[common-hid-packet-parser.js:368](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L368) + +___ + +### groups + +• **groups**: `Object` + +Object of groups, referred by the group string + +#### Defined in + +[common-hid-packet-parser.js:382](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L382) + +[common-hid-packet-parser.js:504](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L504) + +___ + +### header + +• **header**: `number`[] + +List of bytes to match from beginning of packet + +#### Defined in + +[common-hid-packet-parser.js:375](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L375) + +___ + +### length + +• **length**: `number` + +Length of packet in bytes + +#### Defined in + +[common-hid-packet-parser.js:389](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L389) + +[common-hid-packet-parser.js:843](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L843) + +[common-hid-packet-parser.js:891](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L891) + +___ + +### name + +• **name**: `string` + +Name of packet + +#### Defined in + +[common-hid-packet-parser.js:354](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L354) + +___ + +### packSizes + +• **packSizes**: `Object` + +Size of the 'pack' types in bytes + +#### Defined in + +[common-hid-packet-parser.js:396](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L396) + +___ + +### reportId + +• **reportId**: `number` + +ReportID of the packet. If the device does not use ReportIDs this must be 0. + +#### Defined in + +[common-hid-packet-parser.js:361](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L361) + +___ + +### signedPackFormats + +• **signedPackFormats**: `string`[] + +#### Defined in + +[common-hid-packet-parser.js:397](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L397) + +## Methods + +### addControl + +▸ **addControl**(`group`, `name`, `offset`, `pack`, `bitmask`, `isEncoder`, `callback`): `void` + +Register a numeric value to parse from input packet + +'group' and 'name' form the ID of the field, if it matches a valid Mixxx control name, +the system attempts to attach it directly to the correct field. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name e.g. "play" | +| `offset` | `number` | The field's offset from the start of the packet in bytes: - For HID devices which don't use ReportIDs, the data bytes starts at position 0 - For HID devices which use ReportIDs to enumerate the reports, the data bytes starts at position 1 | +| `pack` | `string` | Is one of the field packing types: - b signed byte (Int8) - B unsigned byte (Uint8) - h signed short (Int16 Little-Endian) - H unsigned short (Uint16 Little-Endian) - i signed integer (Int32 Little-Endian) - I unsigned integer (Uint32 Little-Endian) | +| `bitmask` | `number` | A bitwise mask of up to 32 bit. All bits set to'1' in this mask are considered. Note: For controls that use full bytes (8bit, 16bit, ...), you can set this to undefined NOTE: Parsing bitmask with multiple bits is not supported yet. | +| `isEncoder` | `boolean` | indicates if this is an encoder which should be wrapped and delta reported | +| `callback` | [`fieldChangeCallback`](../modules/common_hid_packet_parser.md#fieldchangecallback) | Callback function for the control | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:678](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L678) + +___ + +### addOutput + +▸ **addOutput**(`group`, `name`, `offset`, `pack`, `bitmask?`, `callback?`): `void` + +Register a Output control field or Output control bit to output packet +Output control field: + Output field with no bitmask, controls Output with multiple values +Output control bit: + Output with with bitmask, controls Output with a single bit + +It is recommended to define callbacks after packet creation with +setCallback instead of adding it directly here. But you can do it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name "VuMeter" | +| `offset` | `number` | The field's offset from the start of the packet in bytes: - For HID devices which don't use ReportIDs, the data bytes starts at position 0 - For HID devices which use ReportIDs to enumerate the reports, the data bytes starts at position 1 | +| `pack` | `string` | Is one of the field packing types: - b signed byte (Int8) - B unsigned byte (Uint8) - h signed short (Int16 Little-Endian) - H unsigned short (Uint16 Little-Endian) - i signed integer (Int32 Little-Endian) - I unsigned integer (Uint32 Little-Endian) | +| `bitmask?` | `number` | A bitwise mask of up to 32 bit. All bits set to'1' in this mask are considered. | +| `callback?` | [`fieldChangeCallback`](../modules/common_hid_packet_parser.md#fieldchangecallback) | Callback function for the control | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:814](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L814) + +___ + +### getField + +▸ **getField**(`group`, `name`): [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) + +Return a field by group and name from the packet, +Returns undefined if field could not be found + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name e.g. "play" | + +#### Returns + +[`packetField`](../interfaces/common_hid_packet_parser.packetField.md) + +Field + +#### Defined in + +[common-hid-packet-parser.js:573](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L573) + +___ + +### getFieldByOffset + +▸ **getFieldByOffset**(`offset`, `pack`): [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) + +Lookup HID packet field matching given offset and pack type + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `offset` | `number` | The field's offset from the start of the packet in bytes: - For HID devices which don't use ReportIDs, the data bytes starts at position 0 - For HID devices which use ReportIDs to enumerate the reports, the data bytes starts at position 1 | +| `pack` | `string` | Is one of the field packing types: - b signed byte (Int8) - B unsigned byte (Uint8) - h signed short (Int16 Little-Endian) - H unsigned short (Uint16 Little-Endian) - i signed integer (Int32 Little-Endian) - I unsigned integer (Uint32 Little-Endian) | + +#### Returns + +[`packetField`](../interfaces/common_hid_packet_parser.packetField.md) + +Returns matching field or undefined if no matching field can be found. + +#### Defined in + +[common-hid-packet-parser.js:532](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L532) + +___ + +### getGroup + +▸ **getGroup**(`name`, `create?`): `any` + +Find HID packet group matching name. +Create group if create is true + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | Name of the group | +| `create?` | `boolean` | If true, group will be created | + +#### Returns + +`any` + +Group Returns group or undefined, when group is not existing and create is set + to false + +#### Defined in + +[common-hid-packet-parser.js:502](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L502) + +___ + +### lookupBit + +▸ **lookupBit**(`group`, `name`): [`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md) + +Return reference to a bit in a bitvector field + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name e.g. "play" | + +#### Returns + +[`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md) + +Reference to a bit in a bitvector field + +#### Defined in + +[common-hid-packet-parser.js:611](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L611) + +___ + +### pack + +▸ **pack**(`data`, `field`): `void` + +Pack a field value to the packet. +Can only pack bits and byte values, patches welcome. + +**`Todo`** + +Implement multi byte bit vector outputs + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `Uint8Array` | Data to be send as OutputReport to the device | +| `field` | [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) | Object that describes a field inside of a packet, which can often mapped to a Mixxx control. | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:409](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L409) + +___ + +### parse + +▸ **parse**(`data`): `Object` + +Parse input packet fields from data. +Data is expected to be a Packet() received from HID device. +BitVectors are returned as bits you can iterate separately. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `Uint8Array` | Data received as InputReport from the device | + +#### Returns + +`Object` + +List of changed fields with new value. + +#### Defined in + +[common-hid-packet-parser.js:1007](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1007) + +___ + +### parseBitVector + +▸ **parseBitVector**(`field`, `value`): `Object` + +Parse bitvector field values, returning object with the named bits set. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `field` | [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) | Object that describes a field inside of a packet, which can often mapped to a Mixxx control. | +| `value` | `number` | Value must be a valid unsigned byte to parse, with enough bits. | + +#### Returns + +`Object` + +List of modified bits (delta), + referred by a string of group and control name separated by a dot + +#### Defined in + +[common-hid-packet-parser.js:974](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L974) + +___ + +### removeControl + +▸ **removeControl**(`group`, `name`): `void` + +Remove a control registered. Normally not needed + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name e.g. "play" | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:642](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L642) + +___ + +### send + +▸ **send**(`debug?`): `void` + +Send this HID packet to device. +First the header bytes are copied to beginning of packet, then +field object values are packed to the HID packet according to the +field type. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `debug?` | `boolean` | Enables debug output to console | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:1089](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L1089) + +___ + +### setCallback + +▸ **setCallback**(`group`, `name`, `callback`): `void` + +Register a callback to field or a bit vector bit. +Does not make sense for Output fields but you can do that. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name e.g. "play" | +| `callback` | [`fieldChangeCallback`](../modules/common_hid_packet_parser.md#fieldchangecallback) | Callback function for the control | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:902](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L902) + +___ + +### setIgnored + +▸ **setIgnored**(`group`, `name`, `ignored`): `void` + +This function can be set in script code to ignore a field you don't want to be processed but +still wanted to define, to make packet format complete from specifications. If field is +ignored, it is not reported in 'delta' objects. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name "pregain" | +| `ignored` | `boolean` | 'ignored' flag for field to given value (true or false) | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:937](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L937) + +___ + +### setMinDelta + +▸ **setMinDelta**(`group`, `name`, `mindelta`): `void` + +Adjust field's minimum delta value. +Input value changes smaller than this are not reported in delta + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name "pregain" | +| `mindelta` | `number` | Minimum delta value. | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:953](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L953) + +___ + +### unpack + +▸ **unpack**(`data`, `field`): `number` + +Parse and return field value matching the 'pack' field from field attributes. +Valid field packing types are: + - b signed byte + - B unsigned byte + - h signed short + - H unsigned short + - i signed integer + - I unsigned integer + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `Uint8Array` | Data received as InputReport from the device | +| `field` | [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) | Object that describes a field inside of a packet, which can often mapped to a Mixxx control. | + +#### Returns + +`number` + +Value for the field in data, represented according the fields packing type + +#### Defined in + +[common-hid-packet-parser.js:473](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L473) diff --git a/source/chapters/controller_api/interfaces/common_hid_packet_parser.bitObject.md b/source/chapters/controller_api/interfaces/common_hid_packet_parser.bitObject.md new file mode 100644 index 0000000000..f3255c5f75 --- /dev/null +++ b/source/chapters/controller_api/interfaces/common_hid_packet_parser.bitObject.md @@ -0,0 +1,185 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [common-hid-packet-parser](../modules/common_hid_packet_parser.md) / bitObject + +# Interface: bitObject<\> + +[common-hid-packet-parser](../modules/common_hid_packet_parser.md).bitObject + +## Table of contents + +### Properties + +- [auto\_repeat](common_hid_packet_parser.bitObject.md#auto_repeat) +- [auto\_repeat\_interval](common_hid_packet_parser.bitObject.md#auto_repeat_interval) +- [bit\_offset](common_hid_packet_parser.bitObject.md#bit_offset) +- [bitmask](common_hid_packet_parser.bitObject.md#bitmask) +- [callback](common_hid_packet_parser.bitObject.md#callback) +- [group](common_hid_packet_parser.bitObject.md#group) +- [id](common_hid_packet_parser.bitObject.md#id) +- [mapped\_callback](common_hid_packet_parser.bitObject.md#mapped_callback) +- [mapped\_group](common_hid_packet_parser.bitObject.md#mapped_group) +- [mapped\_name](common_hid_packet_parser.bitObject.md#mapped_name) +- [name](common_hid_packet_parser.bitObject.md#name) +- [packet](common_hid_packet_parser.bitObject.md#packet) +- [toggle](common_hid_packet_parser.bitObject.md#toggle) +- [type](common_hid_packet_parser.bitObject.md#type) +- [value](common_hid_packet_parser.bitObject.md#value) + +## Properties + +### auto\_repeat + +• **auto\_repeat**: [`fieldChangeCallback`](../modules/common_hid_packet_parser.md#fieldchangecallback) + +#### Defined in + +[common-hid-packet-parser.js:135](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L135) + +___ + +### auto\_repeat\_interval + +• **auto\_repeat\_interval**: `number` + +#### Defined in + +[common-hid-packet-parser.js:136](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L136) + +___ + +### bit\_offset + +• **bit\_offset**: `number` + +#### Defined in + +[common-hid-packet-parser.js:133](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L133) + +___ + +### bitmask + +• **bitmask**: `number` + +#### Defined in + +[common-hid-packet-parser.js:132](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L132) + +___ + +### callback + +• **callback**: [`fieldChangeCallback`](../modules/common_hid_packet_parser.md#fieldchangecallback) + +#### Defined in + +[common-hid-packet-parser.js:134](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L134) + +___ + +### group + +• **group**: `string` + +#### Defined in + +[common-hid-packet-parser.js:127](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L127) + +___ + +### id + +• **id**: `string` + +Group and control name separated by a dot + +#### Defined in + +[common-hid-packet-parser.js:126](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L126) + +___ + +### mapped\_callback + +• **mapped\_callback**: [`controlCallback`](../modules/common_hid_packet_parser.md#controlcallback) + +#### Defined in + +[common-hid-packet-parser.js:131](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L131) + +___ + +### mapped\_group + +• **mapped\_group**: `string` + +Mapped group, must be a valid Mixxx control group name e.g. "[Channel1]" + +#### Defined in + +[common-hid-packet-parser.js:129](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L129) + +___ + +### mapped\_name + +• **mapped\_name**: `string` + +Name of mapped control, must be a valid Mixxx control name "cue_indicator" + +#### Defined in + +[common-hid-packet-parser.js:130](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L130) + +___ + +### name + +• **name**: `string` + +#### Defined in + +[common-hid-packet-parser.js:128](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L128) + +___ + +### packet + +• **packet**: [`HIDPacket`](../classes/common_hid_packet_parser.HIDPacket.md) + +#### Defined in + +[common-hid-packet-parser.js:125](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L125) + +___ + +### toggle + +• **toggle**: `number` + +#### Defined in + +[common-hid-packet-parser.js:141](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L141) + +___ + +### type + +• **type**: ``"output"`` \| ``"button"`` + +Must be either: + - 'button' + - 'output' + +#### Defined in + +[common-hid-packet-parser.js:137](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L137) + +___ + +### value + +• **value**: `number` + +#### Defined in + +[common-hid-packet-parser.js:140](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L140) diff --git a/source/chapters/controller_api/interfaces/common_hid_packet_parser.packetField.md b/source/chapters/controller_api/interfaces/common_hid_packet_parser.packetField.md new file mode 100644 index 0000000000..ecd33f284d --- /dev/null +++ b/source/chapters/controller_api/interfaces/common_hid_packet_parser.packetField.md @@ -0,0 +1,291 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [common-hid-packet-parser](../modules/common_hid_packet_parser.md) / packetField + +# Interface: packetField<\> + +[common-hid-packet-parser](../modules/common_hid_packet_parser.md).packetField + +## Table of contents + +### Properties + +- [auto\_repeat](common_hid_packet_parser.packetField.md#auto_repeat) +- [auto\_repeat\_interval](common_hid_packet_parser.packetField.md#auto_repeat_interval) +- [bitmask](common_hid_packet_parser.packetField.md#bitmask) +- [callback](common_hid_packet_parser.packetField.md#callback) +- [delta](common_hid_packet_parser.packetField.md#delta) +- [end\_offset](common_hid_packet_parser.packetField.md#end_offset) +- [group](common_hid_packet_parser.packetField.md#group) +- [id](common_hid_packet_parser.packetField.md#id) +- [ignored](common_hid_packet_parser.packetField.md#ignored) +- [isEncoder](common_hid_packet_parser.packetField.md#isencoder) +- [mapped\_callback](common_hid_packet_parser.packetField.md#mapped_callback) +- [mapped\_group](common_hid_packet_parser.packetField.md#mapped_group) +- [mapped\_name](common_hid_packet_parser.packetField.md#mapped_name) +- [max](common_hid_packet_parser.packetField.md#max) +- [min](common_hid_packet_parser.packetField.md#min) +- [mindelta](common_hid_packet_parser.packetField.md#mindelta) +- [name](common_hid_packet_parser.packetField.md#name) +- [offset](common_hid_packet_parser.packetField.md#offset) +- [pack](common_hid_packet_parser.packetField.md#pack) +- [packet](common_hid_packet_parser.packetField.md#packet) +- [soft\_takeover](common_hid_packet_parser.packetField.md#soft_takeover) +- [toggle](common_hid_packet_parser.packetField.md#toggle) +- [type](common_hid_packet_parser.packetField.md#type) +- [value](common_hid_packet_parser.packetField.md#value) + +## Properties + +### auto\_repeat + +• **auto\_repeat**: [`fieldChangeCallback`](../modules/common_hid_packet_parser.md#fieldchangecallback) + +#### Defined in + +[common-hid-packet-parser.js:108](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L108) + +___ + +### auto\_repeat\_interval + +• **auto\_repeat\_interval**: `number` + +#### Defined in + +[common-hid-packet-parser.js:109](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L109) + +___ + +### bitmask + +• **bitmask**: `number` + +#### Defined in + +[common-hid-packet-parser.js:103](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L103) + +___ + +### callback + +• **callback**: [`fieldChangeCallback`](../modules/common_hid_packet_parser.md#fieldchangecallback) + +#### Defined in + +[common-hid-packet-parser.js:105](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L105) + +___ + +### delta + +• **delta**: `number` + +#### Defined in + +[common-hid-packet-parser.js:117](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L117) + +___ + +### end\_offset + +• **end\_offset**: `number` + +Position of the last byte in the packet in bytes ([offset](common_hid_packet_parser.packetField.md#offset) + packet size) + +#### Defined in + +[common-hid-packet-parser.js:102](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L102) + +___ + +### group + +• **group**: `string` + +#### Defined in + +[common-hid-packet-parser.js:95](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L95) + +___ + +### id + +• **id**: `string` + +Group and control name separated by a dot + +#### Defined in + +[common-hid-packet-parser.js:94](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L94) + +___ + +### ignored + +• **ignored**: `boolean` + +#### Defined in + +[common-hid-packet-parser.js:107](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L107) + +___ + +### isEncoder + +• **isEncoder**: `boolean` + +#### Defined in + +[common-hid-packet-parser.js:104](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L104) + +___ + +### mapped\_callback + +• **mapped\_callback**: [`controlCallback`](../modules/common_hid_packet_parser.md#controlcallback) + +#### Defined in + +[common-hid-packet-parser.js:99](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L99) + +___ + +### mapped\_group + +• **mapped\_group**: `string` + +Mapped group, must be a valid Mixxx control group name e.g. "[Channel1]" + +#### Defined in + +[common-hid-packet-parser.js:97](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L97) + +___ + +### mapped\_name + +• **mapped\_name**: `string` + +Name of mapped control, must be a valid Mixxx control name "VuMeter" + +#### Defined in + +[common-hid-packet-parser.js:98](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L98) + +___ + +### max + +• **max**: `number` + +#### Defined in + +[common-hid-packet-parser.js:111](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L111) + +___ + +### min + +• **min**: `number` + +#### Defined in + +[common-hid-packet-parser.js:110](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L110) + +___ + +### mindelta + +• **mindelta**: `number` + +#### Defined in + +[common-hid-packet-parser.js:118](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L118) + +___ + +### name + +• **name**: `string` + +#### Defined in + +[common-hid-packet-parser.js:96](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L96) + +___ + +### offset + +• **offset**: `number` + +Position of the first byte in the packet in bytes (first byte is 0) + +#### Defined in + +[common-hid-packet-parser.js:101](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L101) + +___ + +### pack + +• **pack**: `string` + +Control packing format for unpack(), one of b/B, h/H, i/I + +#### Defined in + +[common-hid-packet-parser.js:100](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L100) + +___ + +### packet + +• **packet**: [`HIDPacket`](../classes/common_hid_packet_parser.HIDPacket.md) + +#### Defined in + +[common-hid-packet-parser.js:93](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L93) + +___ + +### soft\_takeover + +• **soft\_takeover**: `boolean` + +#### Defined in + +[common-hid-packet-parser.js:106](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L106) + +___ + +### toggle + +• **toggle**: `number` + +#### Defined in + +[common-hid-packet-parser.js:119](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L119) + +___ + +### type + +• **type**: ``"bitvector"`` \| ``"control"`` \| ``"output"`` + +Must be either: + - 'bitvector' If value is of type HIDBitVector + - 'control' If value is a number + - 'output' + +#### Defined in + +[common-hid-packet-parser.js:112](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L112) + +___ + +### value + +• **value**: `number` \| `boolean` \| [`HIDBitVector`](../classes/common_hid_packet_parser.HIDBitVector.md) + +#### Defined in + +[common-hid-packet-parser.js:116](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L116) diff --git a/source/chapters/controller_api/interfaces/engine_api.ScriptConnection.md b/source/chapters/controller_api/interfaces/engine_api.ScriptConnection.md new file mode 100644 index 0000000000..ef1a475825 --- /dev/null +++ b/source/chapters/controller_api/interfaces/engine_api.ScriptConnection.md @@ -0,0 +1,53 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [engine-api](../modules/engine_api.md) / ScriptConnection + +# Interface: ScriptConnection + +[engine-api](../modules/engine_api.md).ScriptConnection + +ScriptConnectionJSProxy + +## Table of contents + +### Methods + +- [disconnect](engine_api.ScriptConnection.md#disconnect) +- [trigger](engine_api.ScriptConnection.md#trigger) + +## Methods + +### disconnect + +▸ **disconnect**(): `boolean` + +Disconnect the script connection, +established by [makeConnection](../modules/engine_api.engine.md#makeconnection) or [makeUnbufferedConnection](../modules/engine_api.engine.md#makeunbufferedconnection) + +#### Returns + +`boolean` + +Returns true if the connection has been disconnected successfully + +#### Defined in + +[engine-api.d.ts:11](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L11) + +___ + +### trigger + +▸ **trigger**(): `void` + +Triggers the execution of the callback function of the script connection, +established by [makeConnection](../modules/engine_api.engine.md#makeconnection) or [makeUnbufferedConnection](../modules/engine_api.engine.md#makeunbufferedconnection) +with the actual value of a control. + +Note: To execute all callback functions connected to a ControlObject at once, use [trigger](../modules/engine_api.engine.md#trigger) instead + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:20](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L20) diff --git a/source/chapters/controller_api/modules.md b/source/chapters/controller_api/modules.md new file mode 100644 index 0000000000..e61cf348e9 --- /dev/null +++ b/source/chapters/controller_api/modules.md @@ -0,0 +1,14 @@ +[Documentation](README.md) / Modules + +# Documentation + +## Table of contents + +### Modules + +- [color-mapper-api](modules/color_mapper_api.md) +- [common-hid-packet-parser](modules/common_hid_packet_parser.md) +- [console-api](modules/console_api.md) +- [engine-api](modules/engine_api.md) +- [hid-controller-api](modules/hid_controller_api.md) +- [midi-controller-api](modules/midi_controller_api.md) diff --git a/source/chapters/controller_api/modules/color_mapper_api.md b/source/chapters/controller_api/modules/color_mapper_api.md new file mode 100644 index 0000000000..92144ce758 --- /dev/null +++ b/source/chapters/controller_api/modules/color_mapper_api.md @@ -0,0 +1,9 @@ +[Documentation](../README.md) / [Modules](../modules.md) / color-mapper-api + +# Module: color-mapper-api + +## Table of contents + +### Classes + +- [ColorMapper](../classes/color_mapper_api.ColorMapper.md) diff --git a/source/chapters/controller_api/modules/common_hid_packet_parser.md b/source/chapters/controller_api/modules/common_hid_packet_parser.md new file mode 100644 index 0000000000..8f08e433e1 --- /dev/null +++ b/source/chapters/controller_api/modules/common_hid_packet_parser.md @@ -0,0 +1,231 @@ +[Documentation](../README.md) / [Modules](../modules.md) / common-hid-packet-parser + +# Module: common-hid-packet-parser + +## Table of contents + +### Classes + +- [HIDBitVector](../classes/common_hid_packet_parser.HIDBitVector.md) +- [HIDController](../classes/common_hid_packet_parser.HIDController.md) +- [HIDModifierList](../classes/common_hid_packet_parser.HIDModifierList.md) +- [HIDPacket](../classes/common_hid_packet_parser.HIDPacket.md) + +### Interfaces + +- [bitObject](../interfaces/common_hid_packet_parser.bitObject.md) +- [packetField](../interfaces/common_hid_packet_parser.packetField.md) + +### Type Aliases + +- [controlCallback](common_hid_packet_parser.md#controlcallback) +- [fieldChangeCallback](common_hid_packet_parser.md#fieldchangecallback) +- [modifierCallback](common_hid_packet_parser.md#modifiercallback) +- [packetCallback](common_hid_packet_parser.md#packetcallback) +- [scalingCallback](common_hid_packet_parser.md#scalingcallback) +- [scratchingCallback](common_hid_packet_parser.md#scratchingcallback) + +### Functions + +- [HIDDebug](common_hid_packet_parser.md#hiddebug) +- [createDataView](common_hid_packet_parser.md#createdataview) + +## Type Aliases + +### controlCallback + +Ƭ **controlCallback**<\>: <\>(`value`: `number`, `group`: `string`, `name`: `string`) => `any` + +#### Type declaration + +▸ <\>(`value`, `group`, `name`): `any` + +##### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `value` | `number` | New value of the control | +| `group` | `string` | Mixxx control group name e.g. "[Channel1]" | +| `name` | `string` | Mixxx control name "pregain" | + +##### Returns + +`any` + +#### Defined in + +[common-hid-packet-parser.js:58](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L58) + +___ + +### fieldChangeCallback + +Ƭ **fieldChangeCallback**<\>: <\>(`Object`: [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) \| [`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md)) => `any` + +#### Type declaration + +▸ <\>(`Object`): `any` + +##### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `Object` | [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) \| [`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md) | that describes a field/bit inside of a packet, which can often mapped to a Mixxx control. | + +##### Returns + +`any` + +#### Defined in + +[common-hid-packet-parser.js:50](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L50) + +___ + +### modifierCallback + +Ƭ **modifierCallback**<\>: <\>(`Value`: `boolean`) => `any` + +#### Type declaration + +▸ <\>(`Value`): `any` + +##### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `Value` | `boolean` | of the modifier control | + +##### Returns + +`any` + +#### Defined in + +[common-hid-packet-parser.js:44](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L44) + +___ + +### packetCallback + +Ƭ **packetCallback**<\>: <\>(`packet`: [`HIDPacket`](../classes/common_hid_packet_parser.HIDPacket.md), `changed_data`: `Object`<`string`, [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) \| [`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md)\>) => `any` + +#### Type declaration + +▸ <\>(`packet`, `changed_data`): `any` + +##### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `packet` | [`HIDPacket`](../classes/common_hid_packet_parser.HIDPacket.md) | The packet that represents the InputReport | +| `changed_data` | `Object`<`string`, [`packetField`](../interfaces/common_hid_packet_parser.packetField.md) \| [`bitObject`](../interfaces/common_hid_packet_parser.bitObject.md)\> | The data received from the device | + +##### Returns + +`any` + +#### Defined in + +[common-hid-packet-parser.js:37](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L37) + +___ + +### scalingCallback + +Ƭ **scalingCallback**<\>: <\>(`group`: `string`, `name`: `string`, `value`: `number`) => `number` + +#### Type declaration + +▸ <\>(`group`, `name`, `value`): `number` + +##### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Control group name e.g. "[Channel1]" | +| `name` | `string` | Control name "pregain" | +| `value` | `number` | Value to be scaled | + +##### Returns + +`number` + +#### Defined in + +[common-hid-packet-parser.js:75](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L75) + +___ + +### scratchingCallback + +Ƭ **scratchingCallback**<\>: <\>(`isScratchEnabled`: `boolean`) => `any` + +#### Type declaration + +▸ <\>(`isScratchEnabled`): `any` + +##### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isScratchEnabled` | `boolean` | True, when button 'jog_touch' is active | + +##### Returns + +`any` + +#### Defined in + +[common-hid-packet-parser.js:86](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L86) + +## Functions + +### HIDDebug + +▸ **HIDDebug**(`message`): `void` + +Common HID script debugging function. Just to get logging with 'HID' prefix. + +**`Deprecated`** + +Use console.log instead + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `message` | `any` | Message to be printed on controller debug console output | + +#### Returns + +`void` + +#### Defined in + +[common-hid-packet-parser.js:9](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L9) + +___ + +### createDataView + +▸ **createDataView**(`bufferLike`): `DataView` + +creates a `DataView` from any ArrayBuffer, TypedArray +or plain Array (clamped to 8-bit width). + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bufferLike` | `any` | Object that can be represented as a sequence of bytes | + +#### Returns + +`DataView` + +dataview over the bufferLike object + +#### Defined in + +[common-hid-packet-parser.js:19](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/common-hid-packet-parser.js#L19) diff --git a/source/chapters/controller_api/modules/console_api.console.md b/source/chapters/controller_api/modules/console_api.console.md new file mode 100644 index 0000000000..aa46607fed --- /dev/null +++ b/source/chapters/controller_api/modules/console_api.console.md @@ -0,0 +1,344 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [console-api](console_api.md) / console + +# Namespace: console + +[console-api](console_api.md).console + +Mixxx installs the QJSEngine::ConsoleExtension for the use in controller mapping scripts. +See also: + https://doc.qt.io/qt-5/qtquick-debugging.html#console-api + https://developer.mozilla.org/en-US/docs/Web/API/console + https://console.spec.whatwg.org/ + +## Table of contents + +### Functions + +- [assert](console_api.console.md#assert) +- [count](console_api.console.md#count) +- [debug](console_api.console.md#debug) +- [error](console_api.console.md#error) +- [exception](console_api.console.md#exception) +- [info](console_api.console.md#info) +- [log](console_api.console.md#log) +- [profile](console_api.console.md#profile) +- [profileEnd](console_api.console.md#profileend) +- [time](console_api.console.md#time) +- [timeEnd](console_api.console.md#timeend) +- [trace](console_api.console.md#trace) +- [warn](console_api.console.md#warn) + +## Functions + +### assert + +▸ **assert**(`condition`, `...data`): `void` + +Tests that a boolean expression is true, +if not, it writes an (optional) message to the console and prints the stack trace. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `condition` | `boolean` | If the condition is false, it prints message and stack trace | +| `...data` | `any`[] | Message to print - Either a list of objects whose string representations get concatenated into the message string - Or a string containing zero or more substitution strings followed by a list of objects to replace them | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:77](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L77) + +___ + +### count + +▸ **count**(`label?`): `void` + +Prints the current number of times a particular piece of code has run, along with a message. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `label?` | `string` | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:113](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L113) + +___ + +### debug + +▸ **debug**(`...data`): `void` + +Prints debugging information to the console, when +QT_LOGGING_RULES="js.debug=true;" or +Mixxx is started with --controller-debug +This function is identical to console.log + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...data` | `any`[] | Message to print - Either a list of objects whose string representations get concatenated into the message string - Or a string containing zero or more substitution strings followed by a list of objects to replace them | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:33](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L33) + +___ + +### error + +▸ **error**(`...data`): `void` + +Prints an error message to the console, when +QT_LOGGING_RULES="js.critical=true;" or +Mixxx is started with --controller-debug + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...data` | `any`[] | Message to print - Either a list of objects whose string representations get concatenated into the message string - Or a string containing zero or more substitution strings followed by a list of objects to replace them | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:66](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L66) + +___ + +### exception + +▸ **exception**(`...data`): `void` + +Prints an error message together with the stack trace of JavaScript execution at the point where it is called. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...data` | `any`[] | Message to print - Either a list of objects whose string representations get concatenated into the message string - Or a string containing zero or more substitution strings followed by a list of objects to replace them | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:136](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L136) + +___ + +### info + +▸ **info**(`...data`): `void` + +Prints information to the console, when +QT_LOGGING_RULES="js.info=true;" or +Mixxx is started with --controller-debug + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...data` | `any`[] | Message to print - Either a list of objects whose string representations get concatenated into the message string - Or a string containing zero or more substitution strings followed by a list of objects to replace them | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:44](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L44) + +___ + +### log + +▸ **log**(`...data`): `void` + +Prints debugging information to the console, when +QT_LOGGING_RULES="js.debug=true;" or +Mixxx is started with --controller-debug +This function is identical to console.debug + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...data` | `any`[] | Message to print - Either a list of objects whose string representations get concatenated into the message string - Or a string containing zero or more substitution strings followed by a list of objects to replace them | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:21](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L21) + +___ + +### profile + +▸ **profile**(`label?`): `void` + +Turns on the JavaScript profiler. + +**`Deprecated`** + +Not usable for controller mappings for now [see QTBUG-65419][https://bugreports.qt.io/browse/QTBUG-65419](https://bugreports.qt.io/browse/QTBUG-65419) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `label?` | `string` | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:120](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L120) + +___ + +### profileEnd + +▸ **profileEnd**(`label?`): `void` + +Turns off the JavaScript profiler. + +**`Deprecated`** + +Not usable for controller mappings for now [see QTBUG-65419][https://bugreports.qt.io/browse/QTBUG-65419](https://bugreports.qt.io/browse/QTBUG-65419) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `label?` | `string` | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:127](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L127) + +___ + +### time + +▸ **time**(`label?`): `void` + +Starts the time measurement, which will be printed by timeEnd + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `label?` | `string` | string argument that identifies the measurement. | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:84](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L84) + +___ + +### timeEnd + +▸ **timeEnd**(`label?`): `void` + +Logs the time (in milliseconds) that was spent since the call of the time method. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `label?` | `string` | string argument that identifies the measurement. | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:90](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L90) + +___ + +### trace + +▸ **trace**(`...data`): `void` + +Prints the stack trace of the JavaScript execution at the point where it was called. +This stack trace information contains the function name, file name, line number, and column number. +The stack trace is limited to last 10 stack frames. + +Unfortunately this function does use the wrong logging category "default" instead of "js", +which is set when you start Mixxx with --controller-debug. Without setting logging category +"default" manually, you will not see any output. +[see QTBUG-108673][https://bugreports.qt.io/browse/QTBUG-108673](https://bugreports.qt.io/browse/QTBUG-108673) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...data` | `any`[] | Message to print - Either a list of objects whose string representations get concatenated into the message string - Or a string containing zero or more substitution strings followed by a list of objects to replace them | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:106](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L106) + +___ + +### warn + +▸ **warn**(`...data`): `void` + +Prints a warning message to the console, when +QT_LOGGING_RULES="js.warning=true;" or +Mixxx is started with --controller-debug + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...data` | `any`[] | Message to print - Either a list of objects whose string representations get concatenated into the message string - Or a string containing zero or more substitution strings followed by a list of objects to replace them | + +#### Returns + +`void` + +#### Defined in + +[console-api.d.ts:55](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/console-api.d.ts#L55) diff --git a/source/chapters/controller_api/modules/console_api.md b/source/chapters/controller_api/modules/console_api.md new file mode 100644 index 0000000000..fca5b13855 --- /dev/null +++ b/source/chapters/controller_api/modules/console_api.md @@ -0,0 +1,9 @@ +[Documentation](../README.md) / [Modules](../modules.md) / console-api + +# Module: console-api + +## Table of contents + +### Namespaces + +- [console](console_api.console.md) diff --git a/source/chapters/controller_api/modules/engine_api.engine.md b/source/chapters/controller_api/modules/engine_api.engine.md new file mode 100644 index 0000000000..1924705557 --- /dev/null +++ b/source/chapters/controller_api/modules/engine_api.engine.md @@ -0,0 +1,692 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [engine-api](engine_api.md) / engine + +# Namespace: engine + +[engine-api](engine_api.md).engine + +ControllerScriptInterfaceLegacy + +## Table of contents + +### Type Aliases + +- [CoCallback](engine_api.engine.md#cocallback) +- [TimerID](engine_api.engine.md#timerid) + +### Functions + +- [beginTimer](engine_api.engine.md#begintimer) +- [brake](engine_api.engine.md#brake) +- [connectControl](engine_api.engine.md#connectcontrol) +- [getDefaultParameter](engine_api.engine.md#getdefaultparameter) +- [getDefaultValue](engine_api.engine.md#getdefaultvalue) +- [getParameter](engine_api.engine.md#getparameter) +- [getParameterForValue](engine_api.engine.md#getparameterforvalue) +- [getValue](engine_api.engine.md#getvalue) +- [isScratching](engine_api.engine.md#isscratching) +- [log](engine_api.engine.md#log) +- [makeConnection](engine_api.engine.md#makeconnection) +- [makeUnbufferedConnection](engine_api.engine.md#makeunbufferedconnection) +- [reset](engine_api.engine.md#reset) +- [scratchDisable](engine_api.engine.md#scratchdisable) +- [scratchEnable](engine_api.engine.md#scratchenable) +- [scratchTick](engine_api.engine.md#scratchtick) +- [setParameter](engine_api.engine.md#setparameter) +- [setValue](engine_api.engine.md#setvalue) +- [softStart](engine_api.engine.md#softstart) +- [softTakeover](engine_api.engine.md#softtakeover) +- [softTakeoverIgnoreNextValue](engine_api.engine.md#softtakeoverignorenextvalue) +- [spinback](engine_api.engine.md#spinback) +- [stopTimer](engine_api.engine.md#stoptimer) +- [trigger](engine_api.engine.md#trigger) + +## Type Aliases + +### CoCallback + +Ƭ **CoCallback**: (`value`: `number`, `group`: `string`, `name`: `string`) => `void` + +#### Type declaration + +▸ (`value`, `group`, `name`): `void` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `value` | `number` | +| `group` | `string` | +| `name` | `string` | + +##### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:104](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L104) + +___ + +### TimerID + +Ƭ **TimerID**: `number` + +#### Defined in + +[engine-api.d.ts:158](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L158) + +## Functions + +### beginTimer + +▸ **beginTimer**(`interval`, `scriptCode`, `oneShot?`): [`TimerID`](engine_api.engine.md#timerid) + +Starts a timer that will call the specified script function + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `interval` | `number` | Time in milliseconds until the function is executed. Intervals below 20ms are not allowed. | +| `scriptCode` | () => `any` | Function to be executed, you can also use closures as: function() { print("Executed Timer") } | +| `oneShot?` | `boolean` | If true the function is only once, if false the function is executed repeatedly [default = false] | + +#### Returns + +[`TimerID`](engine_api.engine.md#timerid) + +timerId which is needed to stop a timer. + In case of an error, 0 is returned. + +#### Defined in + +[engine-api.d.ts:173](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L173) + +___ + +### brake + +▸ **brake**(`deck`, `activate`, `factor?`, `rate?`): `void` + +To achieve a brake effect of the playback speed +Both engine.softStart() and engine.brake()/engine.spinback() can interrupt each other. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `deck` | `number` | The deck number to use, e.g: 1 | +| `activate` | `boolean` | Set true to activate, or false to disable | +| `factor?` | `number` | Defines how quickly the deck should come to a stop. Start with a value of 1 and increase to increase the acceleration. Be aware that brake called with low factors (about 0.5 and lower), would keep the deck running although the resulting very low sounds are not audible anymore. [default = 1.0] | +| `rate?` | `number` | The initial speed of the deck when enabled. "1" (default) means 10x speed in forward. Negative values like "-1" also work, though then it's spinning reverse obviously. [default = 1.0] | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:255](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L255) + +___ + +### connectControl + +▸ **connectControl**(`group`, `name`, `callback`, `disconnect?`): [`ScriptConnection`](../interfaces/engine_api.ScriptConnection.md) \| `boolean` \| `undefined` + +This function is a legacy version of makeConnection with several alternate +ways of invoking it. The callback function can be passed either as a string of +JavaScript code that evaluates to a function or an actual JavaScript function. + +**`Deprecated`** + +Use [makeConnection](engine_api.engine.md#makeconnection) instead + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "VuMeter" | +| `callback` | [`CoCallback`](engine_api.engine.md#cocallback) | JS function, which will be called every time, the value of the connected control changes. | +| `disconnect?` | `boolean` | If "true", all connections to the ControlObject are removed. [default = false] | + +#### Returns + +[`ScriptConnection`](../interfaces/engine_api.ScriptConnection.md) \| `boolean` \| `undefined` + +Returns script connection object on success, otherwise 'undefined' or 'false' depending on the error cause. + +#### Defined in + +[engine-api.d.ts:143](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L143) + +___ + +### getDefaultParameter + +▸ **getDefaultParameter**(`group`, `name`): `number` + +Returns the default value of a control, normalized to a range of 0..1 + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "play_indicator" | + +#### Returns + +`number` + +Default value of the specified control normalized to range of 0..1 + +#### Defined in + +[engine-api.d.ts:102](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L102) + +___ + +### getDefaultValue + +▸ **getDefaultValue**(`group`, `name`): `number` + +Returns the default value of a control + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "play_indicator" | + +#### Returns + +`number` + +Default value with the controls range according Mixxx Controls manual page: + https://manual.mixxx.org/latest/chapters/appendix/mixxx_controls.html + +#### Defined in + +[engine-api.d.ts:93](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L93) + +___ + +### getParameter + +▸ **getParameter**(`group`, `name`): `number` + +Gets the control value normalized to a range of 0..1 + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "play_indicator" | + +#### Returns + +`number` + +Value of the control normalized to range of 0..1 + +#### Defined in + +[engine-api.d.ts:54](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L54) + +___ + +### getParameterForValue + +▸ **getParameterForValue**(`group`, `name`, `value`): `number` + +Normalizes a specified value using the range of the given control, +to the range of 0..1 + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "play_indicator" | +| `value` | `number` | Value with the controls range according Mixxx Controls manual page: https://manual.mixxx.org/latest/chapters/appendix/mixxx_controls.html | + +#### Returns + +`number` + +Value normalized to range of 0..1 + +#### Defined in + +[engine-api.d.ts:75](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L75) + +___ + +### getValue + +▸ **getValue**(`group`, `name`): `number` + +Gets the control value + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "play_indicator" | + +#### Returns + +`number` + +Value of the control (within it's range according Mixxx Controls manual page: + https://manual.mixxx.org/latest/chapters/appendix/mixxx_controls.html) + +#### Defined in + +[engine-api.d.ts:35](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L35) + +___ + +### isScratching + +▸ **isScratching**(`deck`): `boolean` + +Returns true if scratching is enabled + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `deck` | `number` | The deck number to use, e.g: 1 | + +#### Returns + +`boolean` + +True if scratching is enabled + +#### Defined in + +[engine-api.d.ts:218](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L218) + +___ + +### log + +▸ **log**(`message`): `void` + +**`Deprecated`** + +Use console.log instead + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `message` | `string` | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:156](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L156) + +___ + +### makeConnection + +▸ **makeConnection**(`group`, `name`, `callback`): [`ScriptConnection`](../interfaces/engine_api.ScriptConnection.md) \| `undefined` + +Connects a specified Mixxx Control with a callback function, which is executed if the value of the control changes + +This connection has a FIFO buffer - all value change events are processed in serial order. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "play_indicator" | +| `callback` | [`CoCallback`](engine_api.engine.md#cocallback) | JS function, which will be called every time, the value of the connected control changes. | + +#### Returns + +[`ScriptConnection`](../interfaces/engine_api.ScriptConnection.md) \| `undefined` + +Returns script connection object on success, otherwise 'undefined'' + +#### Defined in + +[engine-api.d.ts:116](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L116) + +___ + +### makeUnbufferedConnection + +▸ **makeUnbufferedConnection**(`group`, `name`, `callback`): [`ScriptConnection`](../interfaces/engine_api.ScriptConnection.md) \| `undefined` + +Connects a specified Mixxx Control with a callback function, which is executed if the value of the control changes + +This connection is unbuffered - when value change events occur faster, than the mapping can process them, +only the last value set for the control is processed. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "VuMeter" | +| `callback` | [`CoCallback`](engine_api.engine.md#cocallback) | JS function, which will be called every time, the value of the connected control changes. | + +#### Returns + +[`ScriptConnection`](../interfaces/engine_api.ScriptConnection.md) \| `undefined` + +Returns script connection object on success, otherwise 'undefined'' + +#### Defined in + +[engine-api.d.ts:129](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L129) + +___ + +### reset + +▸ **reset**(`group`, `name`): `void` + +Resets the control to its default value + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "play_indicator" | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:83](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L83) + +___ + +### scratchDisable + +▸ **scratchDisable**(`deck`, `ramp?`): `void` + +Jogwheel function to be called when scratching ends (usually when the wheel is released) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `deck` | `number` | The deck number to use, e.g: 1 | +| `ramp?` | `boolean` | Set true to ramp the deck speed up. Set false to jump to normal play speed instantly [default = true] | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:210](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L210) + +___ + +### scratchEnable + +▸ **scratchEnable**(`deck`, `intervalsPerRev`, `rpm`, `alpha`, `beta`, `ramp?`): `void` + +Jogwheel function to be called when scratching starts (usually when the wheel is touched) +This function contains an parametrizeable alpha-beta filter, which influences the +responsiveness and looseness of the imaginary slip mat + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `deck` | `number` | The deck number to use, e.g: 1 | +| `intervalsPerRev` | `number` | The resolution of the MIDI control (in intervals per revolution) | +| `rpm` | `number` | The speed of the imaginary record at 0% pitch (in revolutions per minute (RPM) typically 33+1/3, adjust for comfort) | +| `alpha` | `number` | The alpha coefficient of the filter (start with 1/8 (0.125) and tune from there) | +| `beta` | `number` | The beta coefficient of the filter (start with alpha/32 and tune from there) | +| `ramp?` | `boolean` | Set true to ramp the deck speed down. Set false to stop instantly [default = true] | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:194](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L194) + +___ + +### scratchTick + +▸ **scratchTick**(`deck`, `interval`): `void` + +Function to be called each time the jogwheel is moved during scratching + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `deck` | `number` | The deck number to use, e.g: 1 | +| `interval` | `number` | The movement value (typically 1 for one "tick" forwards, -1 for one "tick" backwards) | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:202](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L202) + +___ + +### setParameter + +▸ **setParameter**(`group`, `name`, `newValue`): `void` + +Sets the control value specified with normalized range of 0..1 + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "play_indicator" | +| `newValue` | `number` | Value to be set, normalized to a range of 0..1 | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:63](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L63) + +___ + +### setValue + +▸ **setValue**(`group`, `name`, `newValue`): `void` + +Sets a control value + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "play_indicator" | +| `newValue` | `number` | Value to be set (within it's range according Mixxx Controls manual page: https://manual.mixxx.org/latest/chapters/appendix/mixxx_controls.html) | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:45](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L45) + +___ + +### softStart + +▸ **softStart**(`deck`, `activate`, `factor?`): `void` + +To achieve a forward acceleration effect from standstill to normal speed. +Both engine.softStart() and engine.brake()/engine.spinback() can interrupt each other. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `deck` | `number` | The deck number to use, e.g: 1 | +| `activate` | `boolean` | Set true to activate, or false to disable | +| `factor?` | `number` | Defines how quickly the deck should come to normal playback rate. Start with a value of 1 and increase to increase the acceleration. SoftStart with low factors would take a while until sound is audible. [default = 1.0] | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:282](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L282) + +___ + +### softTakeover + +▸ **softTakeover**(`group`, `name`, `enable`): `void` + +If enabled, soft-takeover prevents sudden wide parameter changes, +when on-screen control and hardware control divert. +With soft-takeover you need to turn a hardware knob, until it reaches +the position of the on-screen knob - than it takes over control. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "pregain" | +| `enable` | `boolean` | Set true to enable soft-takeover for the specified control | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:230](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L230) + +___ + +### softTakeoverIgnoreNextValue + +▸ **softTakeoverIgnoreNextValue**(`group`, `name`): `void` + +Inhibits a sudden value change from the hardware control. +Should be called when receiving input for the knob/fader, +that switches its behavior (e.g. Shift-Button pressed) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "pregain" | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:240](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L240) + +___ + +### spinback + +▸ **spinback**(`deck`, `activate`, `factor?`, `rate?`): `void` + +To achieve a spinback effect of the playback speed +Both engine.softStart() and engine.brake()/engine.spinback() can interrupt each other. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `deck` | `number` | The deck number to use, e.g: 1 | +| `activate` | `boolean` | Set true to activate, or false to disable | +| `factor?` | `number` | Defines how quickly the deck should come to normal playback rate. Start with a value of 1 and increase to increase the acceleration. Be aware that spinback called with low factors (about 0.5 and lower), would keep the deck running although the resulting very low sounds are not audible anymore. [default = 1.8] | +| `rate?` | `number` | The initial speed of the deck when enabled. "-10" (default) means 10x speed in reverse. Positive values like "10" also work, though then it's spinning forward obviously. [default = -10.0] | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:270](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L270) + +___ + +### stopTimer + +▸ **stopTimer**(`timerId`): `void` + +Stops the specified timer + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `timerId` | `number` | ID of the timer | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:180](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L180) + +___ + +### trigger + +▸ **trigger**(`group`, `name`): `void` + +Triggers the execution of all connected callback functions, with the actual value of a control. +Note: To trigger a single connection, use [trigger](../interfaces/engine_api.ScriptConnection.md#trigger) instead + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `group` | `string` | Group of the control e.g. "[Channel1]" | +| `name` | `string` | Name of the control e.g. "play_indicator" | + +#### Returns + +`void` + +#### Defined in + +[engine-api.d.ts:153](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/engine-api.d.ts#L153) diff --git a/source/chapters/controller_api/modules/engine_api.md b/source/chapters/controller_api/modules/engine_api.md new file mode 100644 index 0000000000..bfd89ff059 --- /dev/null +++ b/source/chapters/controller_api/modules/engine_api.md @@ -0,0 +1,13 @@ +[Documentation](../README.md) / [Modules](../modules.md) / engine-api + +# Module: engine-api + +## Table of contents + +### Namespaces + +- [engine](engine_api.engine.md) + +### Interfaces + +- [ScriptConnection](../interfaces/engine_api.ScriptConnection.md) diff --git a/source/chapters/controller_api/modules/hid_controller_api.controller.md b/source/chapters/controller_api/modules/hid_controller_api.controller.md new file mode 100644 index 0000000000..695330d21b --- /dev/null +++ b/source/chapters/controller_api/modules/hid_controller_api.controller.md @@ -0,0 +1,163 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [hid-controller-api](hid_controller_api.md) / controller + +# Namespace: controller + +[hid-controller-api](hid_controller_api.md).controller + +HidControllerJSProxy + +## Table of contents + +### Functions + +- [getFeatureReport](hid_controller_api.controller.md#getfeaturereport) +- [getInputReport](hid_controller_api.controller.md#getinputreport) +- [send](hid_controller_api.controller.md#send) +- [sendFeatureReport](hid_controller_api.controller.md#sendfeaturereport) +- [sendOutputReport](hid_controller_api.controller.md#sendoutputreport) + +## Functions + +### getFeatureReport + +▸ **getFeatureReport**(`reportID`): `ArrayBuffer` + +getFeatureReport receives a FeatureReport from the HID device on request. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `reportID` | `number` | 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use | + +#### Returns + +`ArrayBuffer` + +The returned array matches the input format of sendFeatureReport, + allowing it to be read, modified and sent it back to the controller. + +#### Defined in + +[hid-controller-api.d.ts:61](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/hid-controller-api.d.ts#L61) + +___ + +### getInputReport + +▸ **getInputReport**(`reportID`): `ArrayBuffer` + +getInputReport receives an InputReport from the HID device on request. + +This can be used on startup to initialize the knob positions in Mixxx +to the physical position of the hardware knobs on the controller. +This is an optional command in the HID standard - not all devices support it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `reportID` | `number` | 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use | + +#### Returns + +`ArrayBuffer` + +Returns report data with ReportID byte as prefix + +#### Defined in + +[hid-controller-api.d.ts:44](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/hid-controller-api.d.ts#L44) + +___ + +### send + +▸ **send**(`dataList`, `length?`): `void` + +Sends HID OutputReport with hard coded ReportID 0 to HID device + +This function only works with HID devices, which don't use ReportIDs + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dataList` | `number`[] | Data to send as list of bytes | +| `length?` | `number` | Unused but mandatory argument for backwards compatibility | + +#### Returns + +`void` + +#### Defined in + +[hid-controller-api.d.ts:13](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/hid-controller-api.d.ts#L13) + +▸ **send**(`dataList`, `length`, `reportID`, `resendUnchangedReport?`): `void` + +Sends HID OutputReport to HID device + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dataList` | `number`[] | Data to send as list of bytes | +| `length` | `number` | Unused but mandatory argument for backwards compatibility | +| `reportID` | `number` | 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use ReportIDs | +| `resendUnchangedReport?` | `boolean` | If set, the report will also be send, if the data are unchanged since last sending [default = false] | + +#### Returns + +`void` + +#### Defined in + +[hid-controller-api.d.ts:23](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/hid-controller-api.d.ts#L23) + +___ + +### sendFeatureReport + +▸ **sendFeatureReport**(`reportID`, `reportData`): `void` + +Sends a FeatureReport to HID device + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `reportID` | `number` | 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use | +| `reportData` | `ArrayBuffer` | Data to send as byte array | + +#### Returns + +`void` + +#### Defined in + +[hid-controller-api.d.ts:52](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/hid-controller-api.d.ts#L52) + +___ + +### sendOutputReport + +▸ **sendOutputReport**(`reportID`, `dataArray`, `resendUnchangedReport?`): `void` + +Sends an OutputReport to HID device + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `reportID` | `number` | 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use ReportIDs | +| `dataArray` | `ArrayBuffer` | Data to send as byte array | +| `resendUnchangedReport?` | `boolean` | If set, the report will also be send, if the data are unchanged since last sending [default = false] | + +#### Returns + +`void` + +#### Defined in + +[hid-controller-api.d.ts:32](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/hid-controller-api.d.ts#L32) diff --git a/source/chapters/controller_api/modules/hid_controller_api.md b/source/chapters/controller_api/modules/hid_controller_api.md new file mode 100644 index 0000000000..8e31de4979 --- /dev/null +++ b/source/chapters/controller_api/modules/hid_controller_api.md @@ -0,0 +1,9 @@ +[Documentation](../README.md) / [Modules](../modules.md) / hid-controller-api + +# Module: hid-controller-api + +## Table of contents + +### Namespaces + +- [controller](hid_controller_api.controller.md) diff --git a/source/chapters/controller_api/modules/midi_controller_api.md b/source/chapters/controller_api/modules/midi_controller_api.md new file mode 100644 index 0000000000..c37d35cd9b --- /dev/null +++ b/source/chapters/controller_api/modules/midi_controller_api.md @@ -0,0 +1,9 @@ +[Documentation](../README.md) / [Modules](../modules.md) / midi-controller-api + +# Module: midi-controller-api + +## Table of contents + +### Namespaces + +- [midi](midi_controller_api.midi.md) diff --git a/source/chapters/controller_api/modules/midi_controller_api.midi.md b/source/chapters/controller_api/modules/midi_controller_api.midi.md new file mode 100644 index 0000000000..cdccf02d58 --- /dev/null +++ b/source/chapters/controller_api/modules/midi_controller_api.midi.md @@ -0,0 +1,86 @@ +[Documentation](../README.md) / [Modules](../modules.md) / [midi-controller-api](midi_controller_api.md) / midi + +# Namespace: midi + +[midi-controller-api](midi_controller_api.md).midi + +MidiControllerJSProxy + +## Table of contents + +### Functions + +- [send](midi_controller_api.midi.md#send) +- [sendShortMsg](midi_controller_api.midi.md#sendshortmsg) +- [sendSysexMsg](midi_controller_api.midi.md#sendsysexmsg) + +## Functions + +### send + +▸ **send**(`dataList`, `length?`): `void` + +Alias for [sendSysexMsg](midi_controller_api.midi.md#sendsysexmsg) +Sends a MIDI system-exclusive message of arbitrary number of bytes + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dataList` | `number`[] | List of bytes to send | +| `length?` | `number` | This is no longer evaluated, and only here for backwards compatibility with old scripts [default = 0] | + +#### Returns + +`void` + +#### Defined in + +[midi-controller-api.d.ts:22](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/midi-controller-api.d.ts#L22) + +___ + +### sendShortMsg + +▸ **sendShortMsg**(`status`, `byte1`, `byte2`): `void` + +Sends a 3 byte MIDI short message + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `status` | `number` | Status byte | +| `byte1` | `number` | Data byte 1 | +| `byte2` | `number` | Data byte 2 | + +#### Returns + +`void` + +#### Defined in + +[midi-controller-api.d.ts:13](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/midi-controller-api.d.ts#L13) + +___ + +### sendSysexMsg + +▸ **sendSysexMsg**(`dataList`, `length?`): `void` + +Sends a MIDI system-exclusive message of arbitrary number of bytes + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `dataList` | `number`[] | List of bytes to send | +| `length?` | `number` | This is no longer evaluated, and only here for backwards compatibility with old scripts [default = 0] | + +#### Returns + +`void` + +#### Defined in + +[midi-controller-api.d.ts:30](https://github.com/JoergAtGithub/mixxx/blob/8d2d71e396/res/controllers/midi-controller-api.d.ts#L30)