Watch
2
0
Fork
You've already forked raylib-cs
0

Focus pr on explicit type and util changes

This commit is contained in:
Rgebee 2025-09-17 19:16:39 +01:00
commit be91fe9120
15 changed files with 18 additions and 856 deletions

View file

@ -10,7 +10,7 @@ namespace Raylib_cs;
[StructLayout(LayoutKind.Sequential)]
public struct AudioStream
{
//TODO: convert
// TODO: convert
/// <summary>
/// Pointer to internal data(rAudioBuffer *) used by the audio system
/// </summary>
@ -35,73 +35,4 @@ public struct AudioStream
/// Number of channels (1-mono, 2-stereo)
/// </summary>
public uint Channels;
public readonly CBool IsValid => Raylib.IsAudioStreamValid(this);
public readonly CBool IsPlaying => Raylib.IsAudioStreamPlaying(this);
public readonly CBool IsProcessed => Raylib.IsAudioStreamProcessed(this);
public static AudioStream Load(uint sampleRate, uint sampleSize, uint channels)
{
return Raylib.LoadAudioStream(sampleRate, sampleSize, channels);
}
public readonly void Play()
{
Raylib.PlayAudioStream(this);
}
public readonly void Pause()
{
Raylib.PauseAudioStream(this);
}
public readonly void Resume()
{
Raylib.ResumeAudioStream(this);
}
public unsafe void Update(void* data, int frameCount)
{
Raylib.UpdateAudioStream(this, data, frameCount);
}
public readonly void Stop()
{
Raylib.StopAudioStream(this);
}
public static void SetBufferSizeDefault(int size)
{
Raylib.SetAudioStreamBufferSizeDefault(size);
}
/// <summary>
/// Set pan for this audio stream where 0.5 is centered
/// </summary>
/// <param name="pan"></param>
public void SetPan(float pan)
{
Raylib.SetAudioStreamPan(this, pan);
}
/// <summary>
/// Set pitch for this audio stream where 1.0 si base level
/// </summary>
public void SetPitch(float pitch)
{
Raylib.SetAudioStreamPitch(this, pitch);
}
/// <summary>
/// Set the volume from 0.0 to 1.0
/// </summary>
public void SetVolume(float volume)
{
Raylib.SetAudioStreamVolume(this, volume);
}
public void Unload()
{
Raylib.UnloadAudioStream(this);
}
}