alphatheta-connect 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +166 -0
- package/lib/artwork/index.d.ts +9 -0
- package/lib/artwork/parsers/aiff.d.ts +2 -0
- package/lib/artwork/parsers/flac.d.ts +2 -0
- package/lib/artwork/parsers/id3.d.ts +2 -0
- package/lib/artwork/parsers/index.d.ts +5 -0
- package/lib/artwork/parsers/mp4.d.ts +2 -0
- package/lib/artwork/parsers/utils.d.ts +3 -0
- package/lib/artwork/reader.d.ts +15 -0
- package/lib/artwork/types.d.ts +44 -0
- package/lib/cli/index.d.ts +1 -0
- package/lib/cli.js +11431 -0
- package/lib/cli.js.map +1 -0
- package/lib/constants.d.ts +40 -0
- package/lib/control/index.d.ts +20 -0
- package/lib/db/getArtworkFromFile.d.ts +13 -0
- package/lib/db/getArtworkThumbnail.d.ts +29 -0
- package/lib/db/getFile.d.ts +29 -0
- package/lib/db/getMetadata.d.ts +28 -0
- package/lib/db/getPlaylist.d.ts +26 -0
- package/lib/db/getWaveforms.d.ts +29 -0
- package/lib/db/index.d.ts +70 -0
- package/lib/db/utils.d.ts +7 -0
- package/lib/devices/index.d.ts +66 -0
- package/lib/devices/utils.d.ts +5 -0
- package/lib/entities.d.ts +122 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +13381 -0
- package/lib/index.js.map +1 -0
- package/lib/localdb/database-adapter.d.ts +49 -0
- package/lib/localdb/index.d.ts +104 -0
- package/lib/localdb/onelibrary-schema.d.ts +250 -0
- package/lib/localdb/onelibrary.d.ts +185 -0
- package/lib/localdb/orm.d.ts +60 -0
- package/lib/localdb/rekordbox.d.ts +112 -0
- package/lib/localdb/schema.d.ts +1 -0
- package/lib/localdb/utils.d.ts +5 -0
- package/lib/mixstatus/index.d.ts +109 -0
- package/lib/mixstatus/utils.d.ts +9 -0
- package/lib/network.d.ts +201 -0
- package/lib/nfs/index.d.ts +63 -0
- package/lib/nfs/programs.d.ts +61 -0
- package/lib/nfs/rpc.d.ts +60 -0
- package/lib/nfs/utils.d.ts +4 -0
- package/lib/nfs/xdr.d.ts +17 -0
- package/lib/passive/alphatheta.d.ts +94 -0
- package/lib/passive/devices.d.ts +64 -0
- package/lib/passive/index.d.ts +169 -0
- package/lib/passive/localdb.d.ts +122 -0
- package/lib/passive/pcap-adapter.d.ts +77 -0
- package/lib/passive/position.d.ts +32 -0
- package/lib/passive/remotedb.d.ts +49 -0
- package/lib/passive/status.d.ts +41 -0
- package/lib/remotedb/constants.d.ts +8 -0
- package/lib/remotedb/fields.d.ts +169 -0
- package/lib/remotedb/index.d.ts +160 -0
- package/lib/remotedb/message/index.d.ts +39 -0
- package/lib/remotedb/message/item.d.ts +530 -0
- package/lib/remotedb/message/response.d.ts +18 -0
- package/lib/remotedb/message/types.d.ts +227 -0
- package/lib/remotedb/queries.d.ts +99 -0
- package/lib/remotedb/utils.d.ts +23 -0
- package/lib/status/index.d.ts +39 -0
- package/lib/status/media.d.ts +22 -0
- package/lib/status/position.d.ts +29 -0
- package/lib/status/types.d.ts +170 -0
- package/lib/status/utils.d.ts +19 -0
- package/lib/types.d.ts +457 -0
- package/lib/types.js +274 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/converters.d.ts +17 -0
- package/lib/utils/index.d.ts +28 -0
- package/lib/utils/telemetry.d.ts +82 -0
- package/lib/utils/udp.d.ts +20 -0
- package/lib/virtualcdj/index.d.ts +33 -0
- package/package.json +93 -0
package/lib/types.js
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ "./src/status/types.ts"
|
|
6
|
+
/*!*****************************!*\
|
|
7
|
+
!*** ./src/status/types.ts ***!
|
|
8
|
+
\*****************************/
|
|
9
|
+
(__unused_webpack_module, exports) {
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13
|
+
exports.PlayState = exports.StatusFlag = void 0;
|
|
14
|
+
/**
|
|
15
|
+
* Status flag bitmasks
|
|
16
|
+
*/
|
|
17
|
+
var StatusFlag;
|
|
18
|
+
(function (StatusFlag) {
|
|
19
|
+
StatusFlag[StatusFlag["OnAir"] = 8] = "OnAir";
|
|
20
|
+
StatusFlag[StatusFlag["Sync"] = 16] = "Sync";
|
|
21
|
+
StatusFlag[StatusFlag["Master"] = 32] = "Master";
|
|
22
|
+
StatusFlag[StatusFlag["Playing"] = 64] = "Playing";
|
|
23
|
+
})(StatusFlag || (exports.StatusFlag = StatusFlag = {}));
|
|
24
|
+
/**
|
|
25
|
+
* Play state flags
|
|
26
|
+
*/
|
|
27
|
+
var PlayState;
|
|
28
|
+
(function (PlayState) {
|
|
29
|
+
PlayState[PlayState["Empty"] = 0] = "Empty";
|
|
30
|
+
PlayState[PlayState["Loading"] = 2] = "Loading";
|
|
31
|
+
PlayState[PlayState["Playing"] = 3] = "Playing";
|
|
32
|
+
PlayState[PlayState["Looping"] = 4] = "Looping";
|
|
33
|
+
PlayState[PlayState["Paused"] = 5] = "Paused";
|
|
34
|
+
PlayState[PlayState["Cued"] = 6] = "Cued";
|
|
35
|
+
PlayState[PlayState["Cuing"] = 7] = "Cuing";
|
|
36
|
+
PlayState[PlayState["PlatterHeld"] = 8] = "PlatterHeld";
|
|
37
|
+
PlayState[PlayState["Searching"] = 9] = "Searching";
|
|
38
|
+
PlayState[PlayState["SpunDown"] = 14] = "SpunDown";
|
|
39
|
+
PlayState[PlayState["Ended"] = 17] = "Ended";
|
|
40
|
+
})(PlayState || (exports.PlayState = PlayState = {}));
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/***/ },
|
|
44
|
+
|
|
45
|
+
/***/ "./src/types.ts"
|
|
46
|
+
/*!**********************!*\
|
|
47
|
+
!*** ./src/types.ts ***!
|
|
48
|
+
\**********************/
|
|
49
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
53
|
+
if (k2 === undefined) k2 = k;
|
|
54
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
55
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
56
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
57
|
+
}
|
|
58
|
+
Object.defineProperty(o, k2, desc);
|
|
59
|
+
}) : (function(o, m, k, k2) {
|
|
60
|
+
if (k2 === undefined) k2 = k;
|
|
61
|
+
o[k2] = m[k];
|
|
62
|
+
}));
|
|
63
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
64
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
65
|
+
}) : function(o, v) {
|
|
66
|
+
o["default"] = v;
|
|
67
|
+
});
|
|
68
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
69
|
+
var ownKeys = function(o) {
|
|
70
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
71
|
+
var ar = [];
|
|
72
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
73
|
+
return ar;
|
|
74
|
+
};
|
|
75
|
+
return ownKeys(o);
|
|
76
|
+
};
|
|
77
|
+
return function (mod) {
|
|
78
|
+
if (mod && mod.__esModule) return mod;
|
|
79
|
+
var result = {};
|
|
80
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
81
|
+
__setModuleDefault(result, mod);
|
|
82
|
+
return result;
|
|
83
|
+
};
|
|
84
|
+
})();
|
|
85
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
86
|
+
exports.MixstatusMode = exports.NetworkState = exports.CueColor = exports.HotcueButton = exports.TrackType = exports.MediaSlot = exports.MediaColor = exports.DeviceType = exports.CDJStatus = void 0;
|
|
87
|
+
exports.CDJStatus = __importStar(__webpack_require__(/*! src/status/types */ "./src/status/types.ts"));
|
|
88
|
+
/**
|
|
89
|
+
* Known device types on the network
|
|
90
|
+
*/
|
|
91
|
+
var DeviceType;
|
|
92
|
+
(function (DeviceType) {
|
|
93
|
+
DeviceType[DeviceType["CDJ"] = 1] = "CDJ";
|
|
94
|
+
DeviceType[DeviceType["Mixer"] = 3] = "Mixer";
|
|
95
|
+
DeviceType[DeviceType["Rekordbox"] = 4] = "Rekordbox";
|
|
96
|
+
})(DeviceType || (exports.DeviceType = DeviceType = {}));
|
|
97
|
+
var MediaColor;
|
|
98
|
+
(function (MediaColor) {
|
|
99
|
+
MediaColor[MediaColor["Default"] = 0] = "Default";
|
|
100
|
+
MediaColor[MediaColor["Pink"] = 1] = "Pink";
|
|
101
|
+
MediaColor[MediaColor["Red"] = 2] = "Red";
|
|
102
|
+
MediaColor[MediaColor["Orange"] = 3] = "Orange";
|
|
103
|
+
MediaColor[MediaColor["Yellow"] = 4] = "Yellow";
|
|
104
|
+
MediaColor[MediaColor["Green"] = 5] = "Green";
|
|
105
|
+
MediaColor[MediaColor["Aqua"] = 6] = "Aqua";
|
|
106
|
+
MediaColor[MediaColor["Blue"] = 7] = "Blue";
|
|
107
|
+
MediaColor[MediaColor["Purple"] = 8] = "Purple";
|
|
108
|
+
})(MediaColor || (exports.MediaColor = MediaColor = {}));
|
|
109
|
+
/**
|
|
110
|
+
* A slot where media is present on the CDJ
|
|
111
|
+
*/
|
|
112
|
+
var MediaSlot;
|
|
113
|
+
(function (MediaSlot) {
|
|
114
|
+
MediaSlot[MediaSlot["Empty"] = 0] = "Empty";
|
|
115
|
+
MediaSlot[MediaSlot["CD"] = 1] = "CD";
|
|
116
|
+
MediaSlot[MediaSlot["SD"] = 2] = "SD";
|
|
117
|
+
MediaSlot[MediaSlot["USB"] = 3] = "USB";
|
|
118
|
+
MediaSlot[MediaSlot["RB"] = 4] = "RB";
|
|
119
|
+
})(MediaSlot || (exports.MediaSlot = MediaSlot = {}));
|
|
120
|
+
/**
|
|
121
|
+
* Track type flags
|
|
122
|
+
*/
|
|
123
|
+
var TrackType;
|
|
124
|
+
(function (TrackType) {
|
|
125
|
+
TrackType[TrackType["None"] = 0] = "None";
|
|
126
|
+
TrackType[TrackType["RB"] = 1] = "RB";
|
|
127
|
+
TrackType[TrackType["Unanalyzed"] = 2] = "Unanalyzed";
|
|
128
|
+
TrackType[TrackType["AudioCD"] = 5] = "AudioCD";
|
|
129
|
+
})(TrackType || (exports.TrackType = TrackType = {}));
|
|
130
|
+
/**
|
|
131
|
+
* A hotcue button label
|
|
132
|
+
*/
|
|
133
|
+
var HotcueButton;
|
|
134
|
+
(function (HotcueButton) {
|
|
135
|
+
HotcueButton[HotcueButton["A"] = 1] = "A";
|
|
136
|
+
HotcueButton[HotcueButton["B"] = 2] = "B";
|
|
137
|
+
HotcueButton[HotcueButton["C"] = 3] = "C";
|
|
138
|
+
HotcueButton[HotcueButton["D"] = 4] = "D";
|
|
139
|
+
HotcueButton[HotcueButton["E"] = 5] = "E";
|
|
140
|
+
HotcueButton[HotcueButton["F"] = 6] = "F";
|
|
141
|
+
HotcueButton[HotcueButton["G"] = 7] = "G";
|
|
142
|
+
HotcueButton[HotcueButton["H"] = 8] = "H";
|
|
143
|
+
})(HotcueButton || (exports.HotcueButton = HotcueButton = {}));
|
|
144
|
+
/**
|
|
145
|
+
* When a custom color is not configured the cue point will be one of these
|
|
146
|
+
* colors.
|
|
147
|
+
*/
|
|
148
|
+
var CueColor;
|
|
149
|
+
(function (CueColor) {
|
|
150
|
+
CueColor[CueColor["None"] = 0] = "None";
|
|
151
|
+
CueColor[CueColor["Blank"] = 21] = "Blank";
|
|
152
|
+
CueColor[CueColor["Magenta"] = 49] = "Magenta";
|
|
153
|
+
CueColor[CueColor["Violet"] = 56] = "Violet";
|
|
154
|
+
CueColor[CueColor["Fuchsia"] = 60] = "Fuchsia";
|
|
155
|
+
CueColor[CueColor["LightSlateBlue"] = 62] = "LightSlateBlue";
|
|
156
|
+
CueColor[CueColor["Blue"] = 1] = "Blue";
|
|
157
|
+
CueColor[CueColor["SteelBlue"] = 5] = "SteelBlue";
|
|
158
|
+
CueColor[CueColor["Aqua"] = 9] = "Aqua";
|
|
159
|
+
CueColor[CueColor["SeaGreen"] = 14] = "SeaGreen";
|
|
160
|
+
CueColor[CueColor["Teal"] = 18] = "Teal";
|
|
161
|
+
CueColor[CueColor["Green"] = 22] = "Green";
|
|
162
|
+
CueColor[CueColor["Lime"] = 26] = "Lime";
|
|
163
|
+
CueColor[CueColor["Olive"] = 30] = "Olive";
|
|
164
|
+
CueColor[CueColor["Yellow"] = 32] = "Yellow";
|
|
165
|
+
CueColor[CueColor["Orange"] = 38] = "Orange";
|
|
166
|
+
CueColor[CueColor["Red"] = 42] = "Red";
|
|
167
|
+
CueColor[CueColor["Pink"] = 45] = "Pink";
|
|
168
|
+
})(CueColor || (exports.CueColor = CueColor = {}));
|
|
169
|
+
var NetworkState;
|
|
170
|
+
(function (NetworkState) {
|
|
171
|
+
/**
|
|
172
|
+
* The network is offline when we don't have an open connection to the network
|
|
173
|
+
* (no connection to the announcement and or status UDP socket is present).
|
|
174
|
+
*/
|
|
175
|
+
NetworkState[NetworkState["Offline"] = 0] = "Offline";
|
|
176
|
+
/**
|
|
177
|
+
* The network is online when we have opened sockets to the network, but have
|
|
178
|
+
* not yet started announcing ourselves as a virtual CDJ.
|
|
179
|
+
*/
|
|
180
|
+
NetworkState[NetworkState["Online"] = 1] = "Online";
|
|
181
|
+
/**
|
|
182
|
+
* The network is connected once we have heard from another device on the network
|
|
183
|
+
*/
|
|
184
|
+
NetworkState[NetworkState["Connected"] = 2] = "Connected";
|
|
185
|
+
/**
|
|
186
|
+
* The network may have failed to connect if we aren't able to open the
|
|
187
|
+
* announcement and or status UDP socket.
|
|
188
|
+
*/
|
|
189
|
+
NetworkState[NetworkState["Failed"] = 3] = "Failed";
|
|
190
|
+
})(NetworkState || (exports.NetworkState = NetworkState = {}));
|
|
191
|
+
/**
|
|
192
|
+
* Mixstatus reporting modes specify how the mixstatus processor will determine when a new
|
|
193
|
+
* track is 'now playing'.
|
|
194
|
+
*/
|
|
195
|
+
var MixstatusMode;
|
|
196
|
+
(function (MixstatusMode) {
|
|
197
|
+
/**
|
|
198
|
+
* Tracks will be smartly marked as playing following rules:
|
|
199
|
+
*
|
|
200
|
+
* - The track that has been in the play state with the CDJ in the "on air" state
|
|
201
|
+
* for the longest period of time (allowing for a configurable length of
|
|
202
|
+
* interruption with allowedInterruptBeats) is considered to be the active
|
|
203
|
+
* track that incoming tracks will be compared against.
|
|
204
|
+
*
|
|
205
|
+
* - A incoming track will immediately be reported as nowPlaying if it is on
|
|
206
|
+
* air, playing, and the last active track has been cued.
|
|
207
|
+
*
|
|
208
|
+
* - A incoming track will be reported as nowPlaying if the active track has
|
|
209
|
+
* not been on air or has not been playing for the configured
|
|
210
|
+
* allowedInterruptBeats.
|
|
211
|
+
*
|
|
212
|
+
* - A incoming track will be reported as nowPlaying if it has played
|
|
213
|
+
* consecutively (with allowedInterruptBeats honored for the incoming track)
|
|
214
|
+
* for the configured beatsUntilReported.
|
|
215
|
+
*/
|
|
216
|
+
MixstatusMode[MixstatusMode["SmartTiming"] = 0] = "SmartTiming";
|
|
217
|
+
/**
|
|
218
|
+
* Tracks will not be reported after the beatsUntilReported AND will ONLY
|
|
219
|
+
* be reported if the other track has gone into a non-playing play state, or
|
|
220
|
+
* taken off air (when useOnAirStatus is enabled).
|
|
221
|
+
*/
|
|
222
|
+
MixstatusMode[MixstatusMode["WaitsForSilence"] = 1] = "WaitsForSilence";
|
|
223
|
+
/**
|
|
224
|
+
* The track will simply be reported only after the player becomes master.
|
|
225
|
+
*/
|
|
226
|
+
MixstatusMode[MixstatusMode["FollowsMaster"] = 2] = "FollowsMaster";
|
|
227
|
+
})(MixstatusMode || (exports.MixstatusMode = MixstatusMode = {}));
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
/***/ }
|
|
231
|
+
|
|
232
|
+
/******/ });
|
|
233
|
+
/************************************************************************/
|
|
234
|
+
/******/ // The module cache
|
|
235
|
+
/******/ var __webpack_module_cache__ = {};
|
|
236
|
+
/******/
|
|
237
|
+
/******/ // The require function
|
|
238
|
+
/******/ function __webpack_require__(moduleId) {
|
|
239
|
+
/******/ // Check if module is in cache
|
|
240
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
241
|
+
/******/ if (cachedModule !== undefined) {
|
|
242
|
+
/******/ return cachedModule.exports;
|
|
243
|
+
/******/ }
|
|
244
|
+
/******/ // Check if module exists (development only)
|
|
245
|
+
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
246
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
247
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
248
|
+
/******/ throw e;
|
|
249
|
+
/******/ }
|
|
250
|
+
/******/ // Create a new module (and put it into the cache)
|
|
251
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
252
|
+
/******/ // no module.id needed
|
|
253
|
+
/******/ // no module.loaded needed
|
|
254
|
+
/******/ exports: {}
|
|
255
|
+
/******/ };
|
|
256
|
+
/******/
|
|
257
|
+
/******/ // Execute the module function
|
|
258
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
259
|
+
/******/
|
|
260
|
+
/******/ // Return the exports of the module
|
|
261
|
+
/******/ return module.exports;
|
|
262
|
+
/******/ }
|
|
263
|
+
/******/
|
|
264
|
+
/************************************************************************/
|
|
265
|
+
/******/
|
|
266
|
+
/******/ // startup
|
|
267
|
+
/******/ // Load entry module and return exports
|
|
268
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
269
|
+
/******/ var __webpack_exports__ = __webpack_require__("./src/types.ts");
|
|
270
|
+
/******/ module.exports = __webpack_exports__;
|
|
271
|
+
/******/
|
|
272
|
+
/******/ })()
|
|
273
|
+
;
|
|
274
|
+
//# sourceMappingURL=types.js.map
|
package/lib/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","mappings":";;;;;;;;;;;;;AAEA;;GAEG;AACH,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,6CAAc;IACd,4CAAa;IACb,gDAAe;IACf,kDAAgB;AAClB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAED;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,2CAAY;IACZ,+CAAc;IACd,+CAAc;IACd,+CAAc;IACd,6CAAa;IACb,yCAAW;IACX,2CAAY;IACZ,uDAAkB;IAClB,mDAAgB;IAChB,kDAAe;IACf,4CAAY;AACd,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvBD,uGAA8C;AAwB9C;;GAEG;AACH,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,yCAAU;IACV,6CAAY;IACZ,qDAAgB;AAClB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAsED,IAAY,UAUX;AAVD,WAAY,UAAU;IACpB,iDAAc;IACd,2CAAW;IACX,yCAAU;IACV,+CAAa;IACb,+CAAa;IACb,6CAAY;IACZ,2CAAW;IACX,2CAAW;IACX,+CAAa;AACf,CAAC,EAVW,UAAU,0BAAV,UAAU,QAUrB;AAED;;GAEG;AACH,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,2CAAY;IACZ,qCAAS;IACT,qCAAS;IACT,uCAAU;IACV,qCAAS;AACX,CAAC,EANW,SAAS,yBAAT,SAAS,QAMpB;AAED;;GAEG;AACH,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,yCAAW;IACX,qCAAS;IACT,qDAAiB;IACjB,+CAAc;AAChB,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB;AAgFD;;GAEG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB,yCAAK;IACL,yCAAC;IACD,yCAAC;IACD,yCAAC;IACD,yCAAC;IACD,yCAAC;IACD,yCAAC;IACD,yCAAC;AACH,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB;AAED;;;GAGG;AACH,IAAY,QAmBX;AAnBD,WAAY,QAAQ;IAClB,uCAAW;IACX,0CAAY;IACZ,8CAAc;IACd,4CAAa;IACb,8CAAc;IACd,4DAAqB;IACrB,uCAAW;IACX,iDAAgB;IAChB,uCAAW;IACX,gDAAe;IACf,wCAAW;IACX,0CAAY;IACZ,wCAAW;IACX,0CAAY;IACZ,4CAAa;IACb,4CAAa;IACb,sCAAU;IACV,wCAAW;AACb,CAAC,EAnBW,QAAQ,wBAAR,QAAQ,QAmBnB;AAoMD,IAAY,YAoBX;AApBD,WAAY,YAAY;IACtB;;;OAGG;IACH,qDAAO;IACP;;;OAGG;IACH,mDAAM;IACN;;OAEG;IACH,yDAAS;IACT;;;OAGG;IACH,mDAAM;AACR,CAAC,EApBW,YAAY,4BAAZ,YAAY,QAoBvB;AAED;;;GAGG;AACH,IAAY,aA+BX;AA/BD,WAAY,aAAa;IACvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,+DAAW;IACX;;;;OAIG;IACH,uEAAe;IACf;;OAEG;IACH,mEAAa;AACf,CAAC,EA/BW,aAAa,6BAAb,aAAa,QA+BxB;;;;;;;UC1fD;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UE5BA;UACA;UACA;UACA","sources":["webpack://alphatheta-connect/./src/status/types.ts","webpack://alphatheta-connect/./src/types.ts","webpack://alphatheta-connect/webpack/bootstrap","webpack://alphatheta-connect/webpack/before-startup","webpack://alphatheta-connect/webpack/startup","webpack://alphatheta-connect/webpack/after-startup"],"sourcesContent":["import {DeviceID, MediaSlot, TrackType} from 'src/types';\n\n/**\n * Status flag bitmasks\n */\nexport enum StatusFlag {\n OnAir = 1 << 3,\n Sync = 1 << 4,\n Master = 1 << 5,\n Playing = 1 << 6,\n}\n\n/**\n * Play state flags\n */\nexport enum PlayState {\n Empty = 0x00,\n Loading = 0x02,\n Playing = 0x03,\n Looping = 0x04,\n Paused = 0x05,\n Cued = 0x06,\n Cuing = 0x07,\n PlatterHeld = 0x08,\n Searching = 0x09,\n SpunDown = 0x0e,\n Ended = 0x11,\n}\n\n/**\n * Represents various details about the current state of the CDJ.\n */\nexport interface State {\n /**\n * The device reporting this status.\n */\n deviceId: number;\n /**\n * The ID of the track loaded on the device.\n *\n * 0 When no track is loaded.\n */\n trackId: number;\n /**\n * The device ID the track is loaded from.\n *\n * For example if you have two CDJs and you've loaded a track over the 'LINK',\n * this will be the ID of the player with the USB media device connected to it.\n */\n trackDeviceId: DeviceID;\n /**\n * The MediaSlot the track is loaded from. For example a SD card or USB device.\n */\n trackSlot: MediaSlot;\n /**\n * The TrackType of the track, for example a CD or Rekordbox analyzed track.\n */\n trackType: TrackType;\n /**\n * The current play state of the CDJ.\n */\n playState: PlayState;\n /**\n * Whether the CDJ is currently reporting itself as 'on-air'.\n *\n * This is indicated by the red ring around the platter on the CDJ Nexus models.\n * A DJM mixer must be ont he network for the CDJ to report this as true.\n */\n isOnAir: boolean;\n /**\n * Whether the CDJ is synced.\n */\n isSync: boolean;\n /**\n * Whether the CDJ is the master player.\n */\n isMaster: boolean;\n /**\n * Whether the CDJ is in an emergency state (emergecy loop / emergency mode\n * on newer players)\n */\n isEmergencyMode: boolean;\n /**\n * The BPM of the loaded track. null if no track is loaded or the BPM is unknown.\n */\n trackBPM: number | null;\n /**\n * The \"effective\" pitch of the plyaer. This is reported anytime the jogwheel is\n * nudged, the CDJ spins down by pausing with the vinyl stop knob not at 0, or\n * by holding the platter.\n */\n effectivePitch: number;\n /**\n * The current slider pitch\n */\n sliderPitch: number;\n /**\n * The current beat within the measure. 1-4. 0 when no track is loaded.\n */\n beatInMeasure: number;\n /**\n * Number of beats remaining until the next cue point is reached. Null if there\n * is no next cue point\n */\n beatsUntilCue: number | null;\n /**\n * The beat 'timestamp' of the track. Can be used to compute absolute track time\n * given the slider pitch.\n */\n beat: number | null;\n /**\n * A counter that increments for every status packet sent.\n */\n packetNum: number;\n}\n\n/**\n * Absolute position information from CDJ-3000+ devices.\n * Sent every 30ms on port 50001 while a track is loaded.\n * Provides precise playhead position independent of beat grid.\n */\nexport interface PositionState {\n /**\n * The device ID sending this position update.\n */\n deviceId: number;\n /**\n * Track length in seconds (rounded down to nearest second).\n */\n trackLength: number;\n /**\n * Absolute playhead position in milliseconds.\n */\n playhead: number;\n /**\n * Pitch slider value as shown on screen.\n * For example, 3.26% is represented as 3.26.\n */\n pitch: number;\n /**\n * Effective BPM (track BPM adjusted by pitch) as shown on screen.\n * null if BPM is unknown.\n */\n bpm: number | null;\n}\n\n/**\n * On-Air status from DJM mixer.\n * Broadcast by the mixer to indicate which channels are currently audible.\n * Supports both 4-channel (DJM-900/1000) and 6-channel (DJM-V10) mixers.\n */\nexport interface OnAirStatus {\n /**\n * The mixer device ID (typically 33 / 0x21).\n */\n deviceId: number;\n /**\n * On-air flags for channels 1-4 (always present).\n * 0x00 = channel is off-air (silenced)\n * 0x01 = channel is on-air (audible)\n */\n channels: {\n 1: boolean;\n 2: boolean;\n 3: boolean;\n 4: boolean;\n 5?: boolean;\n 6?: boolean;\n };\n /**\n * Whether this is a 6-channel variant (CDJ-3000 + DJM-V10).\n * Determined by packet subtype (0x00 = 4-channel, 0x03 = 6-channel).\n */\n isSixChannel: boolean;\n}\n","import type {Address4} from 'ip-address';\n\nimport type {Playlist, Track} from './entities';\n\nexport * as CDJStatus from 'src/status/types';\n\n/**\n * Re-export various types for the types only compile target\n */\n\nexport type {\n Album,\n Artist,\n Artwork,\n Color,\n Genre,\n Key,\n Label,\n Playlist,\n Track,\n} from './entities';\nexport type {HydrationProgress} from './localdb/rekordbox';\nexport type {MixstatusConfig, MixstatusProcessor} from './mixstatus';\n// Note: ProlinkNetwork is exported as a class from ./network, not re-exported here as type-only\n// to preserve method signatures like close()\nexport type {ConnectedProlinkNetwork, NetworkConfig} from './network';\nexport type {FetchProgress} from './nfs';\n\n/**\n * Known device types on the network\n */\nexport enum DeviceType {\n CDJ = 0x01,\n Mixer = 0x03,\n Rekordbox = 0x04,\n}\n\n/**\n * The 8-bit identifier of the device on the network\n */\nexport type DeviceID = number;\n\n/**\n * Represents a device on the prolink network.\n */\nexport interface Device {\n name: string;\n id: DeviceID;\n type: DeviceType;\n macAddr: Uint8Array;\n ip: Address4;\n lastActive?: Date;\n}\n\n/**\n * Details of a particular media slot on the CDJ\n */\nexport interface MediaSlotInfo {\n /**\n * The device the slot physically exists on\n */\n deviceId: DeviceID;\n /**\n * The slot type\n */\n slot: MediaSlot;\n /**\n * The name of the media connected\n */\n name: string;\n /**\n * The rekordbox configured color of the media connected\n */\n color: MediaColor;\n /**\n * Creation date\n */\n createdDate: Date;\n /**\n * Number of free bytes available on the media\n */\n freeBytes: bigint;\n /**\n * Number of bytes used on the media\n */\n totalBytes: bigint;\n /**\n * Specifies the available tracks type on the media\n */\n tracksType: TrackType;\n /**\n * Total number of rekordbox tracks on the media. Will be zero if there is\n * no rekordbox database on the media\n */\n trackCount: number;\n /**\n * Same as track count, except for playlists\n */\n playlistCount: number;\n /**\n * True when a rekordbox 'my settings' file has been exported to the media\n */\n hasSettings: boolean;\n}\n\nexport enum MediaColor {\n Default = 0x00,\n Pink = 0x01,\n Red = 0x02,\n Orange = 0x03,\n Yellow = 0x04,\n Green = 0x05,\n Aqua = 0x06,\n Blue = 0x07,\n Purple = 0x08,\n}\n\n/**\n * A slot where media is present on the CDJ\n */\nexport enum MediaSlot {\n Empty = 0x00,\n CD = 0x01,\n SD = 0x02,\n USB = 0x03,\n RB = 0x04,\n}\n\n/**\n * Track type flags\n */\nexport enum TrackType {\n None = 0x00,\n RB = 0x01,\n Unanalyzed = 0x02,\n AudioCD = 0x05,\n}\n\n/**\n * A beat grid is a series of offsets from the start of the track. Each offset\n * indicates what count within the measure it is along with the BPM.\n */\nexport type BeatGrid = Array<{\n /**\n * Offset from the beginning of track in milliseconds of this beat.\n */\n offset: number;\n /**\n * The count of this particular beat within the measure\n */\n count: 1 | 2 | 3 | 4;\n /**\n * The BPM at this beat.\n */\n bpm: number;\n}>;\n\n/**\n * A waveform segment contains a height and 'whiteness' value.\n */\ninterface WaveformSegment {\n /**\n * The height this segment in the waveform. Ranges from 0 - 31.\n */\n height: number;\n /**\n * The level of \"whiteness\" of the waveform. 0 being completely blue, and 1\n * being completely white.\n */\n whiteness: number;\n}\n\n/**\n * A HD waveform segment contains the height of the waveform, and it's color\n * represented as RGB values.\n */\ninterface WaveformHDSegment {\n /**\n * The height this segment in the waveform. Ranges from 0 - 31.\n */\n height: number;\n /**\n * the RGB value, each channel ranges from 0-1 for the segment.\n */\n color: [number, number, number];\n}\n\n/**\n * The waveform preview will be 400 segments of data.\n */\nexport type WaveformPreview = WaveformSegment[];\n\n/**\n * Detailed waveforms have 150 segments per second of audio (150 'half frames'\n * per second of audio).\n */\nexport type WaveformDetailed = WaveformSegment[];\n\n/**\n * HD waveforms have 150 segments per second of audio (150 'half frames' per\n * second of audio).\n */\nexport type WaveformHD = WaveformHDSegment[];\n\n/**\n * The result of looking up track waveforms\n */\nexport interface Waveforms {\n /**\n * The full-size and full-color waveform\n */\n waveformHd: WaveformHD;\n\n // TODO: Add other waveform types\n}\n\n/**\n * A hotcue button label\n */\nexport enum HotcueButton {\n A = 1,\n B,\n C,\n D,\n E,\n F,\n G,\n H,\n}\n\n/**\n * When a custom color is not configured the cue point will be one of these\n * colors.\n */\nexport enum CueColor {\n None = 0x00,\n Blank = 0x15,\n Magenta = 0x31,\n Violet = 0x38,\n Fuchsia = 0x3c,\n LightSlateBlue = 0x3e,\n Blue = 0x01,\n SteelBlue = 0x05,\n Aqua = 0x09,\n SeaGreen = 0x0e,\n Teal = 0x12,\n Green = 0x16,\n Lime = 0x1a,\n Olive = 0x1e,\n Yellow = 0x20,\n Orange = 0x26,\n Red = 0x2a,\n Pink = 0x2d,\n}\n\n/**\n * Represents a single cue point. On older exports the label and color may be\n * undefined.\n */\nexport interface CuePoint {\n type: 'cue_point';\n /**\n * Number of milliseconds from the start of the track.\n */\n offset: number;\n /**\n * The comment associated to the cue point\n */\n label?: string;\n /**\n * RGB values of the hotcue color\n */\n color?: CueColor;\n}\n\ntype BareCuePoint = Omit<CuePoint, 'type'>;\n\n/**\n * A loop, similar to a cue point, but includes a length.\n */\nexport type Loop = BareCuePoint & {\n type: 'loop';\n /**\n * The length in milliseconds of the loop\n */\n length: number;\n};\n\n/**\n * A hotcue is like a cue point, but also includes the button it is assigned to.\n */\nexport type Hotcue = BareCuePoint & {\n type: 'hot_cue';\n /**\n * Which hotcue button this hotcue is assigned to.\n */\n button: HotcueButton;\n};\n\n/**\n * A hot loop, this is the union of a hotcue and a loop.\n */\nexport type Hotloop = {type: 'hot_loop'} & (Omit<Hotcue, 'type'> & Omit<Loop, 'type'>);\n\nexport type CueAndLoop = CuePoint | Loop | Hotcue | Hotloop;\n\n/**\n * Extended cue with color and comment support (PCO2 tag from rekordbox).\n * Includes additional metadata like RGB colors, comments, and quantized loop information.\n */\nexport interface ExtendedCue {\n /**\n * Hot cue number (0 for memory points, 1-8 for hot cues A-H)\n */\n hotCue: number;\n /**\n * Type of cue: 1 = simple position/cue, 2 = loop\n */\n type: 1 | 2;\n /**\n * Position in milliseconds from the start of the track\n */\n time: number;\n /**\n * For loops, the end position in milliseconds\n */\n loopTime?: number;\n /**\n * Color ID referencing the color table (for memory points/loops)\n */\n colorId?: number;\n /**\n * Color code for the hot cue palette (0x00 = default green, 0x01-0x3e = palette colors)\n */\n colorCode?: number;\n /**\n * RGB color values used to illuminate the player's RGB LEDs\n */\n colorRgb?: {r: number; g: number; b: number};\n /**\n * User-assigned comment text for the cue\n */\n comment?: string;\n /**\n * For quantized loops, the numerator of the loop size fraction (e.g., 4 for a 4-beat loop)\n */\n loopNumerator?: number;\n /**\n * For quantized loops, the denominator of the loop size fraction (e.g., 1 for a 4-beat loop)\n */\n loopDenominator?: number;\n}\n\n/**\n * A phrase within a track's song structure\n */\nexport interface Phrase {\n /**\n * Sequential phrase number starting from 1\n */\n index: number;\n /**\n * Beat number where this phrase begins\n */\n beat: number;\n /**\n * Raw phrase kind value from rekordbox\n */\n kind: number;\n /**\n * Human-readable phrase type (e.g., \"Intro\", \"Verse 1\", \"Chorus\")\n */\n phraseType: string;\n /**\n * Whether this phrase has a fill-in section (non-zero if present)\n */\n fill?: number;\n /**\n * Beat number where the fill-in begins (if present)\n */\n fillBeat?: number;\n}\n\n/**\n * Song structure / phrase analysis (PSSI tag from rekordbox).\n * Used by CDJ-3000 players for phrase-based navigation and lighting control.\n */\nexport interface SongStructure {\n /**\n * Overall mood classification of the track\n */\n mood: 'high' | 'mid' | 'low';\n /**\n * Stylistic bank assigned for lighting control\n */\n bank:\n | 'default'\n | 'cool'\n | 'natural'\n | 'hot'\n | 'subtle'\n | 'warm'\n | 'vivid'\n | 'club_1'\n | 'club_2';\n /**\n * Beat number where the last phrase ends (track may continue after this)\n */\n endBeat: number;\n /**\n * List of identified phrases in the track\n */\n phrases: Phrase[];\n}\n\n/**\n * Monochrome waveform preview data (PWAV/PWV2 tags).\n * PWAV contains 400 bytes, PWV2 contains 100 bytes.\n */\nexport interface WaveformPreviewData {\n /**\n * Raw waveform data - each byte encodes height and whiteness\n */\n data: Uint8Array;\n}\n\n/**\n * Represents the contents of a playlist\n */\nexport interface PlaylistContents {\n /**\n * The playlists in this playlist.\n */\n playlists: Playlist[];\n /**\n * The folders in this playlist.\n */\n folders: Playlist[];\n /**\n * The tracks in this playlist. This is an AsyncIterator as looking up track\n * metadata may be slow when connected to the remote database.\n */\n tracks: AsyncIterable<Track>;\n /**\n * The total number of tracks in this playlist.\n */\n totalTracks: number;\n}\n\nexport enum NetworkState {\n /**\n * The network is offline when we don't have an open connection to the network\n * (no connection to the announcement and or status UDP socket is present).\n */\n Offline,\n /**\n * The network is online when we have opened sockets to the network, but have\n * not yet started announcing ourselves as a virtual CDJ.\n */\n Online,\n /**\n * The network is connected once we have heard from another device on the network\n */\n Connected,\n /**\n * The network may have failed to connect if we aren't able to open the\n * announcement and or status UDP socket.\n */\n Failed,\n}\n\n/**\n * Mixstatus reporting modes specify how the mixstatus processor will determine when a new\n * track is 'now playing'.\n */\nexport enum MixstatusMode {\n /**\n * Tracks will be smartly marked as playing following rules:\n *\n * - The track that has been in the play state with the CDJ in the \"on air\" state\n * for the longest period of time (allowing for a configurable length of\n * interruption with allowedInterruptBeats) is considered to be the active\n * track that incoming tracks will be compared against.\n *\n * - A incoming track will immediately be reported as nowPlaying if it is on\n * air, playing, and the last active track has been cued.\n *\n * - A incoming track will be reported as nowPlaying if the active track has\n * not been on air or has not been playing for the configured\n * allowedInterruptBeats.\n *\n * - A incoming track will be reported as nowPlaying if it has played\n * consecutively (with allowedInterruptBeats honored for the incoming track)\n * for the configured beatsUntilReported.\n */\n SmartTiming,\n /**\n * Tracks will not be reported after the beatsUntilReported AND will ONLY\n * be reported if the other track has gone into a non-playing play state, or\n * taken off air (when useOnAirStatus is enabled).\n */\n WaitsForSilence,\n /**\n * The track will simply be reported only after the player becomes master.\n */\n FollowsMaster,\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Check if module exists (development only)\n\tif (__webpack_modules__[moduleId] === undefined) {\n\t\tvar e = new Error(\"Cannot find module '\" + moduleId + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/types.ts\");\n",""],"names":[],"ignoreList":[],"sourceRoot":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WaveformHD } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Extracts a specific bitmask, shifting it to the bitmask.
|
|
4
|
+
*/
|
|
5
|
+
export declare const extractBitMask: (val: number, mask: number) => number;
|
|
6
|
+
/**
|
|
7
|
+
* Pioneer colors are 3 bits, convert this to a percentage.
|
|
8
|
+
*/
|
|
9
|
+
export declare const extractColor: (val: number, mask: number) => number;
|
|
10
|
+
/**
|
|
11
|
+
* Utility to generate an filled with byte offsets for each segment
|
|
12
|
+
*/
|
|
13
|
+
export declare const makeOffsetArray: (byteLength: number, segmentSize: number) => number[];
|
|
14
|
+
/**
|
|
15
|
+
* Convert raw waveform HD data into the structured WaveformHD type
|
|
16
|
+
*/
|
|
17
|
+
export declare const convertWaveformHDData: (data: Buffer) => WaveformHD;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as ip from 'ip-address';
|
|
2
|
+
import { NetworkInterfaceInfoIPv4 } from 'os';
|
|
3
|
+
import { Device, MediaSlot, TrackType } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Get the byte representation of the device name
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildName(device: Device): Uint8Array;
|
|
8
|
+
/**
|
|
9
|
+
* Determines the interface that routes the given address by comparing the
|
|
10
|
+
* masked addresses. This type of information is generally determined through
|
|
11
|
+
* the kernels routing table, but for sake of cross-platform compatibility, we
|
|
12
|
+
* do some rudimentary lookup.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getMatchingInterface(ipAddr: ip.Address4): (NetworkInterfaceInfoIPv4 & {
|
|
15
|
+
name: string;
|
|
16
|
+
}) | null;
|
|
17
|
+
/**
|
|
18
|
+
* Given a BPM and pitch value, compute how many seconds per beat
|
|
19
|
+
*/
|
|
20
|
+
export declare function bpmToSeconds(bpm: number, pitch: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* Returns a string representation of a media slot
|
|
23
|
+
*/
|
|
24
|
+
export declare function getSlotName(slot: MediaSlot): string;
|
|
25
|
+
/**
|
|
26
|
+
* Returns a string representation of a track type
|
|
27
|
+
*/
|
|
28
|
+
export declare function getTrackTypeName(type: TrackType): string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telemetry utility - Sentry removed, now a no-op implementation.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if telemetry is enabled - always false now.
|
|
6
|
+
*/
|
|
7
|
+
export declare const isTelemetryEnabled: () => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Span status values for telemetry.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SpanStatus: {
|
|
12
|
+
readonly Ok: "ok";
|
|
13
|
+
readonly Cancelled: "cancelled";
|
|
14
|
+
readonly Unknown: "unknown";
|
|
15
|
+
readonly InvalidArgument: "invalid_argument";
|
|
16
|
+
readonly DeadlineExceeded: "deadline_exceeded";
|
|
17
|
+
readonly NotFound: "not_found";
|
|
18
|
+
readonly AlreadyExists: "already_exists";
|
|
19
|
+
readonly PermissionDenied: "permission_denied";
|
|
20
|
+
readonly ResourceExhausted: "resource_exhausted";
|
|
21
|
+
readonly FailedPrecondition: "failed_precondition";
|
|
22
|
+
readonly Aborted: "aborted";
|
|
23
|
+
readonly OutOfRange: "out_of_range";
|
|
24
|
+
readonly Unimplemented: "unimplemented";
|
|
25
|
+
readonly InternalError: "internal_error";
|
|
26
|
+
readonly Unavailable: "unavailable";
|
|
27
|
+
readonly DataLoss: "data_loss";
|
|
28
|
+
readonly Unauthenticated: "unauthenticated";
|
|
29
|
+
};
|
|
30
|
+
export type SpanStatusType = (typeof SpanStatus)[keyof typeof SpanStatus];
|
|
31
|
+
/**
|
|
32
|
+
* Context for starting a child span.
|
|
33
|
+
*/
|
|
34
|
+
export interface SpanContext {
|
|
35
|
+
name?: string;
|
|
36
|
+
op?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
data?: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Interface for span-like objects returned by telemetry functions.
|
|
42
|
+
*/
|
|
43
|
+
export interface TelemetrySpan {
|
|
44
|
+
startChild(context?: SpanContext): TelemetrySpan;
|
|
45
|
+
setData(key: string, value: unknown): TelemetrySpan;
|
|
46
|
+
setTag(key: string, value: string): TelemetrySpan;
|
|
47
|
+
setStatus(status: SpanStatusType): TelemetrySpan;
|
|
48
|
+
end(): void;
|
|
49
|
+
/** @deprecated Use end() instead */
|
|
50
|
+
finish(): void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Initialize telemetry - no-op.
|
|
54
|
+
*/
|
|
55
|
+
export declare function init(_options?: unknown): void;
|
|
56
|
+
/**
|
|
57
|
+
* Start a transaction/span - returns no-op.
|
|
58
|
+
*/
|
|
59
|
+
export declare function startTransaction(_context: SpanContext): TelemetrySpan;
|
|
60
|
+
/**
|
|
61
|
+
* Capture an exception - no-op.
|
|
62
|
+
*/
|
|
63
|
+
export declare function captureException(_exception: unknown, _hint?: unknown): string;
|
|
64
|
+
/**
|
|
65
|
+
* Capture a message - no-op.
|
|
66
|
+
*/
|
|
67
|
+
export declare function captureMessage(_message: string, _level?: unknown): string;
|
|
68
|
+
/**
|
|
69
|
+
* Set a tag - no-op.
|
|
70
|
+
*/
|
|
71
|
+
export declare function setTag(_key: string, _value: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* Severity levels for messages.
|
|
74
|
+
*/
|
|
75
|
+
export declare const Severity: {
|
|
76
|
+
readonly Fatal: "fatal";
|
|
77
|
+
readonly Error: "error";
|
|
78
|
+
readonly Warning: "warning";
|
|
79
|
+
readonly Log: "log";
|
|
80
|
+
readonly Info: "info";
|
|
81
|
+
readonly Debug: "debug";
|
|
82
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BindOptions, Socket } from 'dgram';
|
|
2
|
+
import { AddressInfo } from 'net';
|
|
3
|
+
/**
|
|
4
|
+
* Async version of upd socket bind
|
|
5
|
+
*/
|
|
6
|
+
export declare function udpBind(conn: Socket, port?: number, address?: string): Promise<AddressInfo>;
|
|
7
|
+
export declare function udpBind(conn: Socket, options: BindOptions): Promise<AddressInfo>;
|
|
8
|
+
/**
|
|
9
|
+
* Async version of udp socket read
|
|
10
|
+
*/
|
|
11
|
+
export declare function udpRead(conn: Socket): Promise<Buffer<ArrayBufferLike>>;
|
|
12
|
+
/**
|
|
13
|
+
* Async version of udp socket send
|
|
14
|
+
*/
|
|
15
|
+
export declare function udpSend(conn: Socket, msg: Buffer | string | Uint8Array | any[], port: number, address: string): Promise<number>;
|
|
16
|
+
export declare function udpSend(conn: Socket, msg: Buffer | string | Uint8Array, offset: number, length: number, port: number, address: string): Promise<number>;
|
|
17
|
+
/**
|
|
18
|
+
* Async version of udp socket close
|
|
19
|
+
*/
|
|
20
|
+
export declare function udpClose(conn: Socket): Promise<unknown>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Socket } from 'dgram';
|
|
2
|
+
import { NetworkInterfaceInfoIPv4 } from 'os';
|
|
3
|
+
import DeviceManager from "../devices";
|
|
4
|
+
import { Device, DeviceID } from "../types";
|
|
5
|
+
/**
|
|
6
|
+
* Constructs a virtual CDJ Device.
|
|
7
|
+
*
|
|
8
|
+
* @param iface - The network interface to use
|
|
9
|
+
* @param id - The device ID to use
|
|
10
|
+
* @param name - Optional custom name (defaults to VIRTUAL_CDJ_NAME constant)
|
|
11
|
+
*/
|
|
12
|
+
export declare const getVirtualCDJ: (iface: NetworkInterfaceInfoIPv4, id: DeviceID, name?: string) => Device;
|
|
13
|
+
/**
|
|
14
|
+
* Returns a mostly empty-state status packet. This is currently used to report
|
|
15
|
+
* the virtual CDJs status, which *seems* to be required for the CDJ to send
|
|
16
|
+
* metadata about some unanalyzed mp3 files.
|
|
17
|
+
*/
|
|
18
|
+
export declare function makeStatusPacket(device: Device): Uint8Array;
|
|
19
|
+
/**
|
|
20
|
+
* constructs the announce packet that is sent on the prolink network to
|
|
21
|
+
* announce a devices existence.
|
|
22
|
+
*/
|
|
23
|
+
export declare function makeAnnouncePacket(deviceToAnnounce: Device): Uint8Array;
|
|
24
|
+
/**
|
|
25
|
+
* the announcer service is used to report our fake CDJ to the prolink network,
|
|
26
|
+
* as if it was a real CDJ.
|
|
27
|
+
*/
|
|
28
|
+
export declare class Announcer {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(vcdj: Device, announceSocket: Socket, deviceManager: DeviceManager, iface: NetworkInterfaceInfoIPv4, fullStartup?: boolean);
|
|
31
|
+
start(): void;
|
|
32
|
+
stop(): void;
|
|
33
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "alphatheta-connect",
|
|
3
|
+
"version": "0.15.0",
|
|
4
|
+
"main": "lib/index.js",
|
|
5
|
+
"author": "Evan Purkhiser <evanpurkhiser@gmail.com>",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"prolink-network",
|
|
8
|
+
"CDJ",
|
|
9
|
+
"pioneer",
|
|
10
|
+
"DJ",
|
|
11
|
+
"reverse-engineer",
|
|
12
|
+
"cdj",
|
|
13
|
+
"djm"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"watch": "webpack --watch",
|
|
18
|
+
"build": "webpack",
|
|
19
|
+
"build-docs": "typedoc --out docs src/index.ts",
|
|
20
|
+
"test": "jest",
|
|
21
|
+
"lint": "eslint src/**/*.ts tests/**/*.ts",
|
|
22
|
+
"preversion": "yarn lint; yarn test",
|
|
23
|
+
"prepare": "ts-patch install -s && npm run build",
|
|
24
|
+
"prepublishOnly": "npm run build",
|
|
25
|
+
"release": "node .github/release.js",
|
|
26
|
+
"release:patch": "node .github/release.js --patch",
|
|
27
|
+
"release:major": "node .github/release.js --major"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"lib/"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=22.0.0"
|
|
34
|
+
},
|
|
35
|
+
"bin": {
|
|
36
|
+
"alphatheta-connect": "./lib/cli.js"
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": false,
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
41
|
+
"@types/lodash": "^4.17.21",
|
|
42
|
+
"@types/node": "^22.15.29",
|
|
43
|
+
"@types/promise-retry": "^1.1.6",
|
|
44
|
+
"@types/promise-timeout": "^1.3.3",
|
|
45
|
+
"@types/signale": "^1.4.7",
|
|
46
|
+
"async-mutex": "^0.5.0",
|
|
47
|
+
"better-sqlite3-multiple-ciphers": "^12.5.0",
|
|
48
|
+
"iconv-lite": "^0.6.3",
|
|
49
|
+
"ip-address": "^10.1.0",
|
|
50
|
+
"js-xdr": "^3.1.2",
|
|
51
|
+
"kaitai-struct": "^0.11.0",
|
|
52
|
+
"lodash": "^4.17.21",
|
|
53
|
+
"lru_map": "^0.4.1",
|
|
54
|
+
"promise-readable": "^6.0.0",
|
|
55
|
+
"promise-retry": "^2.0.1",
|
|
56
|
+
"promise-socket": "^7.0.0",
|
|
57
|
+
"promise-timeout": "^1.3.0",
|
|
58
|
+
"strict-event-emitter-types": "^2.0.0"
|
|
59
|
+
},
|
|
60
|
+
"optionalDependencies": {
|
|
61
|
+
"cap": "^0.2.1"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@evanpurkhiser/eslint-config": "^0.27.0",
|
|
65
|
+
"@types/jest": "^29.5.14",
|
|
66
|
+
"@types/stream-buffers": "^3.0.8",
|
|
67
|
+
"@types/webpack": "^5.28.5",
|
|
68
|
+
"@types/webpack-node-externals": "^3.0.4",
|
|
69
|
+
"eslint": "^9.39.2",
|
|
70
|
+
"jest": "^29.7.0",
|
|
71
|
+
"jest-each": "^29.7.0",
|
|
72
|
+
"kaitai-struct-loader": "^0.9.0",
|
|
73
|
+
"loader-utils": "^2.0.4",
|
|
74
|
+
"prettier": "^3.5.3",
|
|
75
|
+
"signale": "^1.4.0",
|
|
76
|
+
"stream-buffers": "^3.0.3",
|
|
77
|
+
"ts-jest": "^29.4.0",
|
|
78
|
+
"ts-loader": "^9.5.4",
|
|
79
|
+
"ts-node": "^10.9.2",
|
|
80
|
+
"ts-patch": "^3.3.0",
|
|
81
|
+
"typedoc": "^0.28.5",
|
|
82
|
+
"typedoc-plugin-missing-exports": "^4.1.0",
|
|
83
|
+
"typescript": "^5.9.3",
|
|
84
|
+
"typescript-transform-paths": "^3.5.5",
|
|
85
|
+
"webpack": "^5.104.1",
|
|
86
|
+
"webpack-cli": "^6.0.1",
|
|
87
|
+
"webpack-node-externals": "^3.0.0"
|
|
88
|
+
},
|
|
89
|
+
"volta": {
|
|
90
|
+
"node": "22.11.0",
|
|
91
|
+
"yarn": "1.22.22"
|
|
92
|
+
}
|
|
93
|
+
}
|