public Stream2(Enum2 enum2_1, ushort ushort_0, bool bool_2, GenericAudioStream[] stream1_0) : base() { this.list_0 = new List <GenericAudioStream>(); this.class12_0 = new Class12(new Interface5[0]); //base..ctor(); this.enum2_0 = enum2_1; this.bool_1 = bool_2; this.list_0.AddRange(stream1_0); this.bool_0 = (stream1_0.Length == 1 && stream1_0[0].vmethod_0().short_0 == 1 && ushort_0 < 2); this.long_1 = 0L; this.long_0 = stream1_0[0].Length; int val = 0; int num = 0; for (int i = 0; i < stream1_0.Length; i++) { GenericAudioStream stream = stream1_0[i]; val = Math.Max(val, stream.vmethod_0().int_0); if (this.bool_1) { num += (int)stream.vmethod_0().short_0; } else { num = Math.Max(num, (int)stream.vmethod_0().short_0); } stream.Position = this.long_1; } this.waveFormat_0 = new WaveFormat(val, (ushort_0 != 0) ? ((int)ushort_0) : Math.Min(num, Stream2.smethod_0(this.enum2_0) * (this.bool_1 ? stream1_0.Length : 1))); for (int j = 0; j < stream1_0.Length; j++) { GenericAudioStream stream2 = stream1_0[j]; this.long_0 = Math.Max(this.long_0, Convert.ToInt64((double)(this.waveFormat_0.int_0 * (int)this.waveFormat_0.short_1) * stream2.vmethod_1().timeSpan_0.TotalSeconds)); } this.int_2 = (int)this.waveFormat_0.short_0 << 2; }
public Stream2(Enum2 enum2_1, ushort ushort_0, GenericAudioStream stream1_0, Interface5[] interface5_0) : base() { this.list_0 = new List <GenericAudioStream>(); this.class12_0 = new Class12(new Interface5[0]); //base..ctor(); this.enum2_0 = enum2_1; this.bool_1 = false; this.waveFormat_0 = new WaveFormat(stream1_0.vmethod_0().int_0, (ushort_0 != 0) ? ((int)ushort_0) : Math.Min((int)stream1_0.vmethod_0().short_0, Stream2.smethod_0(this.enum2_0))); this.list_0.Add(stream1_0); this.long_1 = 0L; stream1_0.Position = 0L; this.long_0 = Convert.ToInt64((double)(this.waveFormat_0.int_0 * (int)this.waveFormat_0.short_1) * stream1_0.vmethod_1().timeSpan_0.TotalSeconds); this.method_0(interface5_0); this.bool_0 = (stream1_0.vmethod_0().short_0 == 1 && ushort_0 < 2); this.int_2 = (int)this.waveFormat_0.short_0 << 2; }
public override float[][] vmethod_5(int int_3) { if (this.long_1 >= this.long_0) { return(null); } int num = (int)(this.long_1 >> 2); if (this.bool_0) { float[][] array = this.list_0[0].vmethod_5(int_3); if (array == null) { this.long_1 = this.long_0; return(null); } this.class12_0.imethod_0(new Class13[] { new Class13(num, array[0]) }); this.long_1 += (long)(array[0].Length * this.int_2); return(array); } else { int num2 = 0; int num3 = 0; List <Class13> list = new List <Class13>(); List <int> list2 = new List <int>(); int i = 0; while (i < this.list_0.Count) { float[][] array2; if (this.list_0[i].vmethod_0().int_0 < this.waveFormat_0.int_0) { array2 = this.list_0[i].vmethod_5((int)((double)int_3 * ((double)this.list_0[i].vmethod_0().int_0 / (double)this.waveFormat_0.int_0))); if (array2 != null) { float float_ = (float)this.list_0[i].vmethod_0().int_0 / (float)this.waveFormat_0.int_0; for (int j = 0; j < array2.Length; j++) { if ((this.enum2_0 & (Enum2)(1 << j)) != (Enum2)0) { Class13 @class = new Class13(num / (int)this.waveFormat_0.short_0, array2[j]); Stream2.smethod_1(@class, float_); array2[j] = @class.float_0; } } goto IL_19F; } } else { array2 = this.list_0[i].vmethod_5(int_3); if (array2 != null) { goto IL_19F; } } IL_32F: i++; continue; IL_19F: if (!this.bool_1) { if (array2.Length < (int)this.waveFormat_0.short_0) { float[][] array3 = new float[(int)this.waveFormat_0.short_0][]; Array.Copy(array2, array3, array2.Length); int k = array2.Length; int num4 = 0; while (k < array3.Length) { if ((this.enum2_0 & (Enum2)(1 << k - array2.Length)) != (Enum2)0) { array3[k] = new float[array2[num4].Length]; Buffer.BlockCopy(array2[num4], 0, array3[k], 0, array2[num4].Length << 2); } k++; num4 = (num4 + 1) % array2.Length; } array2 = array3; } num3 = 0; } for (int l = 0; l < array2.Length; l++) { if ((this.enum2_0 & (Enum2)(1 << l)) != (Enum2)0) { if (num3 >= list.Count) { list.Add(new Class13(num / (int)this.waveFormat_0.short_0, array2[l])); list2.Add(1); num2 = Math.Max(num2, array2[l].Length); } else { List <int> list3; int index; (list3 = list2)[index = num3] = list3[index] + 1; Class13 class2 = list[num3]; Class13 class3 = new Class13(num / (int)this.waveFormat_0.short_0, array2[l]); if (num2 < array2[l].Length) { Stream2.smethod_2(class3, class2); list[num3] = class3; num2 = array2[l].Length; } else { Stream2.smethod_2(class2, class3); } } num3 = (num3 + 1) % (int)this.waveFormat_0.short_0; } } goto IL_32F; } if (list.Count == 0) { this.long_1 = this.long_0; return(null); } int num5 = 0; while (num5 < list.Count && list2[num5] > 1) { Stream2.smethod_3(list[num5], 1f / (float)list2[num5]); num5++; } this.class12_0.imethod_0(list.ToArray()); float[][] array4 = new float[list.Count][]; for (int m = 0; m < array4.Length; m++) { array4[m] = list[m].float_0; } this.long_1 += (long)(num2 * this.int_2); return(array4); } }
public override void vmethod_0() { if (this.class323_0 != null) { KeyGenerator.smethod_9(this.string_2 + "music\\" + this.string_1 + ".dat.xen", this.class323_0.data); KeyGenerator.smethod_19(this.string_3, this.string_2 + "music\\" + this.string_1 + ".fsb.xen", true); } else { List<string> list = new List<string>(); List<Stream> list2 = new List<Stream>(); GenericAudioStream stream3; if (this.string_0.Length == 1) { Stream stream; if (!Class248.bool_3 && AudioManager.smethod_1(this.string_0[0]) == AudioTypeEnum.const_1) { stream = File.OpenRead(this.string_0[0]); } else { stream = new Stream27(); Stream16.smethod_0(AudioManager.getAudioStream(this.string_0[0]), stream, 44100, 128); } stream.Position = 0L; list.Add(this.string_1 + "_song"); list2.Add(stream); list.Add(this.string_1 + "_guitar"); if (Class248.bool_2) { Stream stream2 = new Stream27(); Stream16.smethod_1(stream2, AudioManager.smethod_2(this.string_0[0]), 128); list2.Add(stream2); } else { list2.Add(stream); } stream3 = AudioManager.smethod_5(stream); } else { List<GenericAudioStream> list3 = new List<GenericAudioStream>(); string[] array = new string[] { "_song", "_guitar", "_rhythm", "_coop_song", "_coop_guitar", "_coop_rhythm" }; for (int i = 0; i < this.string_0.Length; i++) { if (this.string_0[i] != null && !this.string_0[i].Equals("") && File.Exists(this.string_0[i])) { Stream stream4; if (!Class248.bool_3 && AudioManager.smethod_1(this.string_0[i]) == AudioTypeEnum.const_1) { stream4 = File.OpenRead(this.string_0[i]); } else { stream4 = new Stream27(); Stream16.smethod_0(AudioManager.getAudioStream(this.string_0[i]), stream4, 44100, 128); } stream4.Position = 0L; list.Add(this.string_1 + array[i]); list2.Add(stream4); if ((this.string_0.Length == 6) ? (i >= 3) : (i < 3)) { list3.Add(AudioManager.smethod_5(stream4)); } } } stream3 = new Stream2(list3.ToArray()); float num = 0f; Stream3 stream5 = new Stream3(stream3, this.timeSpan_0, this.timeSpan_1); float[][] array2 = stream5.vmethod_5(100); while (array2 != null && array2.Length > 0) { float[][] array3 = array2; for (int j = 0; j < array3.Length; j++) { float[] array4 = array3[j]; float[] array5 = array4; for (int k = 0; k < array5.Length; k++) { float value = array5[k]; float num2 = Math.Abs(value); if (num2 > num) { num = num2; } } } array2 = stream5.vmethod_5(100); } (stream3 as Stream2).method_0(new Interface5[] { new Class174(3, 1f / num) }); } WaveFormat waveFormat = stream3.vmethod_0(); TimeSpan t = new TimeSpan(0, 0, 1); Stream stream6 = new Stream27(); Stream16.smethod_0(new Stream2(new Stream3(stream3, this.timeSpan_0, this.timeSpan_1), new Interface5[] { new Class173(Class173.Enum26.const_0, new Struct11[] { new Struct11(0, waveFormat.method_1(t)) }), new Class173(Class173.Enum26.const_1, new Struct11[] { new Struct11(waveFormat.method_1(this.timeSpan_1 - this.timeSpan_0 - t), waveFormat.method_1(this.timeSpan_1 - this.timeSpan_0)) }) }), stream6, 44100, 128); list.Add(this.string_1 + "_preview"); list2.Add(stream6); new zzQbSongObject((int)ns20.FSBClass2.smethod_0(this.string_2 + "music\\" + this.string_1 + ".fsb.xen", list2.ToArray()), list.ToArray()).method_2(this.string_2 + "music\\" + this.string_1 + ".dat.xen"); } GC.Collect(); }