void ISoundPcmDriver.Close(int handle)
        {
            Sdl2SoundChannel channel = null;

            foreach (Sdl2SoundChannel current in this.channels)
            {
                if (current.Handle == handle)
                {
                    channel = current;
                    break;
                }
            }

            if (channel != null)
            {
                this.FreeHandle(channel.Handle);
                this.channels.Remove(channel);
            }
        }
        int ISoundPcmDriver.Open(AudioCallback callback, ToneChannel tc)
        {
            (this as ISoundPcmDriver).Lock();

            Sdl2SoundChannel channel = new Sdl2SoundChannel();

            channel.Handle = this.CreateHandle();
            if (channel.Handle == 0)
            {
                return(0);
            }

            channel.Callback    = callback;
            channel.ToneChannel = tc;
            channel.Available   = 1;

            this.channels.Add(channel);

            (this as ISoundPcmDriver).Unlock();

            return(channel.Handle);
        }