more more attempt

This commit is contained in:
Chayapak 2023-10-12 17:20:13 +07:00
parent 7956646940
commit 18ade1875d

View file

@ -237,39 +237,39 @@ public class MusicPlayerPlugin extends Bot.Listener {
// midi lyrics are very weird // midi lyrics are very weird
// i need some karaoke players too see how this works // i need some karaoke players too see how this works
/* // final Map<Long, String> lyrics = currentSong.lyrics;
final Map<Long, String> lyrics = currentSong.lyrics; //
// if (lyrics.isEmpty()) return;
if (lyrics.isEmpty()) return; //
// final List<String> lyricsList = new ArrayList<>();
final List<String> lyricsList = new ArrayList<>(); //
// for (Map.Entry<Long, String> entry : lyrics.entrySet()) {
for (Map.Entry<Long, String> entry : lyrics.entrySet()) { // final long time = entry.getKey();
final long time = entry.getKey(); // String _lyric = entry.getValue();
String _lyric = entry.getValue(); //
// if (time > currentSong.time) continue;
if (time > currentSong.time) continue; //
//// StringBuilder lyric = new StringBuilder();
StringBuilder lyric = new StringBuilder(); ////
//// for (char character : _lyric.toCharArray()) {
for (char character : _lyric.toCharArray()) { //// if ((character != '\n' && character != '\r' && character < ' ') || character == '<27>') continue;
if ((character != '\n' && character != '\r' && character < ' ') || character == '<27>') continue; ////
//// lyric.append(character);
lyric.append(character); //// }
} ////
//// String stringLyric = lyric.toString();
final String stringLyric = lyric.toString(); ////
//// if (stringLyric.startsWith("\\") || stringLyric.startsWith("/")) {
if ( stringLyric.equals("\n") || stringLyric.equals("\r") || stringLyric.equals("\r\n") || stringLyric.equals("\n\r")) { //// lyricsList.clear();
lyricsList.clear(); ////
} //// stringLyric = stringLyric.substring(1);
//// }
lyricsList.add(stringLyric); //
// lyricsList.add(_lyric);
// while (lyricsList.size() > 10) lyricsList.remove(0); // }
} //
// final String joined = String.join("", lyricsList);
currentLyrics = String.join("", lyricsList); */ // currentLyrics = joined.substring(Math.max(0, joined.length() - 25));
} }
public void removeBossBar() { public void removeBossBar() {