Exemplo n.º 1
0
        public void DifferentStartPlaying()
        {
            switch (_enum10)
            {
            case AudioStatus.ShouldStartAudio:
                return;

            case AudioStatus.IsCurrentlyPlayingAudio:
                Class119.alSourcePlay(_intptr1);
                _stopwatch0.Start();
                _enum10 = AudioStatus.ShouldStartAudio;
                return;

            default:
            {
                while (Class119.smethod_4(_intptr1, Enum11.Const5) > 0)
                {
                    Class119.smethod_6(_intptr1);
                }
                var array = _intptr2;
                for (var i = 0; i < array.Length; i++)
                {
                    var intPtr = array[i];
                    int num;
                    lock (_stream10)
                    {
                        num = _stream10.vmethod_3(_intptr0, _int1);
                    }
                    Class119.alBufferData(intPtr, _enum120, _intptr0, num, _int0);
                }
                Class119.alSourceQueueBuffers(_intptr1, _intptr2.Length, _intptr2);
                if (!_bool1)
                {
                    ThreadPool.QueueUserWorkItem(method_3);
                }
                Class119.alSourcef(_intptr1, Enum10.Const4, 0f);
                Class119.alSourcePlay(_intptr1);
                _stopwatch0.Start();
                _enum10 = AudioStatus.ShouldStartAudio;
                method_0();
                return;
            }
            }
        }
Exemplo n.º 2
0
        private void method_1()
        {
            var flag = false;

            while (_enum10 != AudioStatus.ShouldStopAudio && !flag)
            {
                if (_bool0)
                {
                    _bool0 = false;
                    Class119.alSourcef(_intptr1, Enum10.Const4, _float0);
                }
                if (_enum10 != AudioStatus.IsCurrentlyPlayingAudio)
                {
                    var num = 0;
                    int num2;
                    do
                    {
                        Class119.alGetSourcei(_intptr1, Enum11.Const6, out num2);
                        if (num > 50)
                        {
                            Thread.Sleep(1);
                        }
                        else
                        {
                            num++;
                        }
                    } while (num2 == 0);
                    while (num2-- != 0)
                    {
                        var intPtr = Class119.smethod_6(_intptr1);
                        int num3;
                        lock (_stream10)
                        {
                            num3 = _stream10.vmethod_3(_intptr0, _int1);
                        }
                        if (num3 < _int1)
                        {
                            flag = true;
                        }
                        Class119.alBufferData(intPtr, _enum120, _intptr0, num3, _int0);
                        Class119.smethod_5(_intptr1, ref intPtr);
                        _int3 += _int1;
                        _stopwatch0.Reset();
                        _stopwatch0.Start();
                    }
                    int num4;
                    Class119.alGetSourcei(_intptr1, Enum11.Const5, out num4);
                    if (num4 <= 0)
                    {
                        break;
                    }
                    if (Class119.smethod_4(_intptr1, Enum11.Const4) != 4114)
                    {
                        Class119.alSourcePlay(_intptr1);
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            while (Class119.smethod_4(_intptr1, Enum11.Const6) != _int2)
            {
            }
            Stream arg1880 = _stream10;

            _int3            = 0;
            arg1880.Position = 0L;
            _enum10          = AudioStatus.ShouldStopAudio;
            Class119.alSourceStop(_intptr1);
            _stopwatch0.Reset();
            Class119.smethod_7(_intptr1, _intptr2.Length);
        }