本文整理汇总了Java中com.sedmelluq.discord.lavaplayer.player.AudioPlayer.addListener方法的典型用法代码示例。如果您正苦于以下问题:Java AudioPlayer.addListener方法的具体用法?Java AudioPlayer.addListener怎么用?Java AudioPlayer.addListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sedmelluq.discord.lavaplayer.player.AudioPlayer
的用法示例。
在下文中一共展示了AudioPlayer.addListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpHandler
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; //导入方法依赖的package包/类
public AudioHandler setUpHandler(Guild guild)
{
AudioHandler handler;
if(guild.getAudioManager().getSendingHandler()==null)
{
AudioPlayer player = manager.createPlayer();
if(settings.containsKey(guild.getId()))
player.setVolume(settings.get(guild.getId()).getVolume());
handler = new AudioHandler(player, guild, this);
player.addListener(handler);
guild.getAudioManager().setSendingHandler(handler);
if(AudioHandler.USE_NP_REFRESH)
threadpool.scheduleWithFixedDelay(() -> updateLastNP(guild.getIdLong()), 0, 5, TimeUnit.SECONDS);
}
else
handler = (AudioHandler)guild.getAudioManager().getSendingHandler();
return handler;
}
示例2: createTrackManager
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; //导入方法依赖的package包/类
static final TrackManager createTrackManager(Guild guild, VoiceChannel voiceChannel) {
if (guild == null) {
return null;
}
final AudioPlayer player = manager.createPlayer();
final TrackManager trackManager = new TrackManager(player, guild, voiceChannel);
player.addListener(trackManager);
guild.getAudioManager().setSendingHandler(new PlayerSendHandler(player));
trackManagers.put(guild, trackManager);
return trackManager;
}
示例3: createPlayer
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; //导入方法依赖的package包/类
private AudioPlayer createPlayer(Guild guild) {
AudioPlayer nPlayer = myManager.createPlayer();
TrackManager manager = new TrackManager(nPlayer);
nPlayer.addListener(manager);
guild.getAudioManager().setSendingHandler(new PlayerSendHandler(nPlayer));
players.put(guild.getId(), new AbstractMap.SimpleEntry<>(nPlayer, manager));
return nPlayer;
}
示例4: getHandler
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; //导入方法依赖的package包/类
public VoiceSendHandler getHandler(Guild guild) {
VoiceSendHandler handler;
if (guild.getAudioManager().getSendingHandler() == null) {
AudioPlayer player = manager.createPlayer();
// TODO: Add Default Volume from DB
handler = new VoiceSendHandler(guild.getIdLong(), player, this);
player.addListener(handler);
guild.getAudioManager().setSendingHandler(handler);
}
else {
handler = (VoiceSendHandler) guild.getAudioManager().getSendingHandler();
}
return handler;
}
示例5: createPlayer
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; //导入方法依赖的package包/类
private AudioPlayer createPlayer(Guild guild) {
AudioPlayer nPlayer = myManager.createPlayer();
TrackManager manager = new TrackManager(nPlayer);
nPlayer.addListener(manager);
guild.getAudioManager().setSendingHandler(new AudioPlayerSendHandler(nPlayer));
players.put(guild.getId(), new AbstractMap.SimpleEntry<>(nPlayer, manager));
return nPlayer;
}
示例6: AudioHandler
import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; //导入方法依赖的package包/类
public AudioHandler(AudioPlayer player) {
this.player = player;
player.addListener(this);
}