Search in sources :

Example 1 with AudioSourceManager

use of com.sedmelluq.discord.lavaplayer.source.AudioSourceManager in project lavaplayer by sedmelluq.

the class DefaultAudioPlayerManager method checkSourcesForItemOnce.

private AudioItem checkSourcesForItemOnce(AudioReference reference, AudioLoadResultHandler resultHandler, boolean[] reported) {
    for (AudioSourceManager sourceManager : sourceManagers) {
        AudioItem item = sourceManager.loadItem(this, reference);
        if (item != null) {
            if (item instanceof AudioTrack) {
                log.debug("Loaded a track with identifier {} using {}.", reference.identifier, sourceManager.getClass().getSimpleName());
                reported[0] = true;
                resultHandler.trackLoaded((AudioTrack) item);
            } else if (item instanceof AudioPlaylist) {
                log.debug("Loaded a playlist with identifier {} using {}.", reference.identifier, sourceManager.getClass().getSimpleName());
                reported[0] = true;
                resultHandler.playlistLoaded((AudioPlaylist) item);
            }
            return item;
        }
    }
    return null;
}
Also used : AudioSourceManager(com.sedmelluq.discord.lavaplayer.source.AudioSourceManager) InternalAudioTrack(com.sedmelluq.discord.lavaplayer.track.InternalAudioTrack) AudioTrack(com.sedmelluq.discord.lavaplayer.track.AudioTrack) AudioItem(com.sedmelluq.discord.lavaplayer.track.AudioItem) AudioPlaylist(com.sedmelluq.discord.lavaplayer.track.AudioPlaylist)

Example 2 with AudioSourceManager

use of com.sedmelluq.discord.lavaplayer.source.AudioSourceManager in project lavaplayer by sedmelluq.

the class DefaultAudioPlayerManager method shutdown.

@Override
public void shutdown() {
    remoteNodeManager.shutdown(true);
    garbageCollectionMonitor.disable();
    lifecycleManager.shutdown();
    for (AudioSourceManager sourceManager : sourceManagers) {
        sourceManager.shutdown();
    }
    ExecutorTools.shutdownExecutor(trackPlaybackExecutorService, "track playback");
    ExecutorTools.shutdownExecutor(trackInfoExecutorService, "track info");
    ExecutorTools.shutdownExecutor(scheduledExecutorService, "scheduled operations");
}
Also used : AudioSourceManager(com.sedmelluq.discord.lavaplayer.source.AudioSourceManager)

Example 3 with AudioSourceManager

use of com.sedmelluq.discord.lavaplayer.source.AudioSourceManager in project lavaplayer by sedmelluq.

the class DefaultAudioPlayerManager method encodeTrackDetails.

private void encodeTrackDetails(AudioTrack track, DataOutput output) throws IOException {
    AudioSourceManager sourceManager = track.getSourceManager();
    output.writeUTF(sourceManager.getSourceName());
    sourceManager.encodeTrack(track, output);
}
Also used : AudioSourceManager(com.sedmelluq.discord.lavaplayer.source.AudioSourceManager)

Aggregations

AudioSourceManager (com.sedmelluq.discord.lavaplayer.source.AudioSourceManager)3 AudioItem (com.sedmelluq.discord.lavaplayer.track.AudioItem)1 AudioPlaylist (com.sedmelluq.discord.lavaplayer.track.AudioPlaylist)1 AudioTrack (com.sedmelluq.discord.lavaplayer.track.AudioTrack)1 InternalAudioTrack (com.sedmelluq.discord.lavaplayer.track.InternalAudioTrack)1