magmastream 2.10.3-alpha.6 → 2.10.3-alpha.8
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/dist/structures/Enums.d.ts +66 -0
- package/dist/structures/Enums.js +68 -1
- package/dist/structures/Filters.d.ts +81 -1
- package/dist/structures/Filters.js +236 -14
- package/dist/structures/Manager.d.ts +6 -0
- package/dist/structures/Manager.js +94 -7
- package/dist/structures/Node.d.ts +73 -1
- package/dist/structures/Node.js +142 -6
- package/dist/structures/Player.d.ts +64 -1
- package/dist/structures/Player.js +110 -1
- package/dist/structures/Rest.d.ts +1 -0
- package/dist/structures/Rest.js +27 -0
- package/dist/structures/Types.d.ts +208 -12
- package/dist/structures/Utils.d.ts +1 -1
- package/dist/structures/Utils.js +32 -9
- package/dist/utils/managerCheck.js +3 -2
- package/package.json +1 -1
|
@@ -72,6 +72,58 @@ export declare enum SearchPlatform {
|
|
|
72
72
|
YouTube = "ytsearch",
|
|
73
73
|
YouTubeMusic = "ytmsearch"
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* NodeLink Search Platform Enum
|
|
77
|
+
*/
|
|
78
|
+
export declare enum NodeLinkSearchPlatform {
|
|
79
|
+
Unified = "search",
|
|
80
|
+
YouTube = "ytsearch",
|
|
81
|
+
YouTubeMusic = "ytmsearch",
|
|
82
|
+
SoundCloud = "scsearch",
|
|
83
|
+
Spotify = "spsearch",
|
|
84
|
+
AppleMusic = "amsearch",
|
|
85
|
+
Deezer = "dzsearch",
|
|
86
|
+
Tidal = "tdsearch",
|
|
87
|
+
Bandcamp = "bcsearch",
|
|
88
|
+
AmazonMusic = "amazonmusic",
|
|
89
|
+
AmazonMusicSearch = "azsearch",
|
|
90
|
+
Anghami = "agsearch",
|
|
91
|
+
Audiomack = "audiomack",
|
|
92
|
+
AudiomackSearch = "admsearch",
|
|
93
|
+
Audius = "ausearch",
|
|
94
|
+
Bilibili = "bilibili",
|
|
95
|
+
BilibiliSearch = "bilisearch",
|
|
96
|
+
Bluesky = "bksearch",
|
|
97
|
+
EternalBox = "ebox",
|
|
98
|
+
EternalBoxJukebox = "jukebox",
|
|
99
|
+
Flowery = "flowery",
|
|
100
|
+
FloweryTTS = "ftts",
|
|
101
|
+
Gaana = "gaanasearch",
|
|
102
|
+
GaanaSearch = "gnsearch",
|
|
103
|
+
GoogleDrive = "gdsearch",
|
|
104
|
+
GoogleTTS = "gtts",
|
|
105
|
+
GoogleTTSSpeak = "speak",
|
|
106
|
+
IHeartRadio = "iheartradio",
|
|
107
|
+
IHeartRadioSearch = "ihsearch",
|
|
108
|
+
Jiosaavn = "jssearch",
|
|
109
|
+
LastFM = "lfsearch",
|
|
110
|
+
LazyTTS = "lazypytts",
|
|
111
|
+
LazyTTSAlt = "lazytts",
|
|
112
|
+
LetrasMus = "lmsearch",
|
|
113
|
+
Mixcloud = "mixcloud",
|
|
114
|
+
MixcloudSearch = "mcsearch",
|
|
115
|
+
Netease = "ntsearch",
|
|
116
|
+
NicoVideo = "nicovideo",
|
|
117
|
+
NicoVideoSearch = "ncsearch",
|
|
118
|
+
Pandora = "pdsearch",
|
|
119
|
+
PiperTTS = "pipertts",
|
|
120
|
+
Qobuz = "qbsearch",
|
|
121
|
+
Shazam = "shsearch",
|
|
122
|
+
ShazamAlt = "szsearch",
|
|
123
|
+
SongLink = "slsearch",
|
|
124
|
+
VKMusic = "vksearch",
|
|
125
|
+
Yandex = "ymsearch"
|
|
126
|
+
}
|
|
75
127
|
/**
|
|
76
128
|
* Player State Event Types Enum
|
|
77
129
|
*/
|
|
@@ -192,6 +244,10 @@ export declare enum ManagerEventTypes {
|
|
|
192
244
|
TrackStart = "trackStart",
|
|
193
245
|
TrackStuck = "trackStuck",
|
|
194
246
|
/** Nodelink */
|
|
247
|
+
MixStarted = "mixStarted",
|
|
248
|
+
/** Nodelink */
|
|
249
|
+
MixEnded = "mixEnded",
|
|
250
|
+
/** Nodelink */
|
|
195
251
|
VoiceReceiverDisconnect = "voiceReceiverDisconnect",
|
|
196
252
|
/** Nodelink */
|
|
197
253
|
VoiceReceiverConnect = "voiceReceiverConnect",
|
|
@@ -253,11 +309,21 @@ export declare enum AvailableFilters {
|
|
|
253
309
|
Pop = "pop",
|
|
254
310
|
Radio = "radio",
|
|
255
311
|
PluginFilters = "pluginFilters",
|
|
312
|
+
SetChorus = "setChorus",
|
|
256
313
|
SetChannelMix = "setChannelMix",
|
|
314
|
+
SetCompressor = "setCompressor",
|
|
257
315
|
SetDistortion = "setDistortion",
|
|
316
|
+
SetEcho = "setEcho",
|
|
317
|
+
SetFlanger = "setFlanger",
|
|
318
|
+
SetHighPass = "setHighPass",
|
|
258
319
|
SetKaraoke = "setKaraoke",
|
|
259
320
|
SetLowPass = "setLowPass",
|
|
321
|
+
SetPhaser = "setPhaser",
|
|
322
|
+
SetPhonograph = "setPhonograph",
|
|
323
|
+
SetReverb = "setReverb",
|
|
260
324
|
SetRotation = "setRotation",
|
|
325
|
+
SetSpatial = "setSpatial",
|
|
326
|
+
SetTape = "setTape",
|
|
261
327
|
SetTimescale = "setTimescale",
|
|
262
328
|
SetTremolo = "setTremolo",
|
|
263
329
|
Slowmo = "slowmo",
|
package/dist/structures/Enums.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MagmaStreamErrorNumbers = exports.MagmaStreamErrorCode = exports.AvailableFilters = exports.SponsorBlockSegment = exports.SeverityTypes = exports.TrackEndReasonTypes = exports.ManagerEventTypes = exports.TrackPartial = exports.UseNodeOptions = exports.TrackSourceTypes = exports.PlayerStateEventTypes = exports.SearchPlatform = exports.LoadTypes = exports.StateTypes = exports.AutoPlayPlatform = exports.StateStorageType = void 0;
|
|
3
|
+
exports.MagmaStreamErrorNumbers = exports.MagmaStreamErrorCode = exports.AvailableFilters = exports.SponsorBlockSegment = exports.SeverityTypes = exports.TrackEndReasonTypes = exports.ManagerEventTypes = exports.TrackPartial = exports.UseNodeOptions = exports.TrackSourceTypes = exports.PlayerStateEventTypes = exports.NodeLinkSearchPlatform = exports.SearchPlatform = exports.LoadTypes = exports.StateTypes = exports.AutoPlayPlatform = exports.StateStorageType = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* State Storage Enum
|
|
6
6
|
*/
|
|
@@ -80,6 +80,59 @@ var SearchPlatform;
|
|
|
80
80
|
SearchPlatform["YouTube"] = "ytsearch";
|
|
81
81
|
SearchPlatform["YouTubeMusic"] = "ytmsearch";
|
|
82
82
|
})(SearchPlatform || (exports.SearchPlatform = SearchPlatform = {}));
|
|
83
|
+
/**
|
|
84
|
+
* NodeLink Search Platform Enum
|
|
85
|
+
*/
|
|
86
|
+
var NodeLinkSearchPlatform;
|
|
87
|
+
(function (NodeLinkSearchPlatform) {
|
|
88
|
+
NodeLinkSearchPlatform["Unified"] = "search";
|
|
89
|
+
NodeLinkSearchPlatform["YouTube"] = "ytsearch";
|
|
90
|
+
NodeLinkSearchPlatform["YouTubeMusic"] = "ytmsearch";
|
|
91
|
+
NodeLinkSearchPlatform["SoundCloud"] = "scsearch";
|
|
92
|
+
NodeLinkSearchPlatform["Spotify"] = "spsearch";
|
|
93
|
+
NodeLinkSearchPlatform["AppleMusic"] = "amsearch";
|
|
94
|
+
NodeLinkSearchPlatform["Deezer"] = "dzsearch";
|
|
95
|
+
NodeLinkSearchPlatform["Tidal"] = "tdsearch";
|
|
96
|
+
NodeLinkSearchPlatform["Bandcamp"] = "bcsearch";
|
|
97
|
+
NodeLinkSearchPlatform["AmazonMusic"] = "amazonmusic";
|
|
98
|
+
NodeLinkSearchPlatform["AmazonMusicSearch"] = "azsearch";
|
|
99
|
+
NodeLinkSearchPlatform["Anghami"] = "agsearch";
|
|
100
|
+
NodeLinkSearchPlatform["Audiomack"] = "audiomack";
|
|
101
|
+
NodeLinkSearchPlatform["AudiomackSearch"] = "admsearch";
|
|
102
|
+
NodeLinkSearchPlatform["Audius"] = "ausearch";
|
|
103
|
+
NodeLinkSearchPlatform["Bilibili"] = "bilibili";
|
|
104
|
+
NodeLinkSearchPlatform["BilibiliSearch"] = "bilisearch";
|
|
105
|
+
NodeLinkSearchPlatform["Bluesky"] = "bksearch";
|
|
106
|
+
NodeLinkSearchPlatform["EternalBox"] = "ebox";
|
|
107
|
+
NodeLinkSearchPlatform["EternalBoxJukebox"] = "jukebox";
|
|
108
|
+
NodeLinkSearchPlatform["Flowery"] = "flowery";
|
|
109
|
+
NodeLinkSearchPlatform["FloweryTTS"] = "ftts";
|
|
110
|
+
NodeLinkSearchPlatform["Gaana"] = "gaanasearch";
|
|
111
|
+
NodeLinkSearchPlatform["GaanaSearch"] = "gnsearch";
|
|
112
|
+
NodeLinkSearchPlatform["GoogleDrive"] = "gdsearch";
|
|
113
|
+
NodeLinkSearchPlatform["GoogleTTS"] = "gtts";
|
|
114
|
+
NodeLinkSearchPlatform["GoogleTTSSpeak"] = "speak";
|
|
115
|
+
NodeLinkSearchPlatform["IHeartRadio"] = "iheartradio";
|
|
116
|
+
NodeLinkSearchPlatform["IHeartRadioSearch"] = "ihsearch";
|
|
117
|
+
NodeLinkSearchPlatform["Jiosaavn"] = "jssearch";
|
|
118
|
+
NodeLinkSearchPlatform["LastFM"] = "lfsearch";
|
|
119
|
+
NodeLinkSearchPlatform["LazyTTS"] = "lazypytts";
|
|
120
|
+
NodeLinkSearchPlatform["LazyTTSAlt"] = "lazytts";
|
|
121
|
+
NodeLinkSearchPlatform["LetrasMus"] = "lmsearch";
|
|
122
|
+
NodeLinkSearchPlatform["Mixcloud"] = "mixcloud";
|
|
123
|
+
NodeLinkSearchPlatform["MixcloudSearch"] = "mcsearch";
|
|
124
|
+
NodeLinkSearchPlatform["Netease"] = "ntsearch";
|
|
125
|
+
NodeLinkSearchPlatform["NicoVideo"] = "nicovideo";
|
|
126
|
+
NodeLinkSearchPlatform["NicoVideoSearch"] = "ncsearch";
|
|
127
|
+
NodeLinkSearchPlatform["Pandora"] = "pdsearch";
|
|
128
|
+
NodeLinkSearchPlatform["PiperTTS"] = "pipertts";
|
|
129
|
+
NodeLinkSearchPlatform["Qobuz"] = "qbsearch";
|
|
130
|
+
NodeLinkSearchPlatform["Shazam"] = "shsearch";
|
|
131
|
+
NodeLinkSearchPlatform["ShazamAlt"] = "szsearch";
|
|
132
|
+
NodeLinkSearchPlatform["SongLink"] = "slsearch";
|
|
133
|
+
NodeLinkSearchPlatform["VKMusic"] = "vksearch";
|
|
134
|
+
NodeLinkSearchPlatform["Yandex"] = "ymsearch";
|
|
135
|
+
})(NodeLinkSearchPlatform || (exports.NodeLinkSearchPlatform = NodeLinkSearchPlatform = {}));
|
|
83
136
|
/**
|
|
84
137
|
* Player State Event Types Enum
|
|
85
138
|
*/
|
|
@@ -205,6 +258,10 @@ var ManagerEventTypes;
|
|
|
205
258
|
ManagerEventTypes["TrackStart"] = "trackStart";
|
|
206
259
|
ManagerEventTypes["TrackStuck"] = "trackStuck";
|
|
207
260
|
/** Nodelink */
|
|
261
|
+
ManagerEventTypes["MixStarted"] = "mixStarted";
|
|
262
|
+
/** Nodelink */
|
|
263
|
+
ManagerEventTypes["MixEnded"] = "mixEnded";
|
|
264
|
+
/** Nodelink */
|
|
208
265
|
ManagerEventTypes["VoiceReceiverDisconnect"] = "voiceReceiverDisconnect";
|
|
209
266
|
/** Nodelink */
|
|
210
267
|
ManagerEventTypes["VoiceReceiverConnect"] = "voiceReceiverConnect";
|
|
@@ -270,11 +327,21 @@ var AvailableFilters;
|
|
|
270
327
|
AvailableFilters["Pop"] = "pop";
|
|
271
328
|
AvailableFilters["Radio"] = "radio";
|
|
272
329
|
AvailableFilters["PluginFilters"] = "pluginFilters";
|
|
330
|
+
AvailableFilters["SetChorus"] = "setChorus";
|
|
273
331
|
AvailableFilters["SetChannelMix"] = "setChannelMix";
|
|
332
|
+
AvailableFilters["SetCompressor"] = "setCompressor";
|
|
274
333
|
AvailableFilters["SetDistortion"] = "setDistortion";
|
|
334
|
+
AvailableFilters["SetEcho"] = "setEcho";
|
|
335
|
+
AvailableFilters["SetFlanger"] = "setFlanger";
|
|
336
|
+
AvailableFilters["SetHighPass"] = "setHighPass";
|
|
275
337
|
AvailableFilters["SetKaraoke"] = "setKaraoke";
|
|
276
338
|
AvailableFilters["SetLowPass"] = "setLowPass";
|
|
339
|
+
AvailableFilters["SetPhaser"] = "setPhaser";
|
|
340
|
+
AvailableFilters["SetPhonograph"] = "setPhonograph";
|
|
341
|
+
AvailableFilters["SetReverb"] = "setReverb";
|
|
277
342
|
AvailableFilters["SetRotation"] = "setRotation";
|
|
343
|
+
AvailableFilters["SetSpatial"] = "setSpatial";
|
|
344
|
+
AvailableFilters["SetTape"] = "setTape";
|
|
278
345
|
AvailableFilters["SetTimescale"] = "setTimescale";
|
|
279
346
|
AvailableFilters["SetTremolo"] = "setTremolo";
|
|
280
347
|
AvailableFilters["Slowmo"] = "slowmo";
|
|
@@ -2,7 +2,7 @@ import { Band } from "../utils/filtersEqualizers";
|
|
|
2
2
|
import { AvailableFilters } from "./Enums";
|
|
3
3
|
import { Manager } from "./Manager";
|
|
4
4
|
import { Player } from "./Player";
|
|
5
|
-
import { ChannelMixOptions, DistortionOptions, KaraokeOptions, LowPassOptions, ReverbOptions, RotationOptions, TimescaleOptions, TremoloOptions, VibratoOptions } from "./Types";
|
|
5
|
+
import { ChannelMixOptions, ChorusOptions, CompressorOptions, DistortionOptions, EchoOptions, FlangerOptions, HighPassOptions, KaraokeOptions, LowPassOptions, PhaserOptions, PhonographOptions, ReverbOptions, RotationOptions, SpatialOptions, TapeOptions, TimescaleOptions, TremoloOptions, VibratoOptions } from "./Types";
|
|
6
6
|
export declare class Filters {
|
|
7
7
|
private static readonly defaultPluginFilterPlugins;
|
|
8
8
|
distortion: DistortionOptions | null;
|
|
@@ -14,6 +14,15 @@ export declare class Filters {
|
|
|
14
14
|
vibrato: VibratoOptions | null;
|
|
15
15
|
channelMix: ChannelMixOptions | null;
|
|
16
16
|
lowPass: LowPassOptions | null;
|
|
17
|
+
highpass: HighPassOptions | null;
|
|
18
|
+
echo: EchoOptions | null;
|
|
19
|
+
chorus: ChorusOptions | null;
|
|
20
|
+
compressor: CompressorOptions | null;
|
|
21
|
+
flanger: FlangerOptions | null;
|
|
22
|
+
phaser: PhaserOptions | null;
|
|
23
|
+
phonograph: PhonographOptions | null;
|
|
24
|
+
spatial: SpatialOptions | null;
|
|
25
|
+
tape: TapeOptions | null;
|
|
17
26
|
pluginFilters: Record<string, unknown>;
|
|
18
27
|
reverb: ReverbOptions | null;
|
|
19
28
|
volume: number;
|
|
@@ -48,6 +57,7 @@ export declare class Filters {
|
|
|
48
57
|
private applyFilter;
|
|
49
58
|
private emitPlayersTasteUpdate;
|
|
50
59
|
private assertPluginFiltersSupported;
|
|
60
|
+
private assertNodeLinkExtraFilterSupported;
|
|
51
61
|
/**
|
|
52
62
|
* Sets the status of a specific filter.
|
|
53
63
|
*
|
|
@@ -139,6 +149,76 @@ export declare class Filters {
|
|
|
139
149
|
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
140
150
|
*/
|
|
141
151
|
setLowPass(lowPass?: LowPassOptions): Promise<this>;
|
|
152
|
+
/**
|
|
153
|
+
* Sets the NodeLink high pass filter options on the audio.
|
|
154
|
+
* @param {HighPassOptions} [highpass] - The high pass settings to apply.
|
|
155
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
156
|
+
*/
|
|
157
|
+
setHighPass(highpass?: HighPassOptions): Promise<this>;
|
|
158
|
+
/**
|
|
159
|
+
* Sets the NodeLink echo filter options on the audio.
|
|
160
|
+
* @param {EchoOptions} [echo] - The echo settings to apply.
|
|
161
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
162
|
+
*/
|
|
163
|
+
setEcho(echo?: EchoOptions): Promise<this>;
|
|
164
|
+
/**
|
|
165
|
+
* Sets the NodeLink reverb filter options on the audio.
|
|
166
|
+
* @param {ReverbOptions} [reverb] - The reverb settings to apply.
|
|
167
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
168
|
+
*/
|
|
169
|
+
setReverb(reverb?: ReverbOptions): Promise<this>;
|
|
170
|
+
/**
|
|
171
|
+
* Sets the NodeLink chorus filter options on the audio.
|
|
172
|
+
* @param {ChorusOptions} [chorus] - The chorus settings to apply.
|
|
173
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
174
|
+
*/
|
|
175
|
+
setChorus(chorus?: ChorusOptions): Promise<this>;
|
|
176
|
+
/**
|
|
177
|
+
* Sets the NodeLink compressor filter options on the audio.
|
|
178
|
+
* @param {CompressorOptions} [compressor] - The compressor settings to apply.
|
|
179
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
180
|
+
*/
|
|
181
|
+
setCompressor(compressor?: CompressorOptions): Promise<this>;
|
|
182
|
+
/**
|
|
183
|
+
* Sets the NodeLink flanger filter options on the audio.
|
|
184
|
+
* @param {FlangerOptions} [flanger] - The flanger settings to apply.
|
|
185
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
186
|
+
*/
|
|
187
|
+
setFlanger(flanger?: FlangerOptions): Promise<this>;
|
|
188
|
+
/**
|
|
189
|
+
* Sets the NodeLink phaser filter options on the audio.
|
|
190
|
+
* @param {PhaserOptions} [phaser] - The phaser settings to apply.
|
|
191
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
192
|
+
*/
|
|
193
|
+
setPhaser(phaser?: PhaserOptions): Promise<this>;
|
|
194
|
+
/**
|
|
195
|
+
* Sets the NodeLink phonograph filter options on the audio.
|
|
196
|
+
* @param {PhonographOptions} [phonograph] - The phonograph settings to apply.
|
|
197
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
198
|
+
*/
|
|
199
|
+
setPhonograph(phonograph?: PhonographOptions): Promise<this>;
|
|
200
|
+
/**
|
|
201
|
+
* Sets the NodeLink spatial filter options on the audio.
|
|
202
|
+
* @param {SpatialOptions} [spatial] - The spatial settings to apply.
|
|
203
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
204
|
+
*/
|
|
205
|
+
setSpatial(spatial?: SpatialOptions): Promise<this>;
|
|
206
|
+
/**
|
|
207
|
+
* Sets the NodeLink tape filter options on the audio.
|
|
208
|
+
* @param {TapeOptions} [tape] - The tape settings to apply.
|
|
209
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
210
|
+
*/
|
|
211
|
+
setTape(tape?: TapeOptions): Promise<this>;
|
|
212
|
+
setNodeLinkHighPass(highpass?: HighPassOptions): Promise<this>;
|
|
213
|
+
setNodeLinkEcho(echo?: EchoOptions): Promise<this>;
|
|
214
|
+
setNodeLinkReverb(reverb?: ReverbOptions): Promise<this>;
|
|
215
|
+
setNodeLinkChorus(chorus?: ChorusOptions): Promise<this>;
|
|
216
|
+
setNodeLinkCompressor(compressor?: CompressorOptions): Promise<this>;
|
|
217
|
+
setNodeLinkFlanger(flanger?: FlangerOptions): Promise<this>;
|
|
218
|
+
setNodeLinkPhaser(phaser?: PhaserOptions): Promise<this>;
|
|
219
|
+
setNodeLinkPhonograph(phonograph?: PhonographOptions): Promise<this>;
|
|
220
|
+
setNodeLinkSpatial(spatial?: SpatialOptions): Promise<this>;
|
|
221
|
+
setNodeLinkTape(tape?: TapeOptions): Promise<this>;
|
|
142
222
|
/**
|
|
143
223
|
* Sets plugin-provided filter options on the audio.
|
|
144
224
|
*
|
|
@@ -15,6 +15,15 @@ class Filters {
|
|
|
15
15
|
vibrato;
|
|
16
16
|
channelMix;
|
|
17
17
|
lowPass;
|
|
18
|
+
highpass;
|
|
19
|
+
echo;
|
|
20
|
+
chorus;
|
|
21
|
+
compressor;
|
|
22
|
+
flanger;
|
|
23
|
+
phaser;
|
|
24
|
+
phonograph;
|
|
25
|
+
spatial;
|
|
26
|
+
tape;
|
|
18
27
|
pluginFilters;
|
|
19
28
|
reverb;
|
|
20
29
|
volume;
|
|
@@ -32,6 +41,15 @@ class Filters {
|
|
|
32
41
|
this.vibrato = null;
|
|
33
42
|
this.channelMix = null;
|
|
34
43
|
this.lowPass = null;
|
|
44
|
+
this.highpass = null;
|
|
45
|
+
this.echo = null;
|
|
46
|
+
this.chorus = null;
|
|
47
|
+
this.compressor = null;
|
|
48
|
+
this.flanger = null;
|
|
49
|
+
this.phaser = null;
|
|
50
|
+
this.phonograph = null;
|
|
51
|
+
this.spatial = null;
|
|
52
|
+
this.tape = null;
|
|
35
53
|
this.pluginFilters = {};
|
|
36
54
|
this.reverb = null;
|
|
37
55
|
this.volume = 1.0;
|
|
@@ -57,23 +75,38 @@ class Filters {
|
|
|
57
75
|
* of the Filters class for method chaining.
|
|
58
76
|
*/
|
|
59
77
|
async updateFilters() {
|
|
60
|
-
const { channelMix, distortion, equalizer, karaoke, lowPass, pluginFilters, rotation, timescale, tremoloOptions, vibrato, volume } = this;
|
|
78
|
+
const { channelMix, chorus, compressor, distortion, echo, equalizer, flanger, highpass, karaoke, lowPass, phaser, phonograph, pluginFilters, reverb, rotation, spatial, tape, timescale, tremoloOptions, vibrato, volume, } = this;
|
|
79
|
+
const filters = {
|
|
80
|
+
distortion,
|
|
81
|
+
equalizer,
|
|
82
|
+
karaoke,
|
|
83
|
+
lowPass,
|
|
84
|
+
pluginFilters,
|
|
85
|
+
rotation,
|
|
86
|
+
timescale,
|
|
87
|
+
tremolo: tremoloOptions,
|
|
88
|
+
vibrato,
|
|
89
|
+
volume,
|
|
90
|
+
channelMix,
|
|
91
|
+
...(this.player.node.isNodeLink
|
|
92
|
+
? {
|
|
93
|
+
chorus,
|
|
94
|
+
compressor,
|
|
95
|
+
echo,
|
|
96
|
+
flanger,
|
|
97
|
+
highpass,
|
|
98
|
+
phaser,
|
|
99
|
+
phonograph,
|
|
100
|
+
reverb,
|
|
101
|
+
spatial,
|
|
102
|
+
tape,
|
|
103
|
+
}
|
|
104
|
+
: {}),
|
|
105
|
+
};
|
|
61
106
|
try {
|
|
62
107
|
await this.player.node.rest.updatePlayer({
|
|
63
108
|
data: {
|
|
64
|
-
filters
|
|
65
|
-
distortion,
|
|
66
|
-
equalizer,
|
|
67
|
-
karaoke,
|
|
68
|
-
lowPass,
|
|
69
|
-
pluginFilters,
|
|
70
|
-
rotation,
|
|
71
|
-
timescale,
|
|
72
|
-
tremolo: tremoloOptions,
|
|
73
|
-
vibrato,
|
|
74
|
-
volume,
|
|
75
|
-
channelMix,
|
|
76
|
-
},
|
|
109
|
+
filters,
|
|
77
110
|
},
|
|
78
111
|
guildId: this.player.guildId,
|
|
79
112
|
});
|
|
@@ -126,6 +159,15 @@ class Filters {
|
|
|
126
159
|
});
|
|
127
160
|
}
|
|
128
161
|
}
|
|
162
|
+
assertNodeLinkExtraFilterSupported(filterName) {
|
|
163
|
+
if (this.player.node.isNodeLink)
|
|
164
|
+
return;
|
|
165
|
+
throw new MagmastreamError_1.MagmaStreamError({
|
|
166
|
+
code: Enums_1.MagmaStreamErrorCode.NODE_PROTOCOL_ERROR,
|
|
167
|
+
message: `The "${filterName}" filter is only supported on NodeLink nodes.`,
|
|
168
|
+
context: { identifier: this.player.node.options.identifier },
|
|
169
|
+
});
|
|
170
|
+
}
|
|
129
171
|
/**
|
|
130
172
|
* Sets the status of a specific filter.
|
|
131
173
|
*
|
|
@@ -175,6 +217,16 @@ class Filters {
|
|
|
175
217
|
await this.setVibrato(null);
|
|
176
218
|
await this.setChannelMix(null);
|
|
177
219
|
await this.setLowPass(null);
|
|
220
|
+
await this.setHighPass(null);
|
|
221
|
+
await this.setEcho(null);
|
|
222
|
+
await this.setReverb(null);
|
|
223
|
+
await this.setChorus(null);
|
|
224
|
+
await this.setCompressor(null);
|
|
225
|
+
await this.setFlanger(null);
|
|
226
|
+
await this.setPhaser(null);
|
|
227
|
+
await this.setPhonograph(null);
|
|
228
|
+
await this.setSpatial(null);
|
|
229
|
+
await this.setTape(null);
|
|
178
230
|
await this.setPluginFilters({});
|
|
179
231
|
await this.updateFilters();
|
|
180
232
|
this.emitPlayersTasteUpdate(oldPlayer);
|
|
@@ -283,6 +335,176 @@ class Filters {
|
|
|
283
335
|
this.emitPlayersTasteUpdate(oldPlayer);
|
|
284
336
|
return this;
|
|
285
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Sets the NodeLink high pass filter options on the audio.
|
|
340
|
+
* @param {HighPassOptions} [highpass] - The high pass settings to apply.
|
|
341
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
342
|
+
*/
|
|
343
|
+
async setHighPass(highpass) {
|
|
344
|
+
const oldPlayer = { ...this };
|
|
345
|
+
if (highpass)
|
|
346
|
+
this.assertNodeLinkExtraFilterSupported("highpass");
|
|
347
|
+
await this.applyFilter({ property: "highpass", value: highpass ?? null });
|
|
348
|
+
this.setFilterStatus(Enums_1.AvailableFilters.SetHighPass, !!highpass);
|
|
349
|
+
this.emitPlayersTasteUpdate(oldPlayer);
|
|
350
|
+
return this;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Sets the NodeLink echo filter options on the audio.
|
|
354
|
+
* @param {EchoOptions} [echo] - The echo settings to apply.
|
|
355
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
356
|
+
*/
|
|
357
|
+
async setEcho(echo) {
|
|
358
|
+
const oldPlayer = { ...this };
|
|
359
|
+
if (echo)
|
|
360
|
+
this.assertNodeLinkExtraFilterSupported("echo");
|
|
361
|
+
await this.applyFilter({ property: "echo", value: echo ?? null });
|
|
362
|
+
this.setFilterStatus(Enums_1.AvailableFilters.SetEcho, !!echo);
|
|
363
|
+
this.emitPlayersTasteUpdate(oldPlayer);
|
|
364
|
+
return this;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Sets the NodeLink reverb filter options on the audio.
|
|
368
|
+
* @param {ReverbOptions} [reverb] - The reverb settings to apply.
|
|
369
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
370
|
+
*/
|
|
371
|
+
async setReverb(reverb) {
|
|
372
|
+
const oldPlayer = { ...this };
|
|
373
|
+
if (reverb)
|
|
374
|
+
this.assertNodeLinkExtraFilterSupported("reverb");
|
|
375
|
+
await this.applyFilter({ property: "reverb", value: reverb ?? null });
|
|
376
|
+
this.setFilterStatus(Enums_1.AvailableFilters.SetReverb, !!reverb);
|
|
377
|
+
this.emitPlayersTasteUpdate(oldPlayer);
|
|
378
|
+
return this;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Sets the NodeLink chorus filter options on the audio.
|
|
382
|
+
* @param {ChorusOptions} [chorus] - The chorus settings to apply.
|
|
383
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
384
|
+
*/
|
|
385
|
+
async setChorus(chorus) {
|
|
386
|
+
const oldPlayer = { ...this };
|
|
387
|
+
if (chorus)
|
|
388
|
+
this.assertNodeLinkExtraFilterSupported("chorus");
|
|
389
|
+
await this.applyFilter({ property: "chorus", value: chorus ?? null });
|
|
390
|
+
this.setFilterStatus(Enums_1.AvailableFilters.SetChorus, !!chorus);
|
|
391
|
+
this.emitPlayersTasteUpdate(oldPlayer);
|
|
392
|
+
return this;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Sets the NodeLink compressor filter options on the audio.
|
|
396
|
+
* @param {CompressorOptions} [compressor] - The compressor settings to apply.
|
|
397
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
398
|
+
*/
|
|
399
|
+
async setCompressor(compressor) {
|
|
400
|
+
const oldPlayer = { ...this };
|
|
401
|
+
if (compressor)
|
|
402
|
+
this.assertNodeLinkExtraFilterSupported("compressor");
|
|
403
|
+
await this.applyFilter({ property: "compressor", value: compressor ?? null });
|
|
404
|
+
this.setFilterStatus(Enums_1.AvailableFilters.SetCompressor, !!compressor);
|
|
405
|
+
this.emitPlayersTasteUpdate(oldPlayer);
|
|
406
|
+
return this;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Sets the NodeLink flanger filter options on the audio.
|
|
410
|
+
* @param {FlangerOptions} [flanger] - The flanger settings to apply.
|
|
411
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
412
|
+
*/
|
|
413
|
+
async setFlanger(flanger) {
|
|
414
|
+
const oldPlayer = { ...this };
|
|
415
|
+
if (flanger)
|
|
416
|
+
this.assertNodeLinkExtraFilterSupported("flanger");
|
|
417
|
+
await this.applyFilter({ property: "flanger", value: flanger ?? null });
|
|
418
|
+
this.setFilterStatus(Enums_1.AvailableFilters.SetFlanger, !!flanger);
|
|
419
|
+
this.emitPlayersTasteUpdate(oldPlayer);
|
|
420
|
+
return this;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Sets the NodeLink phaser filter options on the audio.
|
|
424
|
+
* @param {PhaserOptions} [phaser] - The phaser settings to apply.
|
|
425
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
426
|
+
*/
|
|
427
|
+
async setPhaser(phaser) {
|
|
428
|
+
const oldPlayer = { ...this };
|
|
429
|
+
if (phaser)
|
|
430
|
+
this.assertNodeLinkExtraFilterSupported("phaser");
|
|
431
|
+
await this.applyFilter({ property: "phaser", value: phaser ?? null });
|
|
432
|
+
this.setFilterStatus(Enums_1.AvailableFilters.SetPhaser, !!phaser);
|
|
433
|
+
this.emitPlayersTasteUpdate(oldPlayer);
|
|
434
|
+
return this;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Sets the NodeLink phonograph filter options on the audio.
|
|
438
|
+
* @param {PhonographOptions} [phonograph] - The phonograph settings to apply.
|
|
439
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
440
|
+
*/
|
|
441
|
+
async setPhonograph(phonograph) {
|
|
442
|
+
const oldPlayer = { ...this };
|
|
443
|
+
if (phonograph)
|
|
444
|
+
this.assertNodeLinkExtraFilterSupported("phonograph");
|
|
445
|
+
await this.applyFilter({ property: "phonograph", value: phonograph ?? null });
|
|
446
|
+
this.setFilterStatus(Enums_1.AvailableFilters.SetPhonograph, !!phonograph);
|
|
447
|
+
this.emitPlayersTasteUpdate(oldPlayer);
|
|
448
|
+
return this;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Sets the NodeLink spatial filter options on the audio.
|
|
452
|
+
* @param {SpatialOptions} [spatial] - The spatial settings to apply.
|
|
453
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
454
|
+
*/
|
|
455
|
+
async setSpatial(spatial) {
|
|
456
|
+
const oldPlayer = { ...this };
|
|
457
|
+
if (spatial)
|
|
458
|
+
this.assertNodeLinkExtraFilterSupported("spatial");
|
|
459
|
+
await this.applyFilter({ property: "spatial", value: spatial ?? null });
|
|
460
|
+
this.setFilterStatus(Enums_1.AvailableFilters.SetSpatial, !!spatial);
|
|
461
|
+
this.emitPlayersTasteUpdate(oldPlayer);
|
|
462
|
+
return this;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Sets the NodeLink tape filter options on the audio.
|
|
466
|
+
* @param {TapeOptions} [tape] - The tape settings to apply.
|
|
467
|
+
* @returns {Promise<this>} - Returns the current instance of the Filters class for method chaining.
|
|
468
|
+
*/
|
|
469
|
+
async setTape(tape) {
|
|
470
|
+
const oldPlayer = { ...this };
|
|
471
|
+
if (tape)
|
|
472
|
+
this.assertNodeLinkExtraFilterSupported("tape");
|
|
473
|
+
await this.applyFilter({ property: "tape", value: tape ?? null });
|
|
474
|
+
this.setFilterStatus(Enums_1.AvailableFilters.SetTape, !!tape);
|
|
475
|
+
this.emitPlayersTasteUpdate(oldPlayer);
|
|
476
|
+
return this;
|
|
477
|
+
}
|
|
478
|
+
async setNodeLinkHighPass(highpass) {
|
|
479
|
+
return this.setHighPass(highpass);
|
|
480
|
+
}
|
|
481
|
+
async setNodeLinkEcho(echo) {
|
|
482
|
+
return this.setEcho(echo);
|
|
483
|
+
}
|
|
484
|
+
async setNodeLinkReverb(reverb) {
|
|
485
|
+
return this.setReverb(reverb);
|
|
486
|
+
}
|
|
487
|
+
async setNodeLinkChorus(chorus) {
|
|
488
|
+
return this.setChorus(chorus);
|
|
489
|
+
}
|
|
490
|
+
async setNodeLinkCompressor(compressor) {
|
|
491
|
+
return this.setCompressor(compressor);
|
|
492
|
+
}
|
|
493
|
+
async setNodeLinkFlanger(flanger) {
|
|
494
|
+
return this.setFlanger(flanger);
|
|
495
|
+
}
|
|
496
|
+
async setNodeLinkPhaser(phaser) {
|
|
497
|
+
return this.setPhaser(phaser);
|
|
498
|
+
}
|
|
499
|
+
async setNodeLinkPhonograph(phonograph) {
|
|
500
|
+
return this.setPhonograph(phonograph);
|
|
501
|
+
}
|
|
502
|
+
async setNodeLinkSpatial(spatial) {
|
|
503
|
+
return this.setSpatial(spatial);
|
|
504
|
+
}
|
|
505
|
+
async setNodeLinkTape(tape) {
|
|
506
|
+
return this.setTape(tape);
|
|
507
|
+
}
|
|
286
508
|
/**
|
|
287
509
|
* Sets plugin-provided filter options on the audio.
|
|
288
510
|
*
|
|
@@ -135,6 +135,12 @@ export declare class Manager extends EventEmitter {
|
|
|
135
135
|
* @returns A promise that resolves when the player states have been loaded.
|
|
136
136
|
*/
|
|
137
137
|
loadPlayerStates(nodeId: string): Promise<void>;
|
|
138
|
+
private isNodeLinkSearchSource;
|
|
139
|
+
private isPrefixedLoadTracksIdentifier;
|
|
140
|
+
private requiresNodeLinkSearchNode;
|
|
141
|
+
private requiresLavalinkSearchNode;
|
|
142
|
+
private getSearchNode;
|
|
143
|
+
private getPreferredNode;
|
|
138
144
|
/**
|
|
139
145
|
* Returns the node to use based on the configured `useNode` and `enablePriorityMode` options.
|
|
140
146
|
* If `enablePriorityMode` is true, the node is chosen based on priority, otherwise it is chosen based on the `useNode` option.
|