当前位置: 首页>>代码示例>>Java>>正文


Java AudioPlayer.addListener方法代码示例

本文整理汇总了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;
}
 
开发者ID:jagrosh,项目名称:MusicBot,代码行数:19,代码来源:Bot.java

示例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;
}
 
开发者ID:Panzer1119,项目名称:Supreme-Bot,代码行数:12,代码来源:MusicCommand.java

示例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;
}
 
开发者ID:LeeDJD,项目名称:Amme,代码行数:9,代码来源:Music.java

示例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;
}
 
开发者ID:JessWalters,项目名称:Vinny-Redux,代码行数:15,代码来源:Bot.java

示例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;
}
 
开发者ID:DinosParkour,项目名称:deeJay,代码行数:9,代码来源:MusicCommand.java

示例6: AudioHandler

import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; //导入方法依赖的package包/类
public AudioHandler(AudioPlayer player) {
    this.player = player;
    player.addListener(this);
}
 
开发者ID:Devoxin,项目名称:JukeBot,代码行数:5,代码来源:AudioHandler.java


注:本文中的com.sedmelluq.discord.lavaplayer.player.AudioPlayer.addListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。