public static IntPtr smethod_6(IntPtr intptr_0) { IntPtr result; Class119.alSourceUnqueueBuffers_1(intptr_0, 1, out result); return(result); }
public static IntPtr smethod_2() { IntPtr result; Class119.alGenSources(1, out result); return(result); }
public static int smethod_4(IntPtr intptr_0, Enum11 enum11_0) { int result; Class119.alGetSourcei(intptr_0, enum11_0, out result); return(result); }
public void StopPlaying() { this.thread_0.Abort(); this.enum1_0 = AudioStatus.ShouldStopAudio; Class119.alSourceStop(this.intptr_1); this.stopwatch_0.Reset(); Class119.smethod_7(this.intptr_1, this.intptr_2.Length); }
public static IntPtr[] smethod_7(IntPtr intptr_0, int int_0) { if (int_0 <= 0) { throw new ArgumentOutOfRangeException("numEntries", "Must be greater than zero."); } IntPtr[] array = new IntPtr[int_0]; Class119.alSourceUnqueueBuffers(intptr_0, int_0, array); return(array); }
public static void smethod_9(IntPtr[] intptr_0) { if (intptr_0 == null) { throw new ArgumentNullException(); } if (intptr_0.Length == 0) { throw new ArgumentOutOfRangeException(); } Class119.alDeleteBuffers(intptr_0.Length, intptr_0); }
public Class117(GenericAudioStream stream1_1) { this.stream1_0 = stream1_1; this.class120_0 = (Class120.smethod_2() ?? new Class120()); this.enum12_0 = Class119.smethod_10(stream1_1.vmethod_0()); this.int_0 = stream1_1.vmethod_0().int_0; this.double_0 = (double)stream1_1.vmethod_0().int_0 *(double)stream1_1.vmethod_0().short_1 / 1000.0; this.int_1 = stream1_1.vmethod_0().method_0(80); this.int_2 = 5; this.intptr_0 = Marshal.AllocHGlobal(this.int_1); this.intptr_1 = Class119.smethod_2(); this.intptr_2 = Class119.smethod_8(this.int_2); this.enum1_0 = AudioStatus.ShouldStopAudio; }
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; } } }
public void method_2(bool bool_2) { if (bool_2) { this.stream1_0.Dispose(); } if (this.thread_0 != null) { this.thread_0.Abort(); } try { Marshal.FreeHGlobal(this.intptr_0); } catch { } Class119.alSourceStop(this.intptr_1); Class119.smethod_3(this.intptr_1); Class119.smethod_9(this.intptr_2); this.class120_0.Dispose(); }
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); }
public static bool smethod_0() { return(Class119.alIsExtensionPresent("AL_EXT_FLOAT32")); }
public void StartPlaying() { Class119.alSourcePause(this.intptr_1); this.stopwatch_0.Stop(); this.enum1_0 = AudioStatus.IsCurrentlyPlayingAudio; }
public static void smethod_5(IntPtr intptr_0, ref IntPtr intptr_1) { Class119.alSourceQueueBuffers_1(intptr_0, 1, ref intptr_1); }
public static IntPtr[] smethod_8(int int_0) { IntPtr[] array = new IntPtr[int_0]; Class119.alGenBuffers(array.Length, array); return(array); }
public static void smethod_3(IntPtr intptr_0) { Class119.alDeleteSources(1, ref intptr_0); }
public static Enum12 smethod_10(WaveFormat waveFormat_0) { switch (waveFormat_0.waveFormatTag_0) { case WaveFormatTag.PCM: switch (waveFormat_0.short_0) { case 1: { short short_ = waveFormat_0.short_2; if (short_ == 8) { return(Enum12.const_0); } if (short_ == 16) { return(Enum12.const_1); } break; } case 2: { short short_2 = waveFormat_0.short_2; if (short_2 == 8) { return(Enum12.const_2); } if (short_2 == 16) { return(Enum12.const_3); } break; } default: if (Class119.smethod_1()) { switch (waveFormat_0.short_0) { case 4: { short short_3 = waveFormat_0.short_2; if (short_3 == 8) { return(Enum12.const_6); } if (short_3 == 16) { return(Enum12.const_7); } if (short_3 == 32) { return(Enum12.const_8); } break; } case 5: { short short_4 = waveFormat_0.short_2; if (short_4 == 8) { return(Enum12.const_9); } if (short_4 == 16) { return(Enum12.const_10); } if (short_4 == 32) { return(Enum12.const_11); } break; } case 6: { short short_5 = waveFormat_0.short_2; if (short_5 == 8) { return(Enum12.const_12); } if (short_5 == 16) { return(Enum12.const_13); } if (short_5 == 32) { return(Enum12.const_14); } break; } case 7: { short short_6 = waveFormat_0.short_2; if (short_6 == 8) { return(Enum12.const_15); } if (short_6 == 16) { return(Enum12.const_16); } if (short_6 == 32) { return(Enum12.const_17); } break; } case 8: { short short_7 = waveFormat_0.short_2; if (short_7 == 8) { return(Enum12.const_18); } if (short_7 == 16) { return(Enum12.const_19); } if (short_7 == 32) { return(Enum12.const_20); } break; } } } break; } break; case WaveFormatTag.IEEEFloat: if (Class119.smethod_0()) { switch (waveFormat_0.short_0) { case 1: return(Enum12.const_4); case 2: return(Enum12.const_5); } } break; } throw new NotSupportedException(string.Concat(new object[] { "OpenAL does not support this format: ", waveFormat_0.waveFormatTag_0, " | ", (int)waveFormat_0.waveFormatTag_0 })); }
public static bool smethod_1() { return(Class119.alIsExtensionPresent("AL_EXT_MCFORMATS")); }