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;
}
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");
}
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);
}
Aggregations