Esempio n. 1
0
 public override bool Equals(object obj)
 {
     AlHelper.ThrowNullException(Handle);
     if (obj is Device)
     {
         return(Equals((Device)obj));
     }
     return(false);
 }
Esempio n. 2
0
 public void Read(IntPtr buffer, int samples)
 {
     AlHelper.ThrowNullException(Handle);
     unsafe
     {
         Alc.CaptureSamples(Handle, buffer.ToPointer(), samples);
         AlHelper.GetAlcError(Alc.GetError(Handle));
     }
 }
Esempio n. 3
0
 public override bool Equals(object obj)
 {
     AlHelper.ThrowNullException(Id);
     if (obj is Source)
     {
         return(Equals((Source)obj));
     }
     return(false);
 }
Esempio n. 4
0
 public void Delete()
 {
     AlHelper.ThrowNullException(Id);
     unsafe
     {
         uint id = Id;
         Al.DeleteSources(1, &id);
     }
 }
Esempio n. 5
0
        public Buffer Unqueue()
        {
            AlHelper.ThrowNullException(Id);

            unsafe
            {
                uint bid;
                Al.SourceUnqueueBuffers(Id, 1, &bid);
                return(new OpenAL.Buffer(bid));
            }
        }
Esempio n. 6
0
 public void Read(byte[] buffer, int samples)
 {
     AlHelper.ThrowNullException(Handle);
     unsafe
     {
         fixed(byte *pointer = buffer)
         {
             Alc.CaptureSamples(Handle, pointer, samples);
             AlHelper.GetAlcError(Alc.GetError(Handle));
         }
     }
 }
Esempio n. 7
0
 public bool Close()
 {
     AlHelper.ThrowNullException(Handle);
     if (Alc.CloseDevice(Handle) != 0)
     {
         Handle = IntPtr.Zero;
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 8
0
        public void Queue(Buffer buffer)
        {
            AlHelper.ThrowNullException(Id);
            if (buffer == Buffer.Null)
            {
                throw new ArgumentNullException("buffer");
            }

            unsafe
            {
                uint bid = buffer.Id;
                Al.SourceQueueBuffers(Id, 1, &bid);
            }
        }
Esempio n. 9
0
        public void BufferData(Format format, IntPtr data, int size, int frequency)
        {
            AlHelper.ThrowNullException(Id);
            if (data == IntPtr.Zero)
            {
                throw new ArgumentNullException("data");
            }

            unsafe
            {
                uint id = Id;
                Al.BufferData(Id, (int)format, data.ToPointer(), size, frequency);
            }
        }
Esempio n. 10
0
        public void BufferData(Format format, byte[] data, int size, int frequency)
        {
            AlHelper.ThrowNullException(Id);
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            unsafe
            {
                fixed(byte *pointer = data)
                {
                    uint id = Id;

                    Al.BufferData(Id, (int)format, pointer, size, frequency);
                }
            }
        }
Esempio n. 11
0
        public void Queue(Buffer[] buffers)
        {
            AlHelper.ThrowNullException(Id);
            if (buffers == null)
            {
                throw new ArgumentNullException("buffers");
            }

            unsafe
            {
                uint *bids = stackalloc uint[buffers.Length];
                for (int i = 0; i < buffers.Length; ++i)
                {
                    bids[i] = buffers[i].Id;
                }
                Al.SourceQueueBuffers(Id, buffers.Length, bids);
            }
        }
Esempio n. 12
0
        public                        Buffer[] Unqueue(int count)
        {
            AlHelper.ThrowNullException(Id);
            if (count <= 0)
            {
                throw new ArgumentException("count is less than or equal to 0.", "count");
            }

            unsafe
            {
                uint *bids = stackalloc uint[count];
                Al.SourceUnqueueBuffers(Id, count, bids);

                Buffer[] buffers = new Buffer[count];
                for (int i = 0; i < count; ++i)
                {
                    buffers[i] = new Buffer(bids[i]);
                }
                return(buffers);
            }
        }
Esempio n. 13
0
 public bool Equals(Source other)
 {
     AlHelper.ThrowNullException(Id);
     return(Id == other.Id);
 }
Esempio n. 14
0
 public void Destroy()
 {
     AlHelper.ThrowNullException(Handle);
     Alc.DestroyContext(Handle);
 }
Esempio n. 15
0
 public override int GetHashCode()
 {
     AlHelper.ThrowNullException(Id);
     return(Id.GetHashCode());
 }
Esempio n. 16
0
 public void Stop()
 {
     AlHelper.ThrowNullException(Handle);
     Alc.CaptureStop(Handle);
     AlHelper.GetAlcError(Alc.GetError(Handle));
 }
Esempio n. 17
0
 public void Stop()
 {
     AlHelper.ThrowNullException(Id);
     Al.SourceStop(Id);
 }
Esempio n. 18
0
 public bool Equals(Device other)
 {
     AlHelper.ThrowNullException(Handle);
     return(Handle == other.Handle);
 }
Esempio n. 19
0
 public void Rewind()
 {
     AlHelper.ThrowNullException(Id);
     Al.SourceRewind(Id);
 }
Esempio n. 20
0
 public void Play()
 {
     AlHelper.ThrowNullException(Id);
     Al.SourcePlay(Id);
 }
Esempio n. 21
0
 public void Suspend()
 {
     AlHelper.ThrowNullException(Handle);
     Alc.SuspendContext(Handle);
 }
Esempio n. 22
0
 public override string ToString()
 {
     AlHelper.ThrowNullException(Id);
     return(string.Format("Source: {0}", Id.ToString()));
 }
Esempio n. 23
0
 public override string ToString()
 {
     AlHelper.ThrowNullException(Handle);
     return(string.Format("Device: {0}", Handle.ToString()));
 }
Esempio n. 24
0
 public void Pause()
 {
     AlHelper.ThrowNullException(Id);
     Al.SourcePause(Id);
 }
Esempio n. 25
0
 public void Process()
 {
     AlHelper.ThrowNullException(Handle);
     Alc.ProcessContext(Handle);
 }