Exemplo n.º 1
0
        public static IList <string> smethod_1(IntPtr intptr_0, Enum8 enum8_0)
        {
            List <string> list          = new List <string>();
            IntPtr        ptr           = OpenAL.alcGetString(IntPtr.Zero, (Enum7)enum8_0);
            StringBuilder stringBuilder = new StringBuilder();
            int           ofs           = 0;

            while (true)
            {
                byte b = Marshal.ReadByte(ptr, ofs++);
                if (b != 0)
                {
                    stringBuilder.Append((char)b);
                }
                if (b == 0)
                {
                    list.Add(stringBuilder.ToString());
                    if (Marshal.ReadByte(ptr, ofs) == 0)
                    {
                        break;
                    }
                    stringBuilder.Remove(0, stringBuilder.Length);
                }
            }
            return(list);
        }
Exemplo n.º 2
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;
             }
         }
     }
 }
Exemplo n.º 3
0
        private void method_1()
        {
            AlcError alcError = OpenAL.alcGetError(this.intptr_0);

            if (alcError != AlcError.NoError)
            {
                throw new Exception3(alcError.ToString());
            }
        }
Exemplo n.º 4
0
        public static Class120 smethod_2()
        {
            Class120 result;

            lock (Class120.object_0)
            {
                if (Class120.dictionary_0.Count == 0)
                {
                    result = null;
                }
                else
                {
                    Class120 @class;
                    Class120.dictionary_0.TryGetValue(OpenAL.alcGetCurrentContext(), out @class);
                    result = @class;
                }
            }
            return(result);
        }
Exemplo n.º 5
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;
     }
 }
Exemplo n.º 6
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;
         }
     }
 }
Exemplo n.º 7
0
 public static string smethod_0(IntPtr intptr_0, Enum7 enum7_0)
 {
     return(Marshal.PtrToStringAnsi(OpenAL.alcGetString(intptr_0, enum7_0)));
 }
Exemplo n.º 8
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;
            }
        }