package Ġme . me li jn . me lij nb ot . objects . music Ċ Ċ import Ġcom . sed mell uq . discord . lav ap layer . player . Audio Player Ċ import Ġcom . sed mell uq . discord . lav ap layer . player . Audio Player Manager Ċ import Ġcom . sed mell uq . discord . lav ap layer . player . Default Audio Player Manager Ċ import Ġcom . sed mell uq . discord . lav ap layer . source . Audio Source Managers Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġme . me li jn . me lij nb ot . database . Dao Manager Ċ import Ġme . me li jn . me lij nb ot . objects . services . voice . VOICE _ SAFE Ċ import Ġnet . dv 8 tion . j da . api . entities . Guild Ċ import Ġorg . slf 4 j . LoggerFactory ĊĊ Ċ class ĠMusic Player Manager ( ĊĠĠĠ Ġprivate Ġval Ġdao Manager : ĠDao Manager , ĊĠĠĠ Ġprivate Ġval Ġl ava Manager : ĠL ava Manager Ċ ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġlogger Ġ= ĠLoggerFactory . getLogger ( Music Player Manager :: class . java ) ĊĠĠĠ Ġval Ġaudio Player Manager : ĠAudio Player Manager Ġ= ĠDefault Audio Player Manager () ĊĠĠĠ Ġval Ġaudio Loader Ġ= ĠAudio Loader ( this ) ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġguild Music Players : ĠHashMap < Long , ĠGuild Music Player > Ġ= ĠHashMap () ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġaudio Player Manager . configuration . is Filter Hot Swap Enabled Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġaudio Player Manager . frame Buffer Duration Ġ= Ġ 1 0 0 0 ĊĠĠĠĠĠĠĠ ĠAudio Source Managers . register Remote Sources ( audio Player Manager ) ĊĠĠĠĠĠĠĠ ĠAudio Source Managers . register Local Source ( audio Player Manager ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget LP Player (): ĠAudio Player Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġaudio Player Manager . create Player () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Synchron ized ĊĠĠĠ Ġfun Ġget Guild Music Player ( guild : ĠGuild ): ĠGuild Music Player Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcached Music Player Ġ= Ġguild Music Players [ guild . id Long ] ĊĠĠĠĠĠĠĠ Ġif Ġ( cached Music Player Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġnew Music Player Ġ= ĠGuild Music Player ( dao Manager , Ġl ava Manager , Ġguild . id Long ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠV O ICE _ SAFE . acquire () ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġguild Music Players [ guild . id Long ] Ġ= Ġnew Music Player ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġlogger . debug (" new Ġplayer Ġfor Ġ${ guild . id }") ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠV O ICE _ SAFE . release () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ(! l ava Manager . l aval ink Enabled ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġguild . audio Manager . sending Handler Ġ= Ġnew Music Player . get Send Handler () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġnew Music Player ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġcached Music Player ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Players () Ġ= Ġguild Music Players Ċ }