Class FilterBuilder
-
- All Implemented Interfaces:
public final class FilterBuilder
Helper class fo builder Filters.
-
-
Constructor Summary
Constructors Constructor Description FilterBuilder()
-
Method Summary
Modifier and Type Method Description final FilterBuilder
setVolume(Float volume)
Sets the filter volume. final FilterBuilder
setEqualizer(List<Band> equalizer)
Set the equalizer bands on the player. final FilterBuilder
setEqualizerBand(Integer band, Float gain)
Set a specific band on the equalizer. final FilterBuilder
setEqualizerBand(Integer band)
Set a specific band on the equalizer. final FilterBuilder
setKaraoke(Karaoke karaoke)
Set the karaoke filter on the player. final FilterBuilder
setTimescale(Timescale timescale)
Sets the timescale filter on the player. final FilterBuilder
setTremolo(Tremolo tremolo)
Sets the tremolo filter on the player. final FilterBuilder
setVibrato(Vibrato vibrato)
Sets the vibrato filter on the player. final FilterBuilder
setDistortion(Distortion distortion)
Sets the distortion filter on the player. final FilterBuilder
setRotation(Rotation rotation)
Sets the rotation filter on the player. final FilterBuilder
setChannelMix(ChannelMix channelMix)
Sets the channel mix filter on the player. final FilterBuilder
setLowPass(LowPass lowPass)
Sets the low pass filter on the player. final FilterBuilder
setPluginFilter(String name, Object filter)
Set custom filter data for a plugin. final FilterBuilder
setPluginFilter(String name, JsonElement filter)
Set custom filter data for a plugin. final FilterBuilder
removePluginFilter(String name)
Removes a plugin filter with the given name. final Filters
build()
Builds the Filters object with the current configuration. -
-
Method Detail
-
setVolume
final FilterBuilder setVolume(Float volume)
Sets the filter volume. If you just want to change the volume, it is highly recommended to use dev.arbjerg.lavalink.client.IUpdatablePlayer.setVolume instead.
This volume takes the time of your buffer size to apply and should only be used if any other filters would increase the overall volume too much.
- Parameters:
volume
- The volume to apply to the filter.- Returns:
The updated builder, useful for chaining
-
setEqualizer
final FilterBuilder setEqualizer(List<Band> equalizer)
Set the equalizer bands on the player.
- Parameters:
equalizer
- Each band to set in the equalizer.- Returns:
The updated builder, useful for chaining
-
setEqualizerBand
@JvmOverloads() final FilterBuilder setEqualizerBand(Integer band, Float gain)
Set a specific band on the equalizer.
- Parameters:
band
- The band to set.gain
- The gain to apply to the band.- Returns:
The updated builder, useful for chaining
-
setEqualizerBand
@JvmOverloads() final FilterBuilder setEqualizerBand(Integer band)
Set a specific band on the equalizer.
- Parameters:
band
- The band to set.- Returns:
The updated builder, useful for chaining
-
setKaraoke
final FilterBuilder setKaraoke(Karaoke karaoke)
Set the karaoke filter on the player.
- Parameters:
karaoke
- The karaoke filter to apply to the player.- Returns:
The updated builder, useful for chaining
-
setTimescale
final FilterBuilder setTimescale(Timescale timescale)
Sets the timescale filter on the player.
- Parameters:
timescale
- The timescale filter to apply to the player.- Returns:
The updated builder, useful for chaining
-
setTremolo
final FilterBuilder setTremolo(Tremolo tremolo)
Sets the tremolo filter on the player.
- Parameters:
tremolo
- The tremolo filter to apply to the player.- Returns:
The updated builder, useful for chaining
-
setVibrato
final FilterBuilder setVibrato(Vibrato vibrato)
Sets the vibrato filter on the player.
- Parameters:
vibrato
- The vibrato filter to apply to the player.- Returns:
The updated builder, useful for chaining
-
setDistortion
final FilterBuilder setDistortion(Distortion distortion)
Sets the distortion filter on the player.
- Parameters:
distortion
- The distortion filter to apply to the player.- Returns:
The updated builder, useful for chaining
-
setRotation
final FilterBuilder setRotation(Rotation rotation)
Sets the rotation filter on the player.
- Parameters:
rotation
- The rotation filter to apply to the player.- Returns:
The updated builder, useful for chaining
-
setChannelMix
final FilterBuilder setChannelMix(ChannelMix channelMix)
Sets the channel mix filter on the player.
- Parameters:
channelMix
- The channel mix filter to apply to the player.- Returns:
The updated builder, useful for chaining
-
setLowPass
final FilterBuilder setLowPass(LowPass lowPass)
Sets the low pass filter on the player.
- Parameters:
lowPass
- The low pass filter to apply to the player.- Returns:
The updated builder, useful for chaining
-
setPluginFilter
final FilterBuilder setPluginFilter(String name, Object filter)
Set custom filter data for a plugin.
- Parameters:
name
- the name of the plugin filterfilter
- the filter data, can be a custom class as it will be serialised to json- Returns:
The updated builder, useful for chaining
-
setPluginFilter
final FilterBuilder setPluginFilter(String name, JsonElement filter)
Set custom filter data for a plugin.
- Parameters:
name
- the name of the plugin filterfilter
- kotlin JsonElement that holds the filter data.- Returns:
The updated builder, useful for chaining
-
removePluginFilter
final FilterBuilder removePluginFilter(String name)
Removes a plugin filter with the given name.
- Parameters:
name
- the name of the plugin filter- Returns:
The updated builder, useful for chaining
-
build
final Filters build()
Builds the Filters object with the current configuration.
- Returns:
the Filters object with the current configuration
-
-
-
-