2018-11-14 21:22:50 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
namespace SoundIOSharp
|
|
|
|
|
{
|
2020-11-27 14:55:00 -05:00
|
|
|
|
public struct SoundIOChannelAreas
|
|
|
|
|
{
|
|
|
|
|
static readonly int native_size = Marshal.SizeOf<SoundIoChannelArea>();
|
2018-11-14 21:22:50 -05:00
|
|
|
|
|
2020-11-27 14:55:00 -05:00
|
|
|
|
internal SoundIOChannelAreas(IntPtr head, int channelCount, int frameCount)
|
|
|
|
|
{
|
|
|
|
|
this.head = head;
|
|
|
|
|
this.channel_count = channelCount;
|
|
|
|
|
this.frame_count = frameCount;
|
|
|
|
|
}
|
2018-11-14 21:22:50 -05:00
|
|
|
|
|
2020-11-27 14:55:00 -05:00
|
|
|
|
IntPtr head;
|
|
|
|
|
int channel_count;
|
|
|
|
|
int frame_count;
|
2018-11-14 21:22:50 -05:00
|
|
|
|
|
2020-11-27 14:55:00 -05:00
|
|
|
|
public bool IsEmpty
|
|
|
|
|
{
|
|
|
|
|
get { return head == IntPtr.Zero; }
|
|
|
|
|
}
|
2018-11-14 21:22:50 -05:00
|
|
|
|
|
2020-11-27 14:55:00 -05:00
|
|
|
|
public SoundIOChannelArea GetArea(int channel)
|
|
|
|
|
{
|
|
|
|
|
return new SoundIOChannelArea(head + native_size * channel);
|
|
|
|
|
}
|
2018-11-14 21:22:50 -05:00
|
|
|
|
|
2020-11-27 14:55:00 -05:00
|
|
|
|
public int ChannelCount => channel_count;
|
|
|
|
|
public int FrameCount => frame_count;
|
|
|
|
|
}
|
|
|
|
|
}
|