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

AttachAudioMixedProcessor Utils for easy callback (#215)

This commit is contained in:
Nicky McDonald 2024-02-24 03:44:13 -05:00 committed by GitHub
commit b049b4f88d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 57 additions and 0 deletions

View file

@ -1261,6 +1261,30 @@ public static unsafe partial class Raylib
}
}
/// <summary>
/// Attach audio stream processor to the entire audio pipeline
/// </summary>
public static void AttachAudioMixedProcessor(AudioCallback<float> processor)
{
if (AudioMixed.Callback == null)
{
AudioMixed.Callback = processor;
AttachAudioMixedProcessor(&AudioMixed.Processor);
}
}
/// <summary>
/// Detach audio stream processor from the entire audio pipeline
/// </summary>
public static void DetachAudioMixedProcessor(AudioCallback<float> processor)
{
if (AudioMixed.Callback == processor)
{
DetachAudioMixedProcessor(&AudioMixed.Processor);
AudioMixed.Callback = null;
}
}
public static string SubText(this string input, int position, int length)
{
return input.Substring(position, Math.Min(length, input.Length));