Пример #1
0
 private void method_6(bool bool_4)
 {
     if (!this.bool_0)
     {
         if (this.method_2())
         {
             this.method_3(false);
         }
         if (Struct62.smethod_2(this.struct62_0, Struct62.struct62_0))
         {
             Class120.dictionary_0.Remove(this.struct62_0);
             OpenAL.alcDestroyContext(this.struct62_0);
         }
         if (this.intptr_0 != IntPtr.Zero)
         {
             OpenAL.alcCloseDevice(this.intptr_0);
         }
         this.bool_0 = true;
     }
 }
Пример #2
0
 private static void smethod_1(Class120 class120_0)
 {
     lock (Class120.object_0)
     {
         if (!OpenAL.alcMakeContextCurrent((class120_0 != null) ? class120_0.struct62_0 : Struct62.struct62_0))
         {
             //Delegate129.delegate129_0;
             //"ALC {0} error detected at {1}.";
             OpenAL.alcGetError((class120_0 != null) ? Struct62.smethod_0(class120_0.struct62_0) : IntPtr.Zero).ToString();
             if (class120_0 == null)
             {
                 //"null";
             }
             else
             {
                 class120_0.ToString();
             }
             throw null;
         }
     }
 }
Пример #3
0
 public static extern void alcDestroyContext([In] Struct62 context);
Пример #4
0
 public static extern bool alcMakeContextCurrent([In] Struct62 context);
Пример #5
0
        private void method_0(string string_1, int int_0, int int_1, bool bool_4, bool bool_5)
        {
            if (!Class120.bool_3)
            {
                throw new DllNotFoundException("openal32.dll");
            }
            if (Class120.enum13_0 == Class120.Enum13.const_1 && Class120.list_0.Count == 0)
            {
                throw new NotSupportedException("No audio hardware is available.");
            }
            if (this.bool_2)
            {
                throw new NotSupportedException("Multiple AudioContexts are not supported.");
            }
            if (int_0 < 0)
            {
                throw new ArgumentOutOfRangeException("freq", int_0, "Should be greater than zero.");
            }
            if (int_1 < 0)
            {
                throw new ArgumentOutOfRangeException("refresh", int_1, "Should be greater than zero.");
            }
            if (!string.IsNullOrEmpty(string_1))
            {
                this.intptr_0 = OpenAL.alcOpenDevice(string_1);
            }
            if (this.intptr_0 == IntPtr.Zero)
            {
                this.intptr_0 = OpenAL.alcOpenDevice(null);
            }
            if (this.intptr_0 == IntPtr.Zero)
            {
                OpenAL.alcOpenDevice(OpenAL.smethod_0(IntPtr.Zero, Enum7.const_0));
            }
            if (this.intptr_0 == IntPtr.Zero && Class120.list_0.Count > 0)
            {
                this.intptr_0 = OpenAL.alcOpenDevice(Class120.list_0[0]);
            }
            if (this.intptr_0 == IntPtr.Zero)
            {
                throw new Exception2(string.Format("Audio device '{0}' does not exist or is tied up by another application.", string.IsNullOrEmpty(string_1) ? "default" : string_1));
            }
            this.method_1();
            List <int> list = new List <int>();

            if (int_0 != 0)
            {
                list.Add(4103);
                list.Add(int_0);
            }
            if (int_1 != 0)
            {
                list.Add(4104);
                list.Add(int_1);
            }
            list.Add(4105);
            list.Add(bool_4 ? 1 : 0);
            if (bool_5 && OpenAL.alcIsExtensionPresent(this.intptr_0, "ALC_EXT_EFX"))
            {
                int item;
                OpenAL.alcGetIntegerv(this.intptr_0, Enum9.const_7, 1, out item);
                list.Add(131075);
                list.Add(item);
            }
            list.Add(0);
            this.struct62_0 = OpenAL.alcCreateContext(this.intptr_0, list.ToArray());
            if (Struct62.smethod_1(this.struct62_0, Struct62.struct62_0))
            {
                OpenAL.alcCloseDevice(this.intptr_0);
                throw new Exception3("The audio context could not be created with the specified parameters.");
            }
            this.method_1();
            if (Class120.list_0.Count > 0)
            {
                this.method_4();
            }
            this.method_1();
            this.string_0 = OpenAL.smethod_0(this.intptr_0, Enum7.const_5);
            int num;

            OpenAL.alcGetIntegerv(this.intptr_0, Enum9.const_2, 4, out num);
            if (num > 0)
            {
                int[] array = new int[num];
                OpenAL.alcGetIntegerv(this.intptr_0, Enum9.const_3, array.Length * 4, out array[0]);
                int[] array2 = array;
                for (int i = 0; i < array2.Length; i++)
                {
                    int   num2  = array2[i];
                    Enum6 @enum = (Enum6)num2;
                    if (@enum == Enum6.const_2)
                    {
                        this.method_5(true);
                    }
                }
            }
            lock (Class120.object_0)
            {
                Class120.dictionary_0.Add(this.struct62_0, this);
                this.bool_2 = true;
            }
        }