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.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +166 -0
  3. package/lib/artwork/index.d.ts +9 -0
  4. package/lib/artwork/parsers/aiff.d.ts +2 -0
  5. package/lib/artwork/parsers/flac.d.ts +2 -0
  6. package/lib/artwork/parsers/id3.d.ts +2 -0
  7. package/lib/artwork/parsers/index.d.ts +5 -0
  8. package/lib/artwork/parsers/mp4.d.ts +2 -0
  9. package/lib/artwork/parsers/utils.d.ts +3 -0
  10. package/lib/artwork/reader.d.ts +15 -0
  11. package/lib/artwork/types.d.ts +44 -0
  12. package/lib/cli/index.d.ts +1 -0
  13. package/lib/cli.js +11431 -0
  14. package/lib/cli.js.map +1 -0
  15. package/lib/constants.d.ts +40 -0
  16. package/lib/control/index.d.ts +20 -0
  17. package/lib/db/getArtworkFromFile.d.ts +13 -0
  18. package/lib/db/getArtworkThumbnail.d.ts +29 -0
  19. package/lib/db/getFile.d.ts +29 -0
  20. package/lib/db/getMetadata.d.ts +28 -0
  21. package/lib/db/getPlaylist.d.ts +26 -0
  22. package/lib/db/getWaveforms.d.ts +29 -0
  23. package/lib/db/index.d.ts +70 -0
  24. package/lib/db/utils.d.ts +7 -0
  25. package/lib/devices/index.d.ts +66 -0
  26. package/lib/devices/utils.d.ts +5 -0
  27. package/lib/entities.d.ts +122 -0
  28. package/lib/index.d.ts +10 -0
  29. package/lib/index.js +13381 -0
  30. package/lib/index.js.map +1 -0
  31. package/lib/localdb/database-adapter.d.ts +49 -0
  32. package/lib/localdb/index.d.ts +104 -0
  33. package/lib/localdb/onelibrary-schema.d.ts +250 -0
  34. package/lib/localdb/onelibrary.d.ts +185 -0
  35. package/lib/localdb/orm.d.ts +60 -0
  36. package/lib/localdb/rekordbox.d.ts +112 -0
  37. package/lib/localdb/schema.d.ts +1 -0
  38. package/lib/localdb/utils.d.ts +5 -0
  39. package/lib/mixstatus/index.d.ts +109 -0
  40. package/lib/mixstatus/utils.d.ts +9 -0
  41. package/lib/network.d.ts +201 -0
  42. package/lib/nfs/index.d.ts +63 -0
  43. package/lib/nfs/programs.d.ts +61 -0
  44. package/lib/nfs/rpc.d.ts +60 -0
  45. package/lib/nfs/utils.d.ts +4 -0
  46. package/lib/nfs/xdr.d.ts +17 -0
  47. package/lib/passive/alphatheta.d.ts +94 -0
  48. package/lib/passive/devices.d.ts +64 -0
  49. package/lib/passive/index.d.ts +169 -0
  50. package/lib/passive/localdb.d.ts +122 -0
  51. package/lib/passive/pcap-adapter.d.ts +77 -0
  52. package/lib/passive/position.d.ts +32 -0
  53. package/lib/passive/remotedb.d.ts +49 -0
  54. package/lib/passive/status.d.ts +41 -0
  55. package/lib/remotedb/constants.d.ts +8 -0
  56. package/lib/remotedb/fields.d.ts +169 -0
  57. package/lib/remotedb/index.d.ts +160 -0
  58. package/lib/remotedb/message/index.d.ts +39 -0
  59. package/lib/remotedb/message/item.d.ts +530 -0
  60. package/lib/remotedb/message/response.d.ts +18 -0
  61. package/lib/remotedb/message/types.d.ts +227 -0
  62. package/lib/remotedb/queries.d.ts +99 -0
  63. package/lib/remotedb/utils.d.ts +23 -0
  64. package/lib/status/index.d.ts +39 -0
  65. package/lib/status/media.d.ts +22 -0
  66. package/lib/status/position.d.ts +29 -0
  67. package/lib/status/types.d.ts +170 -0
  68. package/lib/status/utils.d.ts +19 -0
  69. package/lib/types.d.ts +457 -0
  70. package/lib/types.js +274 -0
  71. package/lib/types.js.map +1 -0
  72. package/lib/utils/converters.d.ts +17 -0
  73. package/lib/utils/index.d.ts +28 -0
  74. package/lib/utils/telemetry.d.ts +82 -0
  75. package/lib/utils/udp.d.ts +20 -0
  76. package/lib/virtualcdj/index.d.ts +33 -0
  77. package/package.json +93 -0
package/lib/types.d.ts ADDED
@@ -0,0 +1,457 @@
1
+ import type { Address4 } from 'ip-address';
2
+ import type { Playlist, Track } from './entities';
3
+ export * as CDJStatus from "./status/types";
4
+ /**
5
+ * Re-export various types for the types only compile target
6
+ */
7
+ export type { Album, Artist, Artwork, Color, Genre, Key, Label, Playlist, Track, } from './entities';
8
+ export type { HydrationProgress } from './localdb/rekordbox';
9
+ export type { MixstatusConfig, MixstatusProcessor } from './mixstatus';
10
+ export type { ConnectedProlinkNetwork, NetworkConfig } from './network';
11
+ export type { FetchProgress } from './nfs';
12
+ /**
13
+ * Known device types on the network
14
+ */
15
+ export declare enum DeviceType {
16
+ CDJ = 1,
17
+ Mixer = 3,
18
+ Rekordbox = 4
19
+ }
20
+ /**
21
+ * The 8-bit identifier of the device on the network
22
+ */
23
+ export type DeviceID = number;
24
+ /**
25
+ * Represents a device on the prolink network.
26
+ */
27
+ export interface Device {
28
+ name: string;
29
+ id: DeviceID;
30
+ type: DeviceType;
31
+ macAddr: Uint8Array;
32
+ ip: Address4;
33
+ lastActive?: Date;
34
+ }
35
+ /**
36
+ * Details of a particular media slot on the CDJ
37
+ */
38
+ export interface MediaSlotInfo {
39
+ /**
40
+ * The device the slot physically exists on
41
+ */
42
+ deviceId: DeviceID;
43
+ /**
44
+ * The slot type
45
+ */
46
+ slot: MediaSlot;
47
+ /**
48
+ * The name of the media connected
49
+ */
50
+ name: string;
51
+ /**
52
+ * The rekordbox configured color of the media connected
53
+ */
54
+ color: MediaColor;
55
+ /**
56
+ * Creation date
57
+ */
58
+ createdDate: Date;
59
+ /**
60
+ * Number of free bytes available on the media
61
+ */
62
+ freeBytes: bigint;
63
+ /**
64
+ * Number of bytes used on the media
65
+ */
66
+ totalBytes: bigint;
67
+ /**
68
+ * Specifies the available tracks type on the media
69
+ */
70
+ tracksType: TrackType;
71
+ /**
72
+ * Total number of rekordbox tracks on the media. Will be zero if there is
73
+ * no rekordbox database on the media
74
+ */
75
+ trackCount: number;
76
+ /**
77
+ * Same as track count, except for playlists
78
+ */
79
+ playlistCount: number;
80
+ /**
81
+ * True when a rekordbox 'my settings' file has been exported to the media
82
+ */
83
+ hasSettings: boolean;
84
+ }
85
+ export declare enum MediaColor {
86
+ Default = 0,
87
+ Pink = 1,
88
+ Red = 2,
89
+ Orange = 3,
90
+ Yellow = 4,
91
+ Green = 5,
92
+ Aqua = 6,
93
+ Blue = 7,
94
+ Purple = 8
95
+ }
96
+ /**
97
+ * A slot where media is present on the CDJ
98
+ */
99
+ export declare enum MediaSlot {
100
+ Empty = 0,
101
+ CD = 1,
102
+ SD = 2,
103
+ USB = 3,
104
+ RB = 4
105
+ }
106
+ /**
107
+ * Track type flags
108
+ */
109
+ export declare enum TrackType {
110
+ None = 0,
111
+ RB = 1,
112
+ Unanalyzed = 2,
113
+ AudioCD = 5
114
+ }
115
+ /**
116
+ * A beat grid is a series of offsets from the start of the track. Each offset
117
+ * indicates what count within the measure it is along with the BPM.
118
+ */
119
+ export type BeatGrid = Array<{
120
+ /**
121
+ * Offset from the beginning of track in milliseconds of this beat.
122
+ */
123
+ offset: number;
124
+ /**
125
+ * The count of this particular beat within the measure
126
+ */
127
+ count: 1 | 2 | 3 | 4;
128
+ /**
129
+ * The BPM at this beat.
130
+ */
131
+ bpm: number;
132
+ }>;
133
+ /**
134
+ * A waveform segment contains a height and 'whiteness' value.
135
+ */
136
+ interface WaveformSegment {
137
+ /**
138
+ * The height this segment in the waveform. Ranges from 0 - 31.
139
+ */
140
+ height: number;
141
+ /**
142
+ * The level of "whiteness" of the waveform. 0 being completely blue, and 1
143
+ * being completely white.
144
+ */
145
+ whiteness: number;
146
+ }
147
+ /**
148
+ * A HD waveform segment contains the height of the waveform, and it's color
149
+ * represented as RGB values.
150
+ */
151
+ interface WaveformHDSegment {
152
+ /**
153
+ * The height this segment in the waveform. Ranges from 0 - 31.
154
+ */
155
+ height: number;
156
+ /**
157
+ * the RGB value, each channel ranges from 0-1 for the segment.
158
+ */
159
+ color: [number, number, number];
160
+ }
161
+ /**
162
+ * The waveform preview will be 400 segments of data.
163
+ */
164
+ export type WaveformPreview = WaveformSegment[];
165
+ /**
166
+ * Detailed waveforms have 150 segments per second of audio (150 'half frames'
167
+ * per second of audio).
168
+ */
169
+ export type WaveformDetailed = WaveformSegment[];
170
+ /**
171
+ * HD waveforms have 150 segments per second of audio (150 'half frames' per
172
+ * second of audio).
173
+ */
174
+ export type WaveformHD = WaveformHDSegment[];
175
+ /**
176
+ * The result of looking up track waveforms
177
+ */
178
+ export interface Waveforms {
179
+ /**
180
+ * The full-size and full-color waveform
181
+ */
182
+ waveformHd: WaveformHD;
183
+ }
184
+ /**
185
+ * A hotcue button label
186
+ */
187
+ export declare enum HotcueButton {
188
+ A = 1,
189
+ B = 2,
190
+ C = 3,
191
+ D = 4,
192
+ E = 5,
193
+ F = 6,
194
+ G = 7,
195
+ H = 8
196
+ }
197
+ /**
198
+ * When a custom color is not configured the cue point will be one of these
199
+ * colors.
200
+ */
201
+ export declare enum CueColor {
202
+ None = 0,
203
+ Blank = 21,
204
+ Magenta = 49,
205
+ Violet = 56,
206
+ Fuchsia = 60,
207
+ LightSlateBlue = 62,
208
+ Blue = 1,
209
+ SteelBlue = 5,
210
+ Aqua = 9,
211
+ SeaGreen = 14,
212
+ Teal = 18,
213
+ Green = 22,
214
+ Lime = 26,
215
+ Olive = 30,
216
+ Yellow = 32,
217
+ Orange = 38,
218
+ Red = 42,
219
+ Pink = 45
220
+ }
221
+ /**
222
+ * Represents a single cue point. On older exports the label and color may be
223
+ * undefined.
224
+ */
225
+ export interface CuePoint {
226
+ type: 'cue_point';
227
+ /**
228
+ * Number of milliseconds from the start of the track.
229
+ */
230
+ offset: number;
231
+ /**
232
+ * The comment associated to the cue point
233
+ */
234
+ label?: string;
235
+ /**
236
+ * RGB values of the hotcue color
237
+ */
238
+ color?: CueColor;
239
+ }
240
+ type BareCuePoint = Omit<CuePoint, 'type'>;
241
+ /**
242
+ * A loop, similar to a cue point, but includes a length.
243
+ */
244
+ export type Loop = BareCuePoint & {
245
+ type: 'loop';
246
+ /**
247
+ * The length in milliseconds of the loop
248
+ */
249
+ length: number;
250
+ };
251
+ /**
252
+ * A hotcue is like a cue point, but also includes the button it is assigned to.
253
+ */
254
+ export type Hotcue = BareCuePoint & {
255
+ type: 'hot_cue';
256
+ /**
257
+ * Which hotcue button this hotcue is assigned to.
258
+ */
259
+ button: HotcueButton;
260
+ };
261
+ /**
262
+ * A hot loop, this is the union of a hotcue and a loop.
263
+ */
264
+ export type Hotloop = {
265
+ type: 'hot_loop';
266
+ } & (Omit<Hotcue, 'type'> & Omit<Loop, 'type'>);
267
+ export type CueAndLoop = CuePoint | Loop | Hotcue | Hotloop;
268
+ /**
269
+ * Extended cue with color and comment support (PCO2 tag from rekordbox).
270
+ * Includes additional metadata like RGB colors, comments, and quantized loop information.
271
+ */
272
+ export interface ExtendedCue {
273
+ /**
274
+ * Hot cue number (0 for memory points, 1-8 for hot cues A-H)
275
+ */
276
+ hotCue: number;
277
+ /**
278
+ * Type of cue: 1 = simple position/cue, 2 = loop
279
+ */
280
+ type: 1 | 2;
281
+ /**
282
+ * Position in milliseconds from the start of the track
283
+ */
284
+ time: number;
285
+ /**
286
+ * For loops, the end position in milliseconds
287
+ */
288
+ loopTime?: number;
289
+ /**
290
+ * Color ID referencing the color table (for memory points/loops)
291
+ */
292
+ colorId?: number;
293
+ /**
294
+ * Color code for the hot cue palette (0x00 = default green, 0x01-0x3e = palette colors)
295
+ */
296
+ colorCode?: number;
297
+ /**
298
+ * RGB color values used to illuminate the player's RGB LEDs
299
+ */
300
+ colorRgb?: {
301
+ r: number;
302
+ g: number;
303
+ b: number;
304
+ };
305
+ /**
306
+ * User-assigned comment text for the cue
307
+ */
308
+ comment?: string;
309
+ /**
310
+ * For quantized loops, the numerator of the loop size fraction (e.g., 4 for a 4-beat loop)
311
+ */
312
+ loopNumerator?: number;
313
+ /**
314
+ * For quantized loops, the denominator of the loop size fraction (e.g., 1 for a 4-beat loop)
315
+ */
316
+ loopDenominator?: number;
317
+ }
318
+ /**
319
+ * A phrase within a track's song structure
320
+ */
321
+ export interface Phrase {
322
+ /**
323
+ * Sequential phrase number starting from 1
324
+ */
325
+ index: number;
326
+ /**
327
+ * Beat number where this phrase begins
328
+ */
329
+ beat: number;
330
+ /**
331
+ * Raw phrase kind value from rekordbox
332
+ */
333
+ kind: number;
334
+ /**
335
+ * Human-readable phrase type (e.g., "Intro", "Verse 1", "Chorus")
336
+ */
337
+ phraseType: string;
338
+ /**
339
+ * Whether this phrase has a fill-in section (non-zero if present)
340
+ */
341
+ fill?: number;
342
+ /**
343
+ * Beat number where the fill-in begins (if present)
344
+ */
345
+ fillBeat?: number;
346
+ }
347
+ /**
348
+ * Song structure / phrase analysis (PSSI tag from rekordbox).
349
+ * Used by CDJ-3000 players for phrase-based navigation and lighting control.
350
+ */
351
+ export interface SongStructure {
352
+ /**
353
+ * Overall mood classification of the track
354
+ */
355
+ mood: 'high' | 'mid' | 'low';
356
+ /**
357
+ * Stylistic bank assigned for lighting control
358
+ */
359
+ bank: 'default' | 'cool' | 'natural' | 'hot' | 'subtle' | 'warm' | 'vivid' | 'club_1' | 'club_2';
360
+ /**
361
+ * Beat number where the last phrase ends (track may continue after this)
362
+ */
363
+ endBeat: number;
364
+ /**
365
+ * List of identified phrases in the track
366
+ */
367
+ phrases: Phrase[];
368
+ }
369
+ /**
370
+ * Monochrome waveform preview data (PWAV/PWV2 tags).
371
+ * PWAV contains 400 bytes, PWV2 contains 100 bytes.
372
+ */
373
+ export interface WaveformPreviewData {
374
+ /**
375
+ * Raw waveform data - each byte encodes height and whiteness
376
+ */
377
+ data: Uint8Array;
378
+ }
379
+ /**
380
+ * Represents the contents of a playlist
381
+ */
382
+ export interface PlaylistContents {
383
+ /**
384
+ * The playlists in this playlist.
385
+ */
386
+ playlists: Playlist[];
387
+ /**
388
+ * The folders in this playlist.
389
+ */
390
+ folders: Playlist[];
391
+ /**
392
+ * The tracks in this playlist. This is an AsyncIterator as looking up track
393
+ * metadata may be slow when connected to the remote database.
394
+ */
395
+ tracks: AsyncIterable<Track>;
396
+ /**
397
+ * The total number of tracks in this playlist.
398
+ */
399
+ totalTracks: number;
400
+ }
401
+ export declare enum NetworkState {
402
+ /**
403
+ * The network is offline when we don't have an open connection to the network
404
+ * (no connection to the announcement and or status UDP socket is present).
405
+ */
406
+ Offline = 0,
407
+ /**
408
+ * The network is online when we have opened sockets to the network, but have
409
+ * not yet started announcing ourselves as a virtual CDJ.
410
+ */
411
+ Online = 1,
412
+ /**
413
+ * The network is connected once we have heard from another device on the network
414
+ */
415
+ Connected = 2,
416
+ /**
417
+ * The network may have failed to connect if we aren't able to open the
418
+ * announcement and or status UDP socket.
419
+ */
420
+ Failed = 3
421
+ }
422
+ /**
423
+ * Mixstatus reporting modes specify how the mixstatus processor will determine when a new
424
+ * track is 'now playing'.
425
+ */
426
+ export declare enum MixstatusMode {
427
+ /**
428
+ * Tracks will be smartly marked as playing following rules:
429
+ *
430
+ * - The track that has been in the play state with the CDJ in the "on air" state
431
+ * for the longest period of time (allowing for a configurable length of
432
+ * interruption with allowedInterruptBeats) is considered to be the active
433
+ * track that incoming tracks will be compared against.
434
+ *
435
+ * - A incoming track will immediately be reported as nowPlaying if it is on
436
+ * air, playing, and the last active track has been cued.
437
+ *
438
+ * - A incoming track will be reported as nowPlaying if the active track has
439
+ * not been on air or has not been playing for the configured
440
+ * allowedInterruptBeats.
441
+ *
442
+ * - A incoming track will be reported as nowPlaying if it has played
443
+ * consecutively (with allowedInterruptBeats honored for the incoming track)
444
+ * for the configured beatsUntilReported.
445
+ */
446
+ SmartTiming = 0,
447
+ /**
448
+ * Tracks will not be reported after the beatsUntilReported AND will ONLY
449
+ * be reported if the other track has gone into a non-playing play state, or
450
+ * taken off air (when useOnAirStatus is enabled).
451
+ */
452
+ WaitsForSilence = 1,
453
+ /**
454
+ * The track will simply be reported only after the player becomes master.
455
+ */
456
+ FollowsMaster = 2
457
+ }