Beispiel #1
0
 private void method_6(bool bool4)
 {
     if (!_bool0)
     {
         if (method_2())
         {
             method_3(false);
         }
         if (Struct62.smethod_2(_struct620, Struct62.Struct620))
         {
             Dictionary0.Remove(_struct620);
             OpenAl.alcDestroyContext(_struct620);
         }
         if (_intptr0 != IntPtr.Zero)
         {
             OpenAl.alcCloseDevice(_intptr0);
         }
         _bool0 = true;
     }
 }
Beispiel #2
0
        private void method_0(string string1, int int0, int int1, bool bool4, bool bool5)
        {
            if (!_bool3)
            {
                throw new DllNotFoundException("openal32.dll");
            }
            if (_enum130 == Enum13.Const1 && List0.Count == 0)
            {
                throw new NotSupportedException("No audio hardware is available.");
            }
            if (_bool2)
            {
                throw new NotSupportedException("Multiple AudioContexts are not supported.");
            }
            if (int0 < 0)
            {
                throw new ArgumentOutOfRangeException("freq", int0, "Should be greater than zero.");
            }
            if (int1 < 0)
            {
                throw new ArgumentOutOfRangeException("refresh", int1, "Should be greater than zero.");
            }
            if (!string.IsNullOrEmpty(string1))
            {
                _intptr0 = OpenAl.alcOpenDevice(string1);
            }
            if (_intptr0 == IntPtr.Zero)
            {
                _intptr0 = OpenAl.alcOpenDevice(null);
            }
            if (_intptr0 == IntPtr.Zero)
            {
                OpenAl.alcOpenDevice(OpenAl.smethod_0(IntPtr.Zero, Enum7.Const0));
            }
            if (_intptr0 == IntPtr.Zero && List0.Count > 0)
            {
                _intptr0 = OpenAl.alcOpenDevice(List0[0]);
            }
            if (_intptr0 == IntPtr.Zero)
            {
                throw new Exception2(string.Format(
                                         "Audio device '{0}' does not exist or is tied up by another application.",
                                         string.IsNullOrEmpty(string1) ? "default" : string1));
            }
            method_1();
            var list = new List <int>();

            if (int0 != 0)
            {
                list.Add(4103);
                list.Add(int0);
            }
            if (int1 != 0)
            {
                list.Add(4104);
                list.Add(int1);
            }
            list.Add(4105);
            list.Add(bool4 ? 1 : 0);
            if (bool5 && OpenAl.alcIsExtensionPresent(_intptr0, "ALC_EXT_EFX"))
            {
                int item;
                OpenAl.alcGetIntegerv(_intptr0, Enum9.Const7, 1, out item);
                list.Add(131075);
                list.Add(item);
            }
            list.Add(0);
            _struct620 = OpenAl.alcCreateContext(_intptr0, list.ToArray());
            if (Struct62.smethod_1(_struct620, Struct62.Struct620))
            {
                OpenAl.alcCloseDevice(_intptr0);
                throw new Exception3("The audio context could not be created with the specified parameters.");
            }
            method_1();
            if (List0.Count > 0)
            {
                method_4();
            }
            method_1();
            _string0 = OpenAl.smethod_0(_intptr0, Enum7.Const5);
            int num;

            OpenAl.alcGetIntegerv(_intptr0, Enum9.Const2, 4, out num);
            if (num > 0)
            {
                var array = new int[num];
                OpenAl.alcGetIntegerv(_intptr0, Enum9.Const3, array.Length * 4, out array[0]);
                var array2 = array;
                for (var i = 0; i < array2.Length; i++)
                {
                    var num2  = array2[i];
                    var @enum = (Enum6)num2;
                    if (@enum == Enum6.Const2)
                    {
                        method_5(true);
                    }
                }
            }
            lock (Object0)
            {
                Dictionary0.Add(_struct620, this);
                _bool2 = true;
            }
        }