package p000; import javax.microedition.media.Player; import javax.microedition.media.PlayerListener; /* renamed from: bd */ /* loaded from: microcounterstrike.jar:bd.class */ public final class SoundManager implements PlayerListener { /* renamed from: a */ private static SoundManager soundManager136; /* renamed from: b */ private Player[] playerArr137; /* renamed from: c */ private Player[] playerArr138; /* renamed from: d */ private Player[] playerArr139; /* renamed from: e */ private Player[] playerArr140; /* renamed from: f */ private Player[] playerArr141; /* renamed from: g */ private int value142; /* renamed from: h */ private int value143; /* renamed from: i */ private int value144; /* renamed from: j */ private int value145; /* renamed from: k */ private int value146; private SoundManager() { } /* renamed from: a */ public static SoundManager getInstance() { if (soundManager136 == null) { soundManager136 = new SoundManager(); } return soundManager136; } /* renamed from: a */ public final void execute199(int i) { switch (i) { case 1: execute200(this.playerArr137[this.value142]); this.value142 = (this.value142 + 1) % 4; break; case 2: execute200(this.playerArr138[this.value143]); this.value143 = (this.value143 + 1) % 2; break; case 3: execute200(this.playerArr139[this.value144]); this.value144 = (this.value144 + 1) % 2; break; case 4: execute200(this.playerArr140[this.value145]); this.value145 = (this.value145 + 1) % 1; break; case 21: execute200(this.playerArr141[this.value146]); this.value146 = (this.value146 + 1) % 4; break; } } /* renamed from: a */ private static void execute200(Player player) { if (player == null || player.getState() != 300) { return; } try { player.setMediaTime(0L); player.start(); } catch (Exception unused) { System.out.println("Could not play sound "); } } public final void playerUpdate(Player player, String str, Object obj) { if (str == "endOfMedia") { try { player.stop(); player.setMediaTime(0L); } catch (Exception unused) { } } } /* renamed from: c */ private void execute201() { if (this.playerArr137 != null) { for (int i = 0; i < 4; i++) { this.playerArr137[i].close(); } } if (this.playerArr138 != null) { for (int i2 = 0; i2 < 2; i2++) { this.playerArr138[i2].close(); } } if (this.playerArr139 != null) { for (int i3 = 0; i3 < 2; i3++) { this.playerArr139[i3].close(); } } if (this.playerArr140 != null) { for (int i4 = 0; i4 < 1; i4++) { this.playerArr140[0].close(); } } if (this.playerArr141 != null) { for (int i5 = 0; i5 < 4; i5++) { this.playerArr141[i5].close(); } } } /* renamed from: b */ public final void execute202() { execute201(); this.playerArr137 = null; this.playerArr138 = null; this.playerArr139 = null; this.playerArr140 = null; this.playerArr141 = null; } }