mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
56
Brutal.OpenAl/Manual/AlSource.Ext.cs
Normal file
56
Brutal.OpenAl/Manual/AlSource.Ext.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
namespace Brutal.OpenAlApi;
|
||||
|
||||
public readonly record struct AlSampleOffsetLatency(long SampleOffset, long Latency)
|
||||
{
|
||||
public int WholeSamples => (int)(SampleOffset >> 32);
|
||||
}
|
||||
|
||||
public readonly record struct AlSampleOffsetClock(long SampleOffset, long ClockTime)
|
||||
{
|
||||
public int WholeSamples => (int)(SampleOffset >> 32);
|
||||
}
|
||||
|
||||
public readonly record struct AlSecOffsetLatency(double SecOffset, double Latency);
|
||||
|
||||
public readonly record struct AlSecOffsetClock(double SecOffset, double ClockTime);
|
||||
|
||||
public readonly partial struct AlSource
|
||||
{
|
||||
public AlSecOffsetLatency SecOffsetLatency
|
||||
{
|
||||
get
|
||||
{
|
||||
var (offset, latency) = Al.GetSourcedv2SOFT(Name, Al.Constants.AL_SEC_OFFSET_LATENCY_SOFT);
|
||||
return new AlSecOffsetLatency(offset, latency);
|
||||
}
|
||||
}
|
||||
|
||||
public AlSampleOffsetLatency SampleOffsetLatency
|
||||
{
|
||||
get
|
||||
{
|
||||
var (offset, latency) = Al.GetSourcei64v2SOFT(Name, Al.Constants.AL_SAMPLE_OFFSET_LATENCY_SOFT);
|
||||
return new AlSampleOffsetLatency(offset, latency);
|
||||
}
|
||||
}
|
||||
|
||||
public AlSecOffsetClock SecOffsetClock
|
||||
{
|
||||
get
|
||||
{
|
||||
var (offset, clock) = Al.GetSourcedv2SOFT(Name, Al.Constants.AL_SEC_OFFSET_CLOCK_SOFT);
|
||||
return new AlSecOffsetClock(offset, clock);
|
||||
}
|
||||
}
|
||||
|
||||
public AlSampleOffsetClock SampleOffsetClock
|
||||
{
|
||||
get
|
||||
{
|
||||
var (offset, clock) = Al.GetSourcei64v2SOFT(Name, Al.Constants.AL_SAMPLE_OFFSET_CLOCK_SOFT);
|
||||
return new AlSampleOffsetClock(offset, clock);
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayAt(long deviceClockTime) => Al.PInvoke.SourcePlayAtTimeSOFT(Name, deviceClockTime);
|
||||
}
|
||||
Loading…
Reference in a new issue