magmastream 2.10.3-alpha.6 → 2.10.3-alpha.7
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 +50 -0
- package/dist/structures/Enums.js +52 -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,42 @@ export declare enum SearchPlatform {
|
|
|
72
72
|
YouTube = "ytsearch",
|
|
73
73
|
YouTubeMusic = "ytmsearch"
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* NodeLink-only Search Platform Enum
|
|
77
|
+
*/
|
|
78
|
+
export declare enum NodeLinkSearchPlatform {
|
|
79
|
+
AmazonMusic = "amazonmusic",
|
|
80
|
+
AmazonMusicSearch = "azsearch",
|
|
81
|
+
Anghami = "agsearch",
|
|
82
|
+
Audiomack = "audiomack",
|
|
83
|
+
AudiomackSearch = "admsearch",
|
|
84
|
+
Audius = "ausearch",
|
|
85
|
+
Bilibili = "bilibili",
|
|
86
|
+
BilibiliSearch = "bilisearch",
|
|
87
|
+
Bluesky = "bksearch",
|
|
88
|
+
Flowery = "flowery",
|
|
89
|
+
FloweryTTS = "ftts",
|
|
90
|
+
Gaana = "gaanasearch",
|
|
91
|
+
GaanaSearch = "gnsearch",
|
|
92
|
+
GoogleDrive = "gdsearch",
|
|
93
|
+
GoogleTTS = "gtts",
|
|
94
|
+
IHeartRadio = "iheartradio",
|
|
95
|
+
IHeartRadioSearch = "ihsearch",
|
|
96
|
+
LastFM = "lfsearch",
|
|
97
|
+
LazyTTS = "lazypytts",
|
|
98
|
+
LazyTTSAlt = "lazytts",
|
|
99
|
+
LetrasMus = "lmsearch",
|
|
100
|
+
Mixcloud = "mixcloud",
|
|
101
|
+
MixcloudSearch = "mcsearch",
|
|
102
|
+
Netease = "ntsearch",
|
|
103
|
+
NicoVideo = "nicovideo",
|
|
104
|
+
NicoVideoSearch = "ncsearch",
|
|
105
|
+
Pandora = "pdsearch",
|
|
106
|
+
PiperTTS = "pipertts",
|
|
107
|
+
Shazam = "shsearch",
|
|
108
|
+
ShazamAlt = "szsearch",
|
|
109
|
+
SongLink = "slsearch"
|
|
110
|
+
}
|
|
75
111
|
/**
|
|
76
112
|
* Player State Event Types Enum
|
|
77
113
|
*/
|
|
@@ -192,6 +228,10 @@ export declare enum ManagerEventTypes {
|
|
|
192
228
|
TrackStart = "trackStart",
|
|
193
229
|
TrackStuck = "trackStuck",
|
|
194
230
|
/** Nodelink */
|
|
231
|
+
MixStarted = "mixStarted",
|
|
232
|
+
/** Nodelink */
|
|
233
|
+
MixEnded = "mixEnded",
|
|
234
|
+
/** Nodelink */
|
|
195
235
|
VoiceReceiverDisconnect = "voiceReceiverDisconnect",
|
|
196
236
|
/** Nodelink */
|
|
197
237
|
VoiceReceiverConnect = "voiceReceiverConnect",
|
|
@@ -253,11 +293,21 @@ export declare enum AvailableFilters {
|
|
|
253
293
|
Pop = "pop",
|
|
254
294
|
Radio = "radio",
|
|
255
295
|
PluginFilters = "pluginFilters",
|
|
296
|
+
SetChorus = "setChorus",
|
|
256
297
|
SetChannelMix = "setChannelMix",
|
|
298
|
+
SetCompressor = "setCompressor",
|
|
257
299
|
SetDistortion = "setDistortion",
|
|
300
|
+
SetEcho = "setEcho",
|
|
301
|
+
SetFlanger = "setFlanger",
|
|
302
|
+
SetHighPass = "setHighPass",
|
|
258
303
|
SetKaraoke = "setKaraoke",
|
|
259
304
|
SetLowPass = "setLowPass",
|
|
305
|
+
SetPhaser = "setPhaser",
|
|
306
|
+
SetPhonograph = "setPhonograph",
|
|
307
|
+
SetReverb = "setReverb",
|
|
260
308
|
SetRotation = "setRotation",
|
|
309
|
+
SetSpatial = "setSpatial",
|
|
310
|
+
SetTape = "setTape",
|
|
261
311
|
SetTimescale = "setTimescale",
|
|
262
312
|
SetTremolo = "setTremolo",
|
|
263
313
|
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,43 @@ var SearchPlatform;
|
|
|
80
80
|
SearchPlatform["YouTube"] = "ytsearch";
|
|
81
81
|
SearchPlatform["YouTubeMusic"] = "ytmsearch";
|
|
82
82
|
})(SearchPlatform || (exports.SearchPlatform = SearchPlatform = {}));
|
|
83
|
+
/**
|
|
84
|
+
* NodeLink-only Search Platform Enum
|
|
85
|
+
*/
|
|
86
|
+
var NodeLinkSearchPlatform;
|
|
87
|
+
(function (NodeLinkSearchPlatform) {
|
|
88
|
+
NodeLinkSearchPlatform["AmazonMusic"] = "amazonmusic";
|
|
89
|
+
NodeLinkSearchPlatform["AmazonMusicSearch"] = "azsearch";
|
|
90
|
+
NodeLinkSearchPlatform["Anghami"] = "agsearch";
|
|
91
|
+
NodeLinkSearchPlatform["Audiomack"] = "audiomack";
|
|
92
|
+
NodeLinkSearchPlatform["AudiomackSearch"] = "admsearch";
|
|
93
|
+
NodeLinkSearchPlatform["Audius"] = "ausearch";
|
|
94
|
+
NodeLinkSearchPlatform["Bilibili"] = "bilibili";
|
|
95
|
+
NodeLinkSearchPlatform["BilibiliSearch"] = "bilisearch";
|
|
96
|
+
NodeLinkSearchPlatform["Bluesky"] = "bksearch";
|
|
97
|
+
NodeLinkSearchPlatform["Flowery"] = "flowery";
|
|
98
|
+
NodeLinkSearchPlatform["FloweryTTS"] = "ftts";
|
|
99
|
+
NodeLinkSearchPlatform["Gaana"] = "gaanasearch";
|
|
100
|
+
NodeLinkSearchPlatform["GaanaSearch"] = "gnsearch";
|
|
101
|
+
NodeLinkSearchPlatform["GoogleDrive"] = "gdsearch";
|
|
102
|
+
NodeLinkSearchPlatform["GoogleTTS"] = "gtts";
|
|
103
|
+
NodeLinkSearchPlatform["IHeartRadio"] = "iheartradio";
|
|
104
|
+
NodeLinkSearchPlatform["IHeartRadioSearch"] = "ihsearch";
|
|
105
|
+
NodeLinkSearchPlatform["LastFM"] = "lfsearch";
|
|
106
|
+
NodeLinkSearchPlatform["LazyTTS"] = "lazypytts";
|
|
107
|
+
NodeLinkSearchPlatform["LazyTTSAlt"] = "lazytts";
|
|
108
|
+
NodeLinkSearchPlatform["LetrasMus"] = "lmsearch";
|
|
109
|
+
NodeLinkSearchPlatform["Mixcloud"] = "mixcloud";
|
|
110
|
+
NodeLinkSearchPlatform["MixcloudSearch"] = "mcsearch";
|
|
111
|
+
NodeLinkSearchPlatform["Netease"] = "ntsearch";
|
|
112
|
+
NodeLinkSearchPlatform["NicoVideo"] = "nicovideo";
|
|
113
|
+
NodeLinkSearchPlatform["NicoVideoSearch"] = "ncsearch";
|
|
114
|
+
NodeLinkSearchPlatform["Pandora"] = "pdsearch";
|
|
115
|
+
NodeLinkSearchPlatform["PiperTTS"] = "pipertts";
|
|
116
|
+
NodeLinkSearchPlatform["Shazam"] = "shsearch";
|
|
117
|
+
NodeLinkSearchPlatform["ShazamAlt"] = "szsearch";
|
|
118
|
+
NodeLinkSearchPlatform["SongLink"] = "slsearch";
|
|
119
|
+
})(NodeLinkSearchPlatform || (exports.NodeLinkSearchPlatform = NodeLinkSearchPlatform = {}));
|
|
83
120
|
/**
|
|
84
121
|
* Player State Event Types Enum
|
|
85
122
|
*/
|
|
@@ -205,6 +242,10 @@ var ManagerEventTypes;
|
|
|
205
242
|
ManagerEventTypes["TrackStart"] = "trackStart";
|
|
206
243
|
ManagerEventTypes["TrackStuck"] = "trackStuck";
|
|
207
244
|
/** Nodelink */
|
|
245
|
+
ManagerEventTypes["MixStarted"] = "mixStarted";
|
|
246
|
+
/** Nodelink */
|
|
247
|
+
ManagerEventTypes["MixEnded"] = "mixEnded";
|
|
248
|
+
/** Nodelink */
|
|
208
249
|
ManagerEventTypes["VoiceReceiverDisconnect"] = "voiceReceiverDisconnect";
|
|
209
250
|
/** Nodelink */
|
|
210
251
|
ManagerEventTypes["VoiceReceiverConnect"] = "voiceReceiverConnect";
|
|
@@ -270,11 +311,21 @@ var AvailableFilters;
|
|
|
270
311
|
AvailableFilters["Pop"] = "pop";
|
|
271
312
|
AvailableFilters["Radio"] = "radio";
|
|
272
313
|
AvailableFilters["PluginFilters"] = "pluginFilters";
|
|
314
|
+
AvailableFilters["SetChorus"] = "setChorus";
|
|
273
315
|
AvailableFilters["SetChannelMix"] = "setChannelMix";
|
|
316
|
+
AvailableFilters["SetCompressor"] = "setCompressor";
|
|
274
317
|
AvailableFilters["SetDistortion"] = "setDistortion";
|
|
318
|
+
AvailableFilters["SetEcho"] = "setEcho";
|
|
319
|
+
AvailableFilters["SetFlanger"] = "setFlanger";
|
|
320
|
+
AvailableFilters["SetHighPass"] = "setHighPass";
|
|
275
321
|
AvailableFilters["SetKaraoke"] = "setKaraoke";
|
|
276
322
|
AvailableFilters["SetLowPass"] = "setLowPass";
|
|
323
|
+
AvailableFilters["SetPhaser"] = "setPhaser";
|
|
324
|
+
AvailableFilters["SetPhonograph"] = "setPhonograph";
|
|
325
|
+
AvailableFilters["SetReverb"] = "setReverb";
|
|
277
326
|
AvailableFilters["SetRotation"] = "setRotation";
|
|
327
|
+
AvailableFilters["SetSpatial"] = "setSpatial";
|
|
328
|
+
AvailableFilters["SetTape"] = "setTape";
|
|
278
329
|
AvailableFilters["SetTimescale"] = "setTimescale";
|
|
279
330
|
AvailableFilters["SetTremolo"] = "setTremolo";
|
|
280
331
|
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.
|