Renamed midi/sound functions

This commit is contained in:
Pazaz 2022-06-27 13:08:03 -04:00
parent 2b59a97e7a
commit 9789c5b66e
30 changed files with 1096 additions and 1099 deletions

View file

@ -9,82 +9,82 @@ import org.openrs2.deob.annotation.Pc;
public final class SoundBank {
@OriginalMember(owner = "client!le", name = "d", descriptor = "Lclient!sc;")
private final HashTable aClass133_11 = new HashTable(256);
private final HashTable vorbisCache = new HashTable(256);
@OriginalMember(owner = "client!le", name = "l", descriptor = "Lclient!sc;")
private final HashTable aClass133_12 = new HashTable(256);
private final HashTable cache = new HashTable(256);
@OriginalMember(owner = "client!le", name = "b", descriptor = "Lclient!ve;")
private final Js5 aClass153_52;
private final Js5 synthArchive;
@OriginalMember(owner = "client!le", name = "i", descriptor = "Lclient!ve;")
private final Js5 aClass153_53;
private final Js5 vorbisArchive;
@OriginalMember(owner = "client!le", name = "<init>", descriptor = "(Lclient!ve;Lclient!ve;)V")
public SoundBank(@OriginalArg(0) Js5 arg0, @OriginalArg(1) Js5 arg1) {
this.aClass153_52 = arg0;
this.aClass153_53 = arg1;
public SoundBank(@OriginalArg(0) Js5 synthArchive, @OriginalArg(1) Js5 vorbisArchive) {
this.synthArchive = synthArchive;
this.vorbisArchive = vorbisArchive;
}
@OriginalMember(owner = "client!le", name = "a", descriptor = "([IIII)Lclient!kj;")
private PcmSound method2737(@OriginalArg(0) int[] arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2) {
@Pc(21) int local21 = arg2 ^ (arg1 >>> 12 | arg1 << 4 & 0xFFF3);
@Pc(27) int local27 = local21 | arg1 << 16;
@Pc(30) long local30 = (long) local27;
@Pc(37) PcmSound local37 = (PcmSound) this.aClass133_12.get(local30);
if (local37 != null) {
return local37;
} else if (arg0 == null || arg0[0] > 0) {
@Pc(59) SynthSound local59 = SynthSound.create(this.aClass153_52, arg1, arg2);
if (local59 == null) {
private PcmSound getSynthSound(@OriginalArg(0) int[] samplingRates, @OriginalArg(2) int group, @OriginalArg(3) int file) {
@Pc(21) int key1 = file ^ (group >>> 12 | group << 4 & 0xFFF3);
@Pc(27) int key2 = key1 | group << 16;
@Pc(30) long key = key2;
@Pc(37) PcmSound sound = (PcmSound) this.cache.get(key);
if (sound != null) {
return sound;
} else if (samplingRates == null || samplingRates[0] > 0) {
@Pc(59) SynthSound synthSound = SynthSound.create(this.synthArchive, group, file);
if (synthSound == null) {
return null;
}
local37 = local59.toPcmSound();
this.aClass133_12.put(local37, local30);
if (arg0 != null) {
arg0[0] -= local37.aByteArray47.length;
sound = synthSound.toPcmSound();
this.cache.put(sound, key);
if (samplingRates != null) {
samplingRates[0] -= sound.samples.length;
}
return local37;
return sound;
} else {
return null;
}
}
@OriginalMember(owner = "client!le", name = "a", descriptor = "(II[I)Lclient!kj;")
public final PcmSound method2738(@OriginalArg(0) int arg0, @OriginalArg(2) int[] arg1) {
if (this.aClass153_52.capacity() == 1) {
return this.method2737(arg1, 0, arg0);
} else if (this.aClass153_52.getGroupCapacity(arg0) == 1) {
return this.method2737(arg1, arg0, 0);
public final PcmSound getSynthSound(@OriginalArg(0) int id, @OriginalArg(2) int[] samplingRates) {
if (this.synthArchive.capacity() == 1) {
return this.getSynthSound(samplingRates, 0, id);
} else if (this.synthArchive.getGroupCapacity(id) == 1) {
return this.getSynthSound(samplingRates, id, 0);
} else {
throw new RuntimeException();
}
}
@OriginalMember(owner = "client!le", name = "a", descriptor = "(I[IIB)Lclient!kj;")
private PcmSound method2740(@OriginalArg(0) int arg0, @OriginalArg(1) int[] arg1, @OriginalArg(2) int arg2) {
@Pc(15) int local15 = arg2 ^ (arg0 >>> 12 | arg0 << 4 & 0xFFF3);
@Pc(21) int local21 = local15 | arg0 << 16;
@Pc(26) long local26 = (long) local21 ^ 0x100000000L;
@Pc(33) PcmSound local33 = (PcmSound) this.aClass133_12.get(local26);
if (local33 != null) {
return local33;
} else if (arg1 == null || arg1[0] > 0) {
@Pc(53) VorbisSound local53 = (VorbisSound) this.aClass133_11.get(local26);
if (local53 == null) {
local53 = VorbisSound.method2345(this.aClass153_53, arg0, arg2);
if (local53 == null) {
private PcmSound getVorbisSound(@OriginalArg(0) int group, @OriginalArg(1) int[] samplingRates, @OriginalArg(2) int file) {
@Pc(15) int key1 = file ^ (group >>> 12 | group << 4 & 0xFFF3);
@Pc(21) int key2 = key1 | group << 16;
@Pc(26) long key = (long) key2 ^ 0x100000000L;
@Pc(33) PcmSound sound = (PcmSound) this.cache.get(key);
if (sound != null) {
return sound;
} else if (samplingRates == null || samplingRates[0] > 0) {
@Pc(53) VorbisSound vorbisSound = (VorbisSound) this.vorbisCache.get(key);
if (vorbisSound == null) {
vorbisSound = VorbisSound.create(this.vorbisArchive, group, file);
if (vorbisSound == null) {
return null;
}
this.aClass133_11.put(local53, local26);
this.vorbisCache.put(vorbisSound, key);
}
local33 = local53.method2341(arg1);
if (local33 == null) {
sound = vorbisSound.toPcmSound(samplingRates);
if (sound == null) {
return null;
} else {
local53.unlink();
this.aClass133_12.put(local33, local26);
return local33;
vorbisSound.unlink();
this.cache.put(sound, key);
return sound;
}
} else {
return null;
@ -92,11 +92,11 @@ public final class SoundBank {
}
@OriginalMember(owner = "client!le", name = "b", descriptor = "(II[I)Lclient!kj;")
public final PcmSound method2741(@OriginalArg(1) int arg0, @OriginalArg(2) int[] arg1) {
if (this.aClass153_53.capacity() == 1) {
return this.method2740(0, arg1, arg0);
} else if (this.aClass153_53.getGroupCapacity(arg0) == 1) {
return this.method2740(arg0, arg1, 0);
public final PcmSound getVorbisSound(@OriginalArg(1) int id, @OriginalArg(2) int[] samplingRates) {
if (this.vorbisArchive.capacity() == 1) {
return this.getVorbisSound(0, samplingRates, id);
} else if (this.vorbisArchive.getGroupCapacity(id) == 1) {
return this.getVorbisSound(id, samplingRates, 0);
} else {
throw new RuntimeException();
}