/
HardwareSurface.js
185 lines (169 loc) · 5.67 KB
/
HardwareSurface.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/* API Version - 3.1.2 */
/**
* Represents a surface that can contain {@link HardwareElement}s such as {@link HardwareButton}s,
* {@link HardwareSlider}s, {@link MultiStateHardwareLight}s etc
*
* <p>
* This information allows Bitwig Studio to construct a reliable physical model of the hardware. This
* information can be used to simulate hardware being present even when physical hardware is not available
* (and may also be used for other purposes in the future).
*
* <p>
* To be able to simulate hardware being connected so that you can debug controllers without the real hardware
* you need to do the following:
*
* <p>
* Create a file with the name "config.json" in your user settings directory. The location of this directory
* is platform dependent:
*
* <ul>
* <li>On Windows: %LOCALAPPDATA%\Bitwig Studio
* <li>On macOS: Library/Application Support/Bitwig/Bitwig Studio
* <li>On Linux: $HOME/.BitwigStudio
* </ul>
*
* <p>
* Then add the following line to the config.json file:
*
* <pre>
* extension-dev : true
* </pre>
*
* <p>
* You will then need to restart Bitwig Studio. To simulate the controller being connected you can right click
* on the controller in the preferences and select "Simulate device connected".
*
* <p>
* If you have also provided physical positions for various {@link HardwareElement}s using
* {@link HardwareElement#setBounds(double, double, double, double)} then you can also see a GUI simulator for
* your controller by selecting "Show simulated hardware GUI".
*
* @since API version 10
*/
function HardwareSurface() {}
/**
* Creates a {@link HardwareSlider} that represents a physical slider on a controller.
*
* @param id
A unique string that identifies this control.
* @return {HardwareSlider}
* @since API version 10
*/
HardwareSurface.prototype.createHardwareSlider = function(id) {};
/**
* Creates an {@link AbsoluteHardwareKnob} that represents a physical knob on a controller that can be used
* to input an absolute value.
*
* @param id
A unique string that identifies this control.
* @return {AbsoluteHardwareKnob}
* @since API version 10
*/
HardwareSurface.prototype.createAbsoluteHardwareKnob = function(id) {};
/**
* Creates an {@link RelativeHardwareKnob} that represents a physical knob on a controller that can be used
* to input a relative value change.
*
* @param id
A unique string that identifies this control.
* @return {RelativeHardwareKnob}
* @since API version 10
*/
HardwareSurface.prototype.createRelativeHardwareKnob = function(id) {};
/**
* @param {string} id
* @param {int} numKeys
* @param {int} octave
* @param {int} startKeyInOctave
* @return {PianoKeyboard}
*/
HardwareSurface.prototype.createPianoKeyboard = function(id, numKeys, octave, startKeyInOctave) {};
/**
* Creates a {@link HardwareButton} that represents a physical button on a controller
*
* @param id
A unique string that identifies this control.
* @return {HardwareButton}
* @since API version 10
*/
HardwareSurface.prototype.createHardwareButton = function(id) {};
/**
* Creates a {@link OnOffHardwareLight} that represents a physical light on a controller
*
* @param {string} id
* @return {OnOffHardwareLight}
* @since API version 10
*/
HardwareSurface.prototype.createOnOffHardwareLight = function(id) {};
/**
* Creates a {@link MultiStateHardwareLight} that represents a physical light on a controller
*
* @param {string} id
* @return {MultiStateHardwareLight}
* @since API version 10
*/
HardwareSurface.prototype.createMultiStateHardwareLight = function(id) {};
/**
* Creates a {@link HardwareTextDisplay} that represents a physical text display on a controller
*
* @param {string} id
* @param {int} numLines
* @return {HardwareTextDisplay}
* @since API version 10
*/
HardwareSurface.prototype.createHardwareTextDisplay = function(id, numLines) {};
/**
* Creates a {@link HardwarePixelDisplay} that displays the provided {@link Bitmap} that is rendered by the
* controller.
*
* @param {string} id
* @param {Bitmap} bitmap
* @return {HardwarePixelDisplay}
* @since API version 10
*/
HardwareSurface.prototype.createHardwarePixelDisplay = function(id, bitmap) {};
/**
* Sets the physical size of this controller in mm.
*
* @param {double} widthInMM
* @param {double} heightInMM
* @since API version 10
*/
HardwareSurface.prototype.setPhysicalSize = function(widthInMM, heightInMM) {};
/**
* Updates the state of all {@link HardwareOutputElement}s that have changed since the last time this
* method was called.
*
* Any onUpdateHardware callbacks that have been registered on {@link HardwareOutputElement}s or
* {@link HardwareProperty}s will be invoked if their state/value has changed since the last time it was
* called.
*
* This is typically called by the control script from its flush method.
*
* @since API version 10
*/
HardwareSurface.prototype.updateHardware = function() {};
/**
* Mark all {@link HardwareOutputElement}s as needing to resend their output state, regardless of it has
* changed or not.
*/
HardwareSurface.prototype.invalidateHardwareOutputState = function() {};
/**
* A list of all the {@link HardwareControl}s that have been created on this {@link HardwareSurface}.
*
* @return {HardwareControl[]}
*/
HardwareSurface.prototype.hardwareControls = function() {};
/**
* Finds the {@link HardwareElement} that has the supplied id or null if not found.
*
* @param {string} id
* @return {HardwareElement}
*/
HardwareSurface.prototype.hardwareElementWithId = function(id) {};
/**
* List of all {@link HardwareElement}s on this {@link HardwareSurface}.
*
* @return {HardwareOutputElement[]}
*/
HardwareSurface.prototype.hardwareOutputElements = function() {};