SoundIORingBuffer.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. namespace SoundIOSharp
  3. {
  4. public class SoundIORingBuffer : IDisposable
  5. {
  6. internal SoundIORingBuffer(IntPtr handle)
  7. {
  8. this.handle = handle;
  9. }
  10. IntPtr handle;
  11. public int Capacity
  12. {
  13. get { return Natives.soundio_ring_buffer_capacity(handle); }
  14. }
  15. public void Clear()
  16. {
  17. Natives.soundio_ring_buffer_clear(handle);
  18. }
  19. public void Dispose()
  20. {
  21. Natives.soundio_ring_buffer_destroy(handle);
  22. }
  23. public int FillCount
  24. {
  25. get { return Natives.soundio_ring_buffer_fill_count(handle); }
  26. }
  27. public int FreeCount
  28. {
  29. get { return Natives.soundio_ring_buffer_free_count(handle); }
  30. }
  31. public IntPtr ReadPointer
  32. {
  33. get { return Natives.soundio_ring_buffer_read_ptr(handle); }
  34. }
  35. public IntPtr WritePointer
  36. {
  37. get { return Natives.soundio_ring_buffer_write_ptr(handle); }
  38. }
  39. public void AdvanceReadPointer(int count)
  40. {
  41. Natives.soundio_ring_buffer_advance_read_ptr(handle, count);
  42. }
  43. public void AdvanceWritePointer(int count)
  44. {
  45. Natives.soundio_ring_buffer_advance_write_ptr(handle, count);
  46. }
  47. }
  48. }