use of com.sedmelluq.discord.lavaplayer.source.ProbingAudioSourceManager in project lavaplayer by sedmelluq.
the class DefaultAudioPlayerManager method checkSourcesForItemOnce.
private AudioItem checkSourcesForItemOnce(AudioReference reference, AudioLoadResultHandler resultHandler, boolean[] reported) {
for (AudioSourceManager sourceManager : sourceManagers) {
if (reference.containerDescriptor != null && !(sourceManager instanceof ProbingAudioSourceManager)) {
continue;
}
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;
}
Aggregations