@Override public void destroy() { synchronized (lock) { if (streamCursor != null) { streamCursor.close(); streamCursor = null; } fallback.destroy(); } }
public synchronized void stopMusic() { currentlyPlaying = 0; player.destroy(); Launcher.log("Stop playing", "music", "stop", "guild-id", guildId); }
private void destroy() { if (!destroyed) { destroyed = true; for (Cursor cursor : new ArrayList<>(cursors)) { cursor.detach(); cursor.close(); } if (initialized) { log.debug("Shutting down centralized stream for {}.", track.getInfo()); trackPlayer.destroy(); } } }
public void shutdown() { if(shuttingDown) return; shuttingDown = true; threadpool.shutdownNow(); if(jda.getStatus()!=JDA.Status.SHUTTING_DOWN) { jda.getGuilds().stream().forEach(g -> { g.getAudioManager().closeAudioConnection(); AudioHandler ah = (AudioHandler)g.getAudioManager().getSendingHandler(); if(ah!=null) { ah.stopAndClear(); ah.getPlayer().destroy(); nowplaying.updateTopic(g.getIdLong(), ah, true); } }); jda.shutdown(); } if(gui!=null) gui.dispose(); System.exit(0); }
keepGoing = true; if (!playRandomSong()) { player.destroy(); bot.queue.add(bot.getMusicChannel(guildId).sendMessage("Stopped playing because the playlist is empty")); bot.schedule(() -> MusicPlayerHandler.removeGuild(bot.getJda().getGuildById(guildId)), 10L, TimeUnit.SECONDS);