コード例 #1
0
        unsafe void UpdateVelocity2()
        {
            if (currentSound3DBuffer != null)
            {
                Vec3 value = CurrentVirtualChannel.Velocity;

                int hr = IDirectSound3DBuffer8.SetVelocity(currentSound3DBuffer,
                                                           value.X, value.Z, value.Y, DSound.DS3D_IMMEDIATE);
                if (Wrapper.FAILED(hr))
                {
                    DirectSoundWorld.Warning("IDirectSoundBuffer.SetVelocity", hr);
                }
            }
        }
コード例 #2
0
        unsafe protected override void PreDetachVirtualChannel()
        {
            DirectSoundWorld.criticalSection.Enter();

            DirectFileStreamSound currentFileStreamSound = currentSound as DirectFileStreamSound;

            if (currentFileStreamSound != null)
            {
                DirectSoundWorld.Instance.fileStreamRealChannels.Remove(this);
            }

            if (currentSound3DBuffer != null)
            {
                IDirectSound3DBuffer8.Release(currentSound3DBuffer);
                currentSound3DBuffer = null;
            }

            if (currentSoundBuffer != null)
            {
                IDirectSoundBuffer.Stop(currentSoundBuffer);
                currentSound.FreeBuffer(currentSoundBuffer);
                currentSoundBuffer = null;
            }

            if (streamBuffer != null)
            {
                NativeUtils.Free((IntPtr)streamBuffer);
                streamBuffer = null;
            }
            needStopAfterBufferRead = false;
            streamBufferLength      = 0;

            needStopVirtualChannel = false;

            currentSound = null;

            DirectSoundWorld.criticalSection.Leave();
        }