aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Audio.Backends.SoundIo/Native/libsoundio/SoundIOChannelAreas.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Audio.Backends.SoundIo/Native/libsoundio/SoundIOChannelAreas.cs')
-rw-r--r--Ryujinx.Audio.Backends.SoundIo/Native/libsoundio/SoundIOChannelAreas.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Ryujinx.Audio.Backends.SoundIo/Native/libsoundio/SoundIOChannelAreas.cs b/Ryujinx.Audio.Backends.SoundIo/Native/libsoundio/SoundIOChannelAreas.cs
new file mode 100644
index 00000000..e0f375b9
--- /dev/null
+++ b/Ryujinx.Audio.Backends.SoundIo/Native/libsoundio/SoundIOChannelAreas.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace SoundIOSharp
+{
+ public struct SoundIOChannelAreas
+ {
+ static readonly int native_size = Marshal.SizeOf<SoundIoChannelArea>();
+
+ internal SoundIOChannelAreas(IntPtr head, int channelCount, int frameCount)
+ {
+ this.head = head;
+ this.channel_count = channelCount;
+ this.frame_count = frameCount;
+ }
+
+ IntPtr head;
+ int channel_count;
+ int frame_count;
+
+ public bool IsEmpty
+ {
+ get { return head == IntPtr.Zero; }
+ }
+
+ public SoundIOChannelArea GetArea(int channel)
+ {
+ return new SoundIOChannelArea(head + native_size * channel);
+ }
+
+ public int ChannelCount => channel_count;
+ public int FrameCount => frame_count;
+ }
+} \ No newline at end of file