diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/AbstractAudioLoadResultHandler.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/AbstractAudioLoadResultHandler.kt index 8591c8e..889e3d3 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/AbstractAudioLoadResultHandler.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/AbstractAudioLoadResultHandler.kt @@ -1,6 +1,6 @@ package dev.arbjerg.lavalink.client -import dev.arbjerg.lavalink.client.protocol.* +import dev.arbjerg.lavalink.client.player.* import java.util.function.Consumer abstract class AbstractAudioLoadResultHandler : Consumer { diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/FunctionalLoadResultHandler.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/FunctionalLoadResultHandler.kt index bc8bc60..aeb85d7 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/FunctionalLoadResultHandler.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/FunctionalLoadResultHandler.kt @@ -1,9 +1,9 @@ package dev.arbjerg.lavalink.client -import dev.arbjerg.lavalink.client.protocol.LoadFailed -import dev.arbjerg.lavalink.client.protocol.PlaylistLoaded -import dev.arbjerg.lavalink.client.protocol.SearchResult -import dev.arbjerg.lavalink.client.protocol.TrackLoaded +import dev.arbjerg.lavalink.client.player.LoadFailed +import dev.arbjerg.lavalink.client.player.PlaylistLoaded +import dev.arbjerg.lavalink.client.player.SearchResult +import dev.arbjerg.lavalink.client.player.TrackLoaded import java.util.function.Consumer /** diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkClient.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkClient.kt index 4527970..c8de9d7 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkClient.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkClient.kt @@ -4,6 +4,7 @@ import dev.arbjerg.lavalink.client.loadbalancing.ILoadBalancer import dev.arbjerg.lavalink.client.loadbalancing.VoiceRegion import dev.arbjerg.lavalink.client.loadbalancing.builtin.DefaultLoadBalancer import dev.arbjerg.lavalink.client.event.ClientEvent +import dev.arbjerg.lavalink.client.player.LavalinkPlayer import dev.arbjerg.lavalink.internal.ReconnectTask import reactor.core.Disposable import reactor.core.publisher.Flux diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkNode.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkNode.kt index 9478bec..a30c57d 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkNode.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkNode.kt @@ -2,9 +2,9 @@ package dev.arbjerg.lavalink.client import dev.arbjerg.lavalink.client.event.ClientEvent import dev.arbjerg.lavalink.client.http.HttpBuilder -import dev.arbjerg.lavalink.client.protocol.* -import dev.arbjerg.lavalink.client.protocol.Track -import dev.arbjerg.lavalink.client.protocol.toCustom +import dev.arbjerg.lavalink.client.player.* +import dev.arbjerg.lavalink.client.player.Track +import dev.arbjerg.lavalink.client.player.toCustom import dev.arbjerg.lavalink.internal.* import dev.arbjerg.lavalink.internal.error.RestException import dev.arbjerg.lavalink.internal.loadbalancing.Penalties diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/Link.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/Link.kt index 268fd56..c7cb186 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/Link.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/Link.kt @@ -1,5 +1,7 @@ package dev.arbjerg.lavalink.client +import dev.arbjerg.lavalink.client.player.LavalinkPlayer +import dev.arbjerg.lavalink.client.player.PlayerUpdateBuilder import dev.arbjerg.lavalink.protocol.v4.VoiceState import java.time.Duration import java.util.function.Consumer diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/event/events.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/event/events.kt index 812eac9..2974e6c 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/event/events.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/event/events.kt @@ -1,9 +1,9 @@ package dev.arbjerg.lavalink.client.event import dev.arbjerg.lavalink.client.LavalinkNode -import dev.arbjerg.lavalink.client.protocol.Track -import dev.arbjerg.lavalink.client.protocol.TrackException -import dev.arbjerg.lavalink.client.protocol.toCustom +import dev.arbjerg.lavalink.client.player.Track +import dev.arbjerg.lavalink.client.player.TrackException +import dev.arbjerg.lavalink.client.player.toCustom import dev.arbjerg.lavalink.protocol.v4.* import dev.arbjerg.lavalink.protocol.v4.Message.EmittedEvent.TrackEndEvent.AudioTrackEndReason diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/protocol/FilterBuilder.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/player/FilterBuilder.kt similarity index 99% rename from src/main/kotlin/dev/arbjerg/lavalink/client/protocol/FilterBuilder.kt rename to src/main/kotlin/dev/arbjerg/lavalink/client/player/FilterBuilder.kt index ee36843..2b15a1a 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/protocol/FilterBuilder.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/player/FilterBuilder.kt @@ -1,4 +1,4 @@ -package dev.arbjerg.lavalink.client.protocol +package dev.arbjerg.lavalink.client.player import dev.arbjerg.lavalink.internal.toJsonElement import dev.arbjerg.lavalink.protocol.v4.* diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/IUpdatablePlayer.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/player/IUpdatablePlayer.kt similarity index 93% rename from src/main/kotlin/dev/arbjerg/lavalink/client/IUpdatablePlayer.kt rename to src/main/kotlin/dev/arbjerg/lavalink/client/player/IUpdatablePlayer.kt index cd4418f..639e891 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/IUpdatablePlayer.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/player/IUpdatablePlayer.kt @@ -1,10 +1,8 @@ -package dev.arbjerg.lavalink.client +package dev.arbjerg.lavalink.client.player -import dev.arbjerg.lavalink.client.protocol.Track import dev.arbjerg.lavalink.protocol.v4.Filters import dev.arbjerg.lavalink.protocol.v4.PlayerUpdateTrack import dev.arbjerg.lavalink.protocol.v4.VoiceState -import dev.arbjerg.lavalink.client.protocol.TrackUpdateBuilder interface IUpdatablePlayer { /** @@ -84,7 +82,7 @@ interface IUpdatablePlayer { * 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. * - * @param filters The new filters to apply to the player. You can use the [dev.arbjerg.lavalink.client.protocol.FilterBuilder] to easily create this object. + * @param filters The new filters to apply to the player. You can use the [dev.arbjerg.lavalink.client.player.FilterBuilder] to easily create this object. * * @return The updated builder, useful for chaining */ diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkPlayer.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/player/LavalinkPlayer.kt similarity index 95% rename from src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkPlayer.kt rename to src/main/kotlin/dev/arbjerg/lavalink/client/player/LavalinkPlayer.kt index 8d656fb..8967d97 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkPlayer.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/player/LavalinkPlayer.kt @@ -1,8 +1,7 @@ -package dev.arbjerg.lavalink.client +package dev.arbjerg.lavalink.client.player +import dev.arbjerg.lavalink.client.LavalinkNode import dev.arbjerg.lavalink.client.loadbalancing.VoiceRegion -import dev.arbjerg.lavalink.client.protocol.Track -import dev.arbjerg.lavalink.client.protocol.toCustom import dev.arbjerg.lavalink.protocol.v4.* import kotlin.math.min diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/PlayerUpdateBuilder.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/player/PlayerUpdateBuilder.kt similarity index 96% rename from src/main/kotlin/dev/arbjerg/lavalink/client/PlayerUpdateBuilder.kt rename to src/main/kotlin/dev/arbjerg/lavalink/client/player/PlayerUpdateBuilder.kt index b832ef2..ad21fd0 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/PlayerUpdateBuilder.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/player/PlayerUpdateBuilder.kt @@ -1,13 +1,14 @@ -package dev.arbjerg.lavalink.client +package dev.arbjerg.lavalink.client.player -import dev.arbjerg.lavalink.client.protocol.Track +import dev.arbjerg.lavalink.client.LavalinkNode import dev.arbjerg.lavalink.internal.toKotlin import dev.arbjerg.lavalink.internal.toLavalinkPlayer import dev.arbjerg.lavalink.protocol.v4.* import reactor.core.CoreSubscriber import reactor.core.publisher.Mono -class PlayerUpdateBuilder internal constructor(private val node: LavalinkNode, private val guildId: Long) : Mono(), IUpdatablePlayer { +class PlayerUpdateBuilder internal constructor(private val node: LavalinkNode, private val guildId: Long) : Mono(), + IUpdatablePlayer { private var trackUpdate: Omissible = Omissible.omitted() private var position: Omissible = Omissible.omitted() private var endTime: Omissible = Omissible.omitted() diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/protocol/Track.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/player/Track.kt similarity index 93% rename from src/main/kotlin/dev/arbjerg/lavalink/client/protocol/Track.kt rename to src/main/kotlin/dev/arbjerg/lavalink/client/player/Track.kt index b32dc74..e2fa3cf 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/protocol/Track.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/player/Track.kt @@ -1,10 +1,9 @@ -package dev.arbjerg.lavalink.client.protocol +package dev.arbjerg.lavalink.client.player import com.fasterxml.jackson.databind.JsonNode import dev.arbjerg.lavalink.internal.fromJsonElement import dev.arbjerg.lavalink.internal.toJackson import dev.arbjerg.lavalink.internal.toJsonElement -import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.jsonObject import dev.arbjerg.lavalink.protocol.v4.Track as ProtocolTrack diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/protocol/TrackUpdateBuilder.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/player/TrackUpdateBuilder.kt similarity index 94% rename from src/main/kotlin/dev/arbjerg/lavalink/client/protocol/TrackUpdateBuilder.kt rename to src/main/kotlin/dev/arbjerg/lavalink/client/player/TrackUpdateBuilder.kt index 4cd9df1..8f00e3b 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/protocol/TrackUpdateBuilder.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/player/TrackUpdateBuilder.kt @@ -1,10 +1,9 @@ -package dev.arbjerg.lavalink.client.protocol +package dev.arbjerg.lavalink.client.player import dev.arbjerg.lavalink.internal.toJsonElement import dev.arbjerg.lavalink.protocol.v4.Omissible import dev.arbjerg.lavalink.protocol.v4.PlayerUpdateTrack import dev.arbjerg.lavalink.protocol.v4.toOmissible -import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.jsonObject /** diff --git a/src/main/kotlin/dev/arbjerg/lavalink/client/protocol/loadResults.kt b/src/main/kotlin/dev/arbjerg/lavalink/client/player/loadResults.kt similarity index 96% rename from src/main/kotlin/dev/arbjerg/lavalink/client/protocol/loadResults.kt rename to src/main/kotlin/dev/arbjerg/lavalink/client/player/loadResults.kt index 34bfc1c..aac17b9 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/client/protocol/loadResults.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/client/player/loadResults.kt @@ -1,4 +1,4 @@ -package dev.arbjerg.lavalink.client.protocol +package dev.arbjerg.lavalink.client.player import dev.arbjerg.lavalink.internal.toJackson import dev.arbjerg.lavalink.protocol.v4.Exception as ProtocolException diff --git a/src/main/kotlin/dev/arbjerg/lavalink/internal/LavalinkSocket.kt b/src/main/kotlin/dev/arbjerg/lavalink/internal/LavalinkSocket.kt index 757e7a4..3fb6f60 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/internal/LavalinkSocket.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/internal/LavalinkSocket.kt @@ -3,7 +3,7 @@ package dev.arbjerg.lavalink.internal import dev.arbjerg.lavalink.VERSION as CLIENT_VERSION import dev.arbjerg.lavalink.client.LavalinkNode import dev.arbjerg.lavalink.client.LinkState -import dev.arbjerg.lavalink.client.protocol.toCustom +import dev.arbjerg.lavalink.client.player.toCustom import dev.arbjerg.lavalink.client.event.toClientEvent import dev.arbjerg.lavalink.protocol.v4.Message import dev.arbjerg.lavalink.protocol.v4.json diff --git a/src/main/kotlin/dev/arbjerg/lavalink/internal/helpers.kt b/src/main/kotlin/dev/arbjerg/lavalink/internal/helpers.kt index ec0b02c..0e650bb 100644 --- a/src/main/kotlin/dev/arbjerg/lavalink/internal/helpers.kt +++ b/src/main/kotlin/dev/arbjerg/lavalink/internal/helpers.kt @@ -1,7 +1,7 @@ package dev.arbjerg.lavalink.internal import dev.arbjerg.lavalink.client.LavalinkNode -import dev.arbjerg.lavalink.client.LavalinkPlayer +import dev.arbjerg.lavalink.client.player.LavalinkPlayer import dev.arbjerg.lavalink.protocol.v4.Player internal fun Player.toLavalinkPlayer(node: LavalinkNode) = LavalinkPlayer(node, this) diff --git a/src/test/java/JavaJDAExample.java b/src/test/java/JavaJDAExample.java index 2323316..655a2d9 100644 --- a/src/test/java/JavaJDAExample.java +++ b/src/test/java/JavaJDAExample.java @@ -4,7 +4,7 @@ import dev.arbjerg.lavalink.client.event.TrackStartEvent; import dev.arbjerg.lavalink.client.loadbalancing.RegionGroup; import dev.arbjerg.lavalink.client.loadbalancing.builtin.VoiceRegionPenaltyProvider; -import dev.arbjerg.lavalink.client.protocol.*; +import dev.arbjerg.lavalink.client.player.*; import dev.arbjerg.lavalink.libraries.jda.JDAVoiceUpdateListener; import net.dv8tion.jda.api.JDABuilder; import net.dv8tion.jda.api.entities.Guild; diff --git a/src/test/kotlin/d4jTestScript.kt b/src/test/kotlin/d4jTestScript.kt index 31295b8..b60fa6e 100644 --- a/src/test/kotlin/d4jTestScript.kt +++ b/src/test/kotlin/d4jTestScript.kt @@ -1,6 +1,6 @@ import dev.arbjerg.lavalink.client.* import dev.arbjerg.lavalink.client.event.TrackStartEvent -import dev.arbjerg.lavalink.client.protocol.TrackUpdateBuilder +import dev.arbjerg.lavalink.client.player.TrackUpdateBuilder import dev.arbjerg.lavalink.libraries.discord4j.installVoiceHandler import discord4j.core.DiscordClientBuilder import discord4j.core.event.domain.interaction.ChatInputInteractionEvent diff --git a/src/test/kotlin/testScript.kt b/src/test/kotlin/testScript.kt index aa5a7d3..d3448b5 100644 --- a/src/test/kotlin/testScript.kt +++ b/src/test/kotlin/testScript.kt @@ -6,7 +6,7 @@ import dev.arbjerg.lavalink.client.event.StatsEvent import dev.arbjerg.lavalink.client.event.TrackStartEvent import dev.arbjerg.lavalink.client.loadbalancing.RegionGroup import dev.arbjerg.lavalink.client.loadbalancing.builtin.VoiceRegionPenaltyProvider -import dev.arbjerg.lavalink.client.protocol.* +import dev.arbjerg.lavalink.client.player.* import dev.arbjerg.lavalink.libraries.jda.JDAVoiceUpdateListener import net.dv8tion.jda.api.JDABuilder import net.dv8tion.jda.api.events.GenericEvent diff --git a/testbot/src/main/java/me/duncte123/testbot/AudioLoader.java b/testbot/src/main/java/me/duncte123/testbot/AudioLoader.java index 25bd111..18f7f59 100644 --- a/testbot/src/main/java/me/duncte123/testbot/AudioLoader.java +++ b/testbot/src/main/java/me/duncte123/testbot/AudioLoader.java @@ -2,7 +2,7 @@ import dev.arbjerg.lavalink.client.AbstractAudioLoadResultHandler; import dev.arbjerg.lavalink.client.Link; -import dev.arbjerg.lavalink.client.protocol.*; +import dev.arbjerg.lavalink.client.player.*; import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; import org.jetbrains.annotations.NotNull; diff --git a/testbot/src/main/java/me/duncte123/testbot/JDAListener.java b/testbot/src/main/java/me/duncte123/testbot/JDAListener.java index 3702f27..34f5de4 100644 --- a/testbot/src/main/java/me/duncte123/testbot/JDAListener.java +++ b/testbot/src/main/java/me/duncte123/testbot/JDAListener.java @@ -2,7 +2,7 @@ import dev.arbjerg.lavalink.client.LavalinkClient; import dev.arbjerg.lavalink.client.Link; -import dev.arbjerg.lavalink.client.protocol.FilterBuilder; +import dev.arbjerg.lavalink.client.player.FilterBuilder; import dev.arbjerg.lavalink.protocol.v4.Karaoke; import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.GuildVoiceState;