Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC Controller api docu #562

Draft
wants to merge 2 commits into
base: 2.4
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sphinxcontrib-svg2pdfconverter
sphinx-rtd-theme
sphinx-multiversion
./sphinx-mixxx
myst_parser
5 changes: 5 additions & 0 deletions source/chapters/advanced_topics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
1 change: 1 addition & 0 deletions source/chapters/controller_api/.nojekyll
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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)
Loading