public void DifferentStartPlaying() { switch (this.enum1_0) { case AudioStatus.ShouldStartAudio: return; case AudioStatus.IsCurrentlyPlayingAudio: Class119.alSourcePlay(this.intptr_1); this.stopwatch_0.Start(); this.enum1_0 = AudioStatus.ShouldStartAudio; return; default: { while (Class119.smethod_4(this.intptr_1, Enum11.const_5) > 0) { Class119.smethod_6(this.intptr_1); } IntPtr[] array = this.intptr_2; for (int i = 0; i < array.Length; i++) { IntPtr intPtr = array[i]; int num; lock (this.stream1_0) { num = this.stream1_0.vmethod_3(this.intptr_0, this.int_1); } Class119.alBufferData(intPtr, this.enum12_0, this.intptr_0, num, this.int_0); } Class119.alSourceQueueBuffers(this.intptr_1, this.intptr_2.Length, this.intptr_2); if (!this.bool_1) { ThreadPool.QueueUserWorkItem(new WaitCallback(this.method_3)); } Class119.alSourcef(this.intptr_1, Enum10.const_4, 0f); Class119.alSourcePlay(this.intptr_1); this.stopwatch_0.Start(); this.enum1_0 = AudioStatus.ShouldStartAudio; this.method_0(); return; } } }
private void method_1() { bool flag = false; while (this.enum1_0 != AudioStatus.ShouldStopAudio && !flag) { if (this.bool_0) { this.bool_0 = false; Class119.alSourcef(this.intptr_1, Enum10.const_4, this.float_0); } if (this.enum1_0 != AudioStatus.IsCurrentlyPlayingAudio) { int num = 0; int num2; do { Class119.alGetSourcei(this.intptr_1, Enum11.const_6, out num2); if (num > 50) { Thread.Sleep(1); } else { num++; } }while (num2 == 0); while (num2-- != 0) { IntPtr intPtr = Class119.smethod_6(this.intptr_1); int num3; lock (this.stream1_0) { num3 = this.stream1_0.vmethod_3(this.intptr_0, this.int_1); } if (num3 < this.int_1) { flag = true; } Class119.alBufferData(intPtr, this.enum12_0, this.intptr_0, num3, this.int_0); Class119.smethod_5(this.intptr_1, ref intPtr); this.int_3 += this.int_1; this.stopwatch_0.Reset(); this.stopwatch_0.Start(); } int num4; Class119.alGetSourcei(this.intptr_1, Enum11.const_5, out num4); if (num4 <= 0) { break; } if (Class119.smethod_4(this.intptr_1, Enum11.const_4) != 4114) { Class119.alSourcePlay(this.intptr_1); } } } if (!flag) { return; } while (Class119.smethod_4(this.intptr_1, Enum11.const_6) != this.int_2) { } Stream arg_188_0 = this.stream1_0; this.int_3 = 0; arg_188_0.Position = 0L; this.enum1_0 = AudioStatus.ShouldStopAudio; Class119.alSourceStop(this.intptr_1); this.stopwatch_0.Reset(); Class119.smethod_7(this.intptr_1, this.intptr_2.Length); }