forked from lavalink-devs/Lavalink
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIPlayer.java
More file actions
62 lines (51 loc) · 1.46 KB
/
IPlayer.java
File metadata and controls
62 lines (51 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package dev.arbjerg.lavalink.api;
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import org.springframework.lang.Nullable;
/**
* Represents an audio player for a specific guild. Contains track data and is used for controlling playback.
*/
public interface IPlayer {
/**
* @return the underlying Lavaplayer player
*/
AudioPlayer getAudioPlayer();
/**
* @return the player's current track which is either playing or paused. May be null
*/
@Nullable
AudioTrack getTrack();
/**
* @return the guild which this player belongs to. Immutable
*/
long getGuildId();
/**
* @return the WebSocket this player belongs to
*/
ISocketContext getSocketContext();
/**
* @param track the track to start playing, potentially replacing an existing one
*/
void play(AudioTrack track);
/**
* Stops playing the current track, if any
*/
void stop();
/**
* @param pause whether to pause or not
*/
void setPause(boolean pause);
/**
* @param position the new position of the current track in milliseconds
* @throws RuntimeException if not playing anything
*/
void seekTo(long position);
/**
* @param volume in percentage 0% to 1000%
*/
void setVolume(int volume);
/**
* @return Whether the player is trying to produce audio
*/
boolean isPlaying();
}