Class PlayerUpdateBuilder
-
- All Implemented Interfaces:
-
dev.arbjerg.lavalink.client.player.IUpdatablePlayer
,org.reactivestreams.Publisher
,reactor.core.CorePublisher
public final class PlayerUpdateBuilder extends Mono<LavalinkPlayer> implements IUpdatablePlayer
-
-
Method Summary
Modifier and Type Method Description PlayerUpdateBuilder
setTrack(Track track)
Shortcut for setting the encoded track. PlayerUpdateBuilder
updateTrack(PlayerUpdateTrack update)
Allows you to set the track via the TrackUpdateBuilder. PlayerUpdateBuilder
stopTrack()
Shortcut for setting the encoded track to {@code null}. PlayerUpdateBuilder
setPosition(Long position)
Update the position of the player. PlayerUpdateBuilder
setEndTime(Long endTime)
Update the end time of the track. PlayerUpdateBuilder
omitEndTime()
Omits the end time from being sent to the node during updates. PlayerUpdateBuilder
setVolume(Integer volume)
Update the volume of the player. PlayerUpdateBuilder
setPaused(Boolean paused)
Update the paused state of the player. PlayerUpdateBuilder
setFilters(Filters filters)
Update the filters for the player. PlayerUpdateBuilder
setVoiceState(VoiceState state)
Update the voice state for the player.<br> <strong>IMPORTANT:</strong> Only ever use Link. final PlayerUpdateBuilder
setNoReplace(Boolean noReplace)
final PlayerUpdate
build()
Unit
subscribe(CoreSubscriber<in LavalinkPlayer> actual)
-
Methods inherited from class reactor.core.publisher.Mono
and, as, block, block, blockOptional, blockOptional, cache, cache, cache, cache, cache, cacheInvalidateIf, cacheInvalidateWhen, cacheInvalidateWhen, cancelOn, cast, checkpoint, checkpoint, checkpoint, concatWith, contextCapture, contextWrite, contextWrite, defaultIfEmpty, delayElement, delayElement, delaySubscription, delaySubscription, delaySubscription, delayUntil, dematerialize, doAfterTerminate, doFinally, doFirst, doOnCancel, doOnDiscard, doOnEach, doOnError, doOnError, doOnError, doOnNext, doOnRequest, doOnSubscribe, doOnSuccess, doOnTerminate, elapsed, elapsed, expand, expand, expandDeep, expandDeep, filter, filterWhen, flatMap, flatMapIterable, flatMapMany, flatMapMany, flux, handle, hasElement, hide, ignoreElement, log, log, log, log, log, log, map, mapNotNull, materialize, mergeWith, metrics, name, ofType, onErrorComplete, onErrorComplete, onErrorComplete, onErrorContinue, onErrorContinue, onErrorContinue, onErrorMap, onErrorMap, onErrorMap, onErrorResume, onErrorResume, onErrorResume, onErrorReturn, onErrorReturn, onErrorReturn, onErrorStop, onTerminateDetach, or, publish, publishOn, repeat, repeat, repeat, repeat, repeatWhen, repeatWhenEmpty, repeatWhenEmpty, retry, retry, retryWhen, share, single, singleOptional, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeWith, switchIfEmpty, tag, take, take, takeUntilOther, tap, tap, tap, then, then, thenEmpty, thenMany, thenReturn, timed, timed, timeout, timeout, timeout, timeout, timeout, timeout, timestamp, timestamp, toFuture, toString, transform, transformDeferred, transformDeferredContextual, zipWhen, zipWhen, zipWith, zipWith
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setTrack
PlayerUpdateBuilder setTrack(Track track)
Shortcut for setting the encoded track. This will also send any user-data supplied. Please keep in mind that this will set the position field to the current position of the track.
- Parameters:
track
- The track to apply to this builder- Returns:
The updated builder, useful for chaining
-
updateTrack
PlayerUpdateBuilder updateTrack(PlayerUpdateTrack update)
Allows you to set the track via the TrackUpdateBuilder. To stop the player, you can use stopTrack or setTrack with a null track.
- Parameters:
update
- the update params created via the TrackUpdateBuilder.- Returns:
The updated builder, useful for chaining
-
stopTrack
PlayerUpdateBuilder stopTrack()
Shortcut for setting the encoded track to {@code null}. This will also clear the user data.
- Returns:
The updated builder, useful for chaining
-
setPosition
PlayerUpdateBuilder setPosition(Long position)
Update the position of the player.
- Parameters:
position
- The new position of the player.- Returns:
The updated builder, useful for chaining
-
setEndTime
PlayerUpdateBuilder setEndTime(Long endTime)
Update the end time of the track.
- Parameters:
endTime
- The new end time of the track.- Returns:
The updated builder, useful for chaining
-
omitEndTime
PlayerUpdateBuilder omitEndTime()
Omits the end time from being sent to the node during updates.
- Returns:
The updated builder, useful for chaining
-
setVolume
PlayerUpdateBuilder setVolume(Integer volume)
Update the volume of the player. While you could use the filters to set volume as well, do note that that is float based (1.0f is 100% volume) and takes the time of your buffer size to apply. This method updates the volume instantly after the update is sent out.
- Parameters:
volume
- The new player volume, value is between 0 and 1000 where 100 is 100% (default) volume.- Returns:
The updated builder, useful for chaining
-
setPaused
PlayerUpdateBuilder setPaused(Boolean paused)
Update the paused state of the player.
- Parameters:
paused
- Whether the player should be paused or not.- Returns:
The updated builder, useful for chaining
-
setFilters
PlayerUpdateBuilder setFilters(Filters filters)
Update the filters for the player. Please use setVolume to update the player's volume instead. Setting the volume via filters is float based (1.0f is 100% volume) and takes the time of your buffer size to apply.
- Parameters:
filters
- The new filters to apply to the player.- Returns:
The updated builder, useful for chaining
-
setVoiceState
PlayerUpdateBuilder setVoiceState(VoiceState state)
Update the voice state for the player.<br> <strong>IMPORTANT:</strong> Only ever use Link.onVoiceServerUpdate to update the voice server as this sets the state of the link to LinkState.CONNECTING
- Returns:
The updated builder, useful for chaining
-
setNoReplace
final PlayerUpdateBuilder setNoReplace(Boolean noReplace)
-
build
final PlayerUpdate build()
-
subscribe
Unit subscribe(CoreSubscriber<in LavalinkPlayer> actual)
-
-
-
-