aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Audio.Backends.SoundIo/Native/libsoundio/SoundIORingBuffer.cs
blob: 7530da72c98e29a1dfe2fd86b828a15dded7a79a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
namespace SoundIOSharp
{
    public class SoundIORingBuffer : IDisposable
    {
        internal SoundIORingBuffer(IntPtr handle)
        {
            this.handle = handle;
        }

        IntPtr handle;

        public int Capacity
        {
            get { return Natives.soundio_ring_buffer_capacity(handle); }
        }

        public void Clear()
        {
            Natives.soundio_ring_buffer_clear(handle);
        }

        public void Dispose()
        {
            Natives.soundio_ring_buffer_destroy(handle);
        }

        public int FillCount
        {
            get { return Natives.soundio_ring_buffer_fill_count(handle); }
        }

        public int FreeCount
        {
            get { return Natives.soundio_ring_buffer_free_count(handle); }
        }

        public IntPtr ReadPointer
        {
            get { return Natives.soundio_ring_buffer_read_ptr(handle); }
        }

        public IntPtr WritePointer
        {
            get { return Natives.soundio_ring_buffer_write_ptr(handle); }
        }

        public void AdvanceReadPointer(int count)
        {
            Natives.soundio_ring_buffer_advance_read_ptr(handle, count);
        }

        public void AdvanceWritePointer(int count)
        {
            Natives.soundio_ring_buffer_advance_write_ptr(handle, count);
        }
    }
}