Exemple #1
0
 private static void smethod_0()
 {
     lock (Class120.object_0)
     {
         if (Class120.list_0.Count == 0)
         {
             try
             {
                 if (OpenAL.alcIsExtensionPresent(IntPtr.Zero, "ALC_ENUMERATION_EXT"))
                 {
                     Class120.enum13_0 = Class120.Enum13.const_1;
                     Class120.list_0.AddRange(OpenAL.smethod_1(IntPtr.Zero, Enum8.const_1));
                 }
                 else
                 {
                     Class120.enum13_0 = Class120.Enum13.const_0;
                 }
                 foreach (string arg_65_0 in Class120.list_0)
                 {
                 }
             }
             catch (DllNotFoundException)
             {
                 Class120.bool_3 = false;
             }
         }
     }
 }
Exemple #2
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;
            }
        }