mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
1233 lines
49 KiB
C#
1233 lines
49 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Fmod.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
namespace Brutal.FmodApi
|
|
{
|
|
public static partial class Fmod
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Frees a sound object.
|
|
/// </para>
|
|
/// <para>
|
|
/// This will stop any instances of this sound, and free the sound object and its children if it is a
|
|
/// multi-sound object.
|
|
/// </para>
|
|
/// <para>
|
|
/// If the sound was opened with FMOD_NONBLOCKING and hasn't finished opening yet, it will block.
|
|
/// Additionally, if the sound is still playing or has recently been stopped, the release may stall, as the
|
|
/// mixer may still be using the sound. Using Sound::getOpenState and checking the open state for
|
|
/// FMOD_OPENSTATE_READY and FMOD_OPENSTATE_ERROR is a good way to avoid stalls.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::createSound, Sound::getSubSound
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_release">Sound::release</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryRelease(this Sound sound) => PInvoke.SoundRelease(sound);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Frees a sound object.
|
|
/// </para>
|
|
/// <para>
|
|
/// This will stop any instances of this sound, and free the sound object and its children if it is a
|
|
/// multi-sound object.
|
|
/// </para>
|
|
/// <para>
|
|
/// If the sound was opened with FMOD_NONBLOCKING and hasn't finished opening yet, it will block.
|
|
/// Additionally, if the sound is still playing or has recently been stopped, the release may stall, as the
|
|
/// mixer may still be using the sound. Using Sound::getOpenState and checking the open state for
|
|
/// FMOD_OPENSTATE_READY and FMOD_OPENSTATE_ERROR is a good way to avoid stalls.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::createSound, Sound::getSubSound
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_release">Sound::release</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Release(this Sound sound) => TryRelease(sound).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the parent System object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsystemobject">Sound::getSystemObject</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetSystemObject(this Sound sound, out FmodSystem system)
|
|
{
|
|
fixed (FmodSystem* systemPtr = &system)
|
|
return PInvoke.SoundGetSystemObject(sound, systemPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the parent System object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsystemobject">Sound::getSystemObject</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static FmodSystem GetSystemObject(this Sound sound)
|
|
{
|
|
TryGetSystemObject(sound, out var system).Check();
|
|
return system;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Gives access to a portion or all the sample data of a sound for direct manipulation.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_lock">Sound::lock</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryLock(
|
|
this Sound sound,
|
|
uint offset,
|
|
uint length,
|
|
out nint ptr1,
|
|
out nint ptr2,
|
|
out uint len1,
|
|
out uint len2
|
|
)
|
|
{
|
|
fixed (nint* ptr1Ptr = &ptr1)
|
|
fixed (nint* ptr2Ptr = &ptr2)
|
|
fixed (uint* len1Ptr = &len1)
|
|
fixed (uint* len2Ptr = &len2)
|
|
return PInvoke.SoundLock(sound, offset, length, ptr1Ptr, ptr2Ptr, len1Ptr, len2Ptr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Gives access to a portion or all the sample data of a sound for direct manipulation.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_lock">Sound::lock</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Lock(
|
|
this Sound sound,
|
|
uint offset,
|
|
uint length,
|
|
out nint ptr1,
|
|
out nint ptr2,
|
|
out uint len1,
|
|
out uint len2
|
|
) => TryLock(sound, offset, length, out ptr1, out ptr2, out len1, out len2).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Finalizes a previous sample data lock and submits it back to the Sound object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_unlock">Sound::unlock</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryUnlock(this Sound sound, nint ptr1, nint ptr2, uint len1, uint len2) =>
|
|
PInvoke.SoundUnlock(sound, ptr1, ptr2, len1, len2);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Finalizes a previous sample data lock and submits it back to the Sound object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_unlock">Sound::unlock</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Unlock(this Sound sound, nint ptr1, nint ptr2, uint len1, uint len2) =>
|
|
TryUnlock(sound, ptr1, ptr2, len1, len2).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets a sound's default playback attributes.
|
|
/// </para>
|
|
/// <para>
|
|
/// When the Sound is played it will use these values without having to specify them later on a per Channel
|
|
/// basis.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setdefaults">Sound::setDefaults</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetDefaults(this Sound sound, float frequency, int priority) =>
|
|
PInvoke.SoundSetDefaults(sound, frequency, priority);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets a sound's default playback attributes.
|
|
/// </para>
|
|
/// <para>
|
|
/// When the Sound is played it will use these values without having to specify them later on a per Channel
|
|
/// basis.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setdefaults">Sound::setDefaults</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetDefaults(this Sound sound, float frequency, int priority) =>
|
|
TrySetDefaults(sound, frequency, priority).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a sound's default playback attributes.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getdefaults">Sound::getDefaults</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetDefaults(this Sound sound, out float frequency, out int priority)
|
|
{
|
|
fixed (float* frequencyPtr = &frequency)
|
|
fixed (int* priorityPtr = &priority)
|
|
return PInvoke.SoundGetDefaults(sound, frequencyPtr, priorityPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a sound's default playback attributes.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getdefaults">Sound::getDefaults</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetDefaults(this Sound sound, out float frequency, out int priority) =>
|
|
TryGetDefaults(sound, out frequency, out priority).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the minimum and maximum audible distance for a 3D sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_set3dminmaxdistance">Sound::set3DMinMaxDistance</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySet3dMinMaxDistance(this Sound sound, float min, float max) =>
|
|
PInvoke.SoundSet3dMinMaxDistance(sound, min, max);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the minimum and maximum audible distance for a 3D sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_set3dminmaxdistance">Sound::set3DMinMaxDistance</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Set3dMinMaxDistance(this Sound sound, float min, float max) =>
|
|
TrySet3dMinMaxDistance(sound, min, max).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieve the minimum and maximum audible distance for a 3D sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_get3dminmaxdistance">Sound::get3DMinMaxDistance</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGet3dMinMaxDistance(this Sound sound, out float min, out float max)
|
|
{
|
|
fixed (float* minPtr = &min)
|
|
fixed (float* maxPtr = &max)
|
|
return PInvoke.SoundGet3dMinMaxDistance(sound, minPtr, maxPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieve the minimum and maximum audible distance for a 3D sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_get3dminmaxdistance">Sound::get3DMinMaxDistance</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Get3dMinMaxDistance(this Sound sound, out float min, out float max) =>
|
|
TryGet3dMinMaxDistance(sound, out min, out max).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the angles and attenuation levels of a 3D cone shape, for simulated occlusion which is based on
|
|
/// direction.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_set3dconesettings">Sound::set3DConeSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySet3dConeSettings(
|
|
this Sound sound,
|
|
float insideConeAngle,
|
|
float outsideConeAngle,
|
|
float outsideVolume
|
|
) => PInvoke.SoundSet3dConeSettings(sound, insideConeAngle, outsideConeAngle, outsideVolume);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the angles and attenuation levels of a 3D cone shape, for simulated occlusion which is based on
|
|
/// direction.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_set3dconesettings">Sound::set3DConeSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Set3dConeSettings(
|
|
this Sound sound,
|
|
float insideConeAngle,
|
|
float outsideConeAngle,
|
|
float outsideVolume
|
|
) => TrySet3dConeSettings(sound, insideConeAngle, outsideConeAngle, outsideVolume).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the inside and outside angles of the 3D projection cone and the outside volume.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_get3dconesettings">Sound::get3DConeSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGet3dConeSettings(
|
|
this Sound sound,
|
|
out float insideConeAngle,
|
|
out float outsideConeAngle,
|
|
out float outsideVolume
|
|
)
|
|
{
|
|
fixed (float* insideConeAnglePtr = &insideConeAngle)
|
|
fixed (float* outsideConeAnglePtr = &outsideConeAngle)
|
|
fixed (float* outsideVolumePtr = &outsideVolume)
|
|
return PInvoke.SoundGet3dConeSettings(sound, insideConeAnglePtr, outsideConeAnglePtr, outsideVolumePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the inside and outside angles of the 3D projection cone and the outside volume.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_get3dconesettings">Sound::get3DConeSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Get3dConeSettings(
|
|
this Sound sound,
|
|
out float insideConeAngle,
|
|
out float outsideConeAngle,
|
|
out float outsideVolume
|
|
) => TryGet3dConeSettings(sound, out insideConeAngle, out outsideConeAngle, out outsideVolume).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets a custom roll-off shape for 3D distance attenuation.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_set3dcustomrolloff">Sound::set3DCustomRolloff</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TrySet3dCustomRolloff(this Sound sound, float3* points, int numPoints) =>
|
|
PInvoke.SoundSet3dCustomRolloff(sound, points, numPoints);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets a custom roll-off shape for 3D distance attenuation.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_set3dcustomrolloff">Sound::set3DCustomRolloff</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void Set3dCustomRolloff(this Sound sound, float3* points, int numPoints) =>
|
|
TrySet3dCustomRolloff(sound, points, numPoints).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the current custom roll-off shape for 3D distance attenuation.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_get3dcustomrolloff">Sound::get3DCustomRolloff</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGet3dCustomRolloff(this Sound sound, out float3* points, out int numPoints)
|
|
{
|
|
fixed (float3** pointsPtr = &points)
|
|
fixed (int* numPointsPtr = &numPoints)
|
|
return PInvoke.SoundGet3dCustomRolloff(sound, pointsPtr, numPointsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the current custom roll-off shape for 3D distance attenuation.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_get3dcustomrolloff">Sound::get3DCustomRolloff</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void Get3dCustomRolloff(this Sound sound, out float3* points, out int numPoints) =>
|
|
TryGet3dCustomRolloff(sound, out points, out numPoints).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a handle to a Sound object that is contained within the parent sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsubsound">Sound::getSubSound</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetSubSound(this Sound sound, int index, out Sound subSound)
|
|
{
|
|
fixed (Sound* subSoundPtr = &subSound)
|
|
return PInvoke.SoundGetSubSound(sound, index, subSoundPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a handle to a Sound object that is contained within the parent sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsubsound">Sound::getSubSound</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Sound GetSubSound(this Sound sound, int index)
|
|
{
|
|
TryGetSubSound(sound, index, out var subSound).Check();
|
|
return subSound;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the parent Sound object that contains this subsound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsubsoundparent">Sound::getSubSoundParent</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetSubSoundParent(this Sound sound, out Sound parentSound)
|
|
{
|
|
fixed (Sound* parentSoundPtr = &parentSound)
|
|
return PInvoke.SoundGetSubSoundParent(sound, parentSoundPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the parent Sound object that contains this subsound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsubsoundparent">Sound::getSubSoundParent</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Sound GetSubSoundParent(this Sound sound)
|
|
{
|
|
TryGetSubSoundParent(sound, out var parentSound).Check();
|
|
return parentSound;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the name of a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getname">Sound::getName</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetName(this Sound sound, byte* name, int nameLen) =>
|
|
PInvoke.SoundGetName(sound, name, nameLen);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the name of a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getname">Sound::getName</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void GetName(this Sound sound, byte* name, int nameLen) =>
|
|
TryGetName(sound, name, nameLen).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the length using the specified time unit.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getlength">Sound::getLength</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetLength(this Sound sound, out uint length, TimeUnit lengthType)
|
|
{
|
|
fixed (uint* lengthPtr = &length)
|
|
return PInvoke.SoundGetLength(sound, lengthPtr, lengthType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the length using the specified time unit.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getlength">Sound::getLength</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint GetLength(this Sound sound, TimeUnit lengthType)
|
|
{
|
|
TryGetLength(sound, out var length, lengthType).Check();
|
|
return length;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Returns format information about the sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getformat">Sound::getFormat</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetFormat(
|
|
this Sound sound,
|
|
out SoundType type,
|
|
out SoundFormat format,
|
|
out int channels,
|
|
out int bits
|
|
)
|
|
{
|
|
fixed (SoundType* typePtr = &type)
|
|
fixed (SoundFormat* formatPtr = &format)
|
|
fixed (int* channelsPtr = &channels)
|
|
fixed (int* bitsPtr = &bits)
|
|
return PInvoke.SoundGetFormat(sound, typePtr, formatPtr, channelsPtr, bitsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Returns format information about the sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getformat">Sound::getFormat</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetFormat(
|
|
this Sound sound,
|
|
out SoundType type,
|
|
out SoundFormat format,
|
|
out int channels,
|
|
out int bits
|
|
) => TryGetFormat(sound, out type, out format, out channels, out bits).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of subsounds stored within a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getnumsubsounds">Sound::getNumSubSounds</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetNumSubSounds(this Sound sound, out int numSubSounds)
|
|
{
|
|
fixed (int* numSubSoundsPtr = &numSubSounds)
|
|
return PInvoke.SoundGetNumSubSounds(sound, numSubSoundsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of subsounds stored within a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getnumsubsounds">Sound::getNumSubSounds</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetNumSubSounds(this Sound sound)
|
|
{
|
|
TryGetNumSubSounds(sound, out var numSubSounds).Check();
|
|
return numSubSounds;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of metadata tags.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getnumtags">Sound::getNumTags</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetNumTags(this Sound sound, out int numTags, out int numTagsUpdated)
|
|
{
|
|
fixed (int* numTagsPtr = &numTags)
|
|
fixed (int* numTagsUpdatedPtr = &numTagsUpdated)
|
|
return PInvoke.SoundGetNumTags(sound, numTagsPtr, numTagsUpdatedPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of metadata tags.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getnumtags">Sound::getNumTags</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetNumTags(this Sound sound, out int numTags, out int numTagsUpdated) =>
|
|
TryGetNumTags(sound, out numTags, out numTagsUpdated).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a metadata tag.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_gettag">Sound::getTag</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetTag(this Sound sound, RefString8 name, int index, out Tag tag)
|
|
{
|
|
fixed (byte* namePtr = name)
|
|
fixed (Tag* tagPtr = &tag)
|
|
return PInvoke.SoundGetTag(sound, namePtr, index, tagPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a metadata tag.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_gettag">Sound::getTag</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Tag GetTag(this Sound sound, RefString8 name, int index)
|
|
{
|
|
TryGetTag(sound, name, index, out var tag).Check();
|
|
return tag;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the state a sound is in after being opened with the non blocking flag, or the current state of
|
|
/// the streaming buffer.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getopenstate">Sound::getOpenState</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetOpenState(
|
|
this Sound sound,
|
|
out OpenState openState,
|
|
out uint percentBuffered,
|
|
out Bool32 starving,
|
|
out Bool32 diskBusy
|
|
)
|
|
{
|
|
fixed (OpenState* openStatePtr = &openState)
|
|
fixed (uint* percentBufferedPtr = &percentBuffered)
|
|
fixed (Bool32* starvingPtr = &starving)
|
|
fixed (Bool32* diskBusyPtr = &diskBusy)
|
|
return PInvoke.SoundGetOpenState(sound, openStatePtr, percentBufferedPtr, starvingPtr, diskBusyPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the state a sound is in after being opened with the non blocking flag, or the current state of
|
|
/// the streaming buffer.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getopenstate">Sound::getOpenState</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetOpenState(
|
|
this Sound sound,
|
|
out OpenState openState,
|
|
out uint percentBuffered,
|
|
out Bool32 starving,
|
|
out Bool32 diskBusy
|
|
) => TryGetOpenState(sound, out openState, out percentBuffered, out starving, out diskBusy).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Reads data from an opened sound to a specified buffer, using FMOD's internal codecs.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_readdata">Sound::readData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryReadData(this Sound sound, nint buffer, uint length, out uint read)
|
|
{
|
|
fixed (uint* readPtr = &read)
|
|
return PInvoke.SoundReadData(sound, buffer, length, readPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Reads data from an opened sound to a specified buffer, using FMOD's internal codecs.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_readdata">Sound::readData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint ReadData(this Sound sound, nint buffer, uint length)
|
|
{
|
|
TryReadData(sound, buffer, length, out var read).Check();
|
|
return read;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Seeks a sound for use with data reading, using FMOD's internal codecs.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_seekdata">Sound::seekData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySeekData(this Sound sound, uint pcm) => PInvoke.SoundSeekData(sound, pcm);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Seeks a sound for use with data reading, using FMOD's internal codecs.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_seekdata">Sound::seekData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SeekData(this Sound sound, uint pcm) => TrySeekData(sound, pcm).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Moves the sound from its existing SoundGroup to the specified sound group.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setsoundgroup">Sound::setSoundGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetSoundGroup(this Sound sound, SoundGroup soundGroup) =>
|
|
PInvoke.SoundSetSoundGroup(sound, soundGroup);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Moves the sound from its existing SoundGroup to the specified sound group.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setsoundgroup">Sound::setSoundGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetSoundGroup(this Sound sound, SoundGroup soundGroup) =>
|
|
TrySetSoundGroup(sound, soundGroup).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the sound's current sound group.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsoundgroup">Sound::getSoundGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetSoundGroup(this Sound sound, out SoundGroup soundGroup)
|
|
{
|
|
fixed (SoundGroup* soundGroupPtr = &soundGroup)
|
|
return PInvoke.SoundGetSoundGroup(sound, soundGroupPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the sound's current sound group.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsoundgroup">Sound::getSoundGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static SoundGroup GetSoundGroup(this Sound sound)
|
|
{
|
|
TryGetSoundGroup(sound, out var soundGroup).Check();
|
|
return soundGroup;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of sync points stored within a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getnumsyncpoints">Sound::getNumSyncPoints</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetNumSyncPoints(this Sound sound, out int numSyncPoints)
|
|
{
|
|
fixed (int* numSyncPointsPtr = &numSyncPoints)
|
|
return PInvoke.SoundGetNumSyncPoints(sound, numSyncPointsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of sync points stored within a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getnumsyncpoints">Sound::getNumSyncPoints</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetNumSyncPoints(this Sound sound)
|
|
{
|
|
TryGetNumSyncPoints(sound, out var numSyncPoints).Check();
|
|
return numSyncPoints;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieve a sync point.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsyncpoint">Sound::getSyncPoint</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetSyncPoint(this Sound sound, int index, out SyncPoint point)
|
|
{
|
|
fixed (SyncPoint* pointPtr = &point)
|
|
return PInvoke.SoundGetSyncPoint(sound, index, pointPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieve a sync point.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsyncpoint">Sound::getSyncPoint</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static SyncPoint GetSyncPoint(this Sound sound, int index)
|
|
{
|
|
TryGetSyncPoint(sound, index, out var point).Check();
|
|
return point;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves information on an embedded sync point.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsyncpointinfo">Sound::getSyncPointInfo</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetSyncPointInfo(
|
|
this Sound sound,
|
|
SyncPoint point,
|
|
byte* name,
|
|
int nameLen,
|
|
out uint offset,
|
|
TimeUnit offsetType
|
|
)
|
|
{
|
|
fixed (uint* offsetPtr = &offset)
|
|
return PInvoke.SoundGetSyncPointInfo(sound, point, name, nameLen, offsetPtr, offsetType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves information on an embedded sync point.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getsyncpointinfo">Sound::getSyncPointInfo</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe uint GetSyncPointInfo(
|
|
this Sound sound,
|
|
SyncPoint point,
|
|
byte* name,
|
|
int nameLen,
|
|
TimeUnit offsetType
|
|
)
|
|
{
|
|
TryGetSyncPointInfo(sound, point, name, nameLen, out var offset, offsetType).Check();
|
|
return offset;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Adds a sync point at a specific time within the sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_addsyncpoint">Sound::addSyncPoint</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryAddSyncPoint(
|
|
this Sound sound,
|
|
uint offset,
|
|
TimeUnit offsetType,
|
|
RefString8 name,
|
|
out SyncPoint point
|
|
)
|
|
{
|
|
fixed (byte* namePtr = name)
|
|
fixed (SyncPoint* pointPtr = &point)
|
|
return PInvoke.SoundAddSyncPoint(sound, offset, offsetType, namePtr, pointPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Adds a sync point at a specific time within the sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_addsyncpoint">Sound::addSyncPoint</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static SyncPoint AddSyncPoint(this Sound sound, uint offset, TimeUnit offsetType, RefString8 name)
|
|
{
|
|
TryAddSyncPoint(sound, offset, offsetType, name, out var point).Check();
|
|
return point;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Deletes a sync point within the sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_deletesyncpoint">Sound::deleteSyncPoint</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryDeleteSyncPoint(this Sound sound, SyncPoint point) =>
|
|
PInvoke.SoundDeleteSyncPoint(sound, point);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Deletes a sync point within the sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_deletesyncpoint">Sound::deleteSyncPoint</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void DeleteSyncPoint(this Sound sound, SyncPoint point) =>
|
|
TryDeleteSyncPoint(sound, point).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets or alters the mode of a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setmode">Sound::setMode</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetMode(this Sound sound, Mode mode) => PInvoke.SoundSetMode(sound, mode);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets or alters the mode of a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setmode">Sound::setMode</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetMode(this Sound sound, Mode mode) => TrySetMode(sound, mode).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the mode of a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getmode">Sound::getMode</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetMode(this Sound sound, out Mode mode)
|
|
{
|
|
fixed (Mode* modePtr = &mode)
|
|
return PInvoke.SoundGetMode(sound, modePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the mode of a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getmode">Sound::getMode</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Mode GetMode(this Sound sound)
|
|
{
|
|
TryGetMode(sound, out var mode).Check();
|
|
return mode;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the sound to loop a specified number of times before stopping if the playback mode is set to
|
|
/// looping.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setloopcount">Sound::setLoopCount</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetLoopCount(this Sound sound, int loopCount) =>
|
|
PInvoke.SoundSetLoopCount(sound, loopCount);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the sound to loop a specified number of times before stopping if the playback mode is set to
|
|
/// looping.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setloopcount">Sound::setLoopCount</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetLoopCount(this Sound sound, int loopCount) => TrySetLoopCount(sound, loopCount).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the sound's loop count.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getloopcount">Sound::getLoopCount</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetLoopCount(this Sound sound, out int loopCount)
|
|
{
|
|
fixed (int* loopCountPtr = &loopCount)
|
|
return PInvoke.SoundGetLoopCount(sound, loopCountPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the sound's loop count.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getloopcount">Sound::getLoopCount</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetLoopCount(this Sound sound)
|
|
{
|
|
TryGetLoopCount(sound, out var loopCount).Check();
|
|
return loopCount;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the loop points within a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setlooppoints">Sound::setLoopPoints</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetLoopPoints(
|
|
this Sound sound,
|
|
uint loopStart,
|
|
TimeUnit loopStartType,
|
|
uint loopEnd,
|
|
TimeUnit loopEndType
|
|
) => PInvoke.SoundSetLoopPoints(sound, loopStart, loopStartType, loopEnd, loopEndType);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the loop points within a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setlooppoints">Sound::setLoopPoints</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetLoopPoints(
|
|
this Sound sound,
|
|
uint loopStart,
|
|
TimeUnit loopStartType,
|
|
uint loopEnd,
|
|
TimeUnit loopEndType
|
|
) => TrySetLoopPoints(sound, loopStart, loopStartType, loopEnd, loopEndType).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the loop points for a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getlooppoints">Sound::getLoopPoints</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetLoopPoints(
|
|
this Sound sound,
|
|
out uint loopStart,
|
|
TimeUnit loopStartType,
|
|
out uint loopEnd,
|
|
TimeUnit loopEndType
|
|
)
|
|
{
|
|
fixed (uint* loopStartPtr = &loopStart)
|
|
fixed (uint* loopEndPtr = &loopEnd)
|
|
return PInvoke.SoundGetLoopPoints(sound, loopStartPtr, loopStartType, loopEndPtr, loopEndType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the loop points for a sound.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getlooppoints">Sound::getLoopPoints</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetLoopPoints(
|
|
this Sound sound,
|
|
out uint loopStart,
|
|
TimeUnit loopStartType,
|
|
out uint loopEnd,
|
|
TimeUnit loopEndType
|
|
) => TryGetLoopPoints(sound, out loopStart, loopStartType, out loopEnd, loopEndType).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Gets the number of music channels inside a MOD/S3M/XM/IT/MIDI file.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getmusicnumchannels">Sound::getMusicNumChannels</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetMusicNumChannels(this Sound sound, out int numChannels)
|
|
{
|
|
fixed (int* numChannelsPtr = &numChannels)
|
|
return PInvoke.SoundGetMusicNumChannels(sound, numChannelsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Gets the number of music channels inside a MOD/S3M/XM/IT/MIDI file.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getmusicnumchannels">Sound::getMusicNumChannels</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetMusicNumChannels(this Sound sound)
|
|
{
|
|
TryGetMusicNumChannels(sound, out var numChannels).Check();
|
|
return numChannels;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the volume of a MOD/S3M/XM/IT/MIDI music channel volume.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setmusicchannelvolume">Sound::setMusicChannelVolume</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetMusicChannelVolume(this Sound sound, int channel, float volume) =>
|
|
PInvoke.SoundSetMusicChannelVolume(sound, channel, volume);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the volume of a MOD/S3M/XM/IT/MIDI music channel volume.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setmusicchannelvolume">Sound::setMusicChannelVolume</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetMusicChannelVolume(this Sound sound, int channel, float volume) =>
|
|
TrySetMusicChannelVolume(sound, channel, volume).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the volume of a MOD/S3M/XM/IT/MIDI music channel volume.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getmusicchannelvolume">Sound::getMusicChannelVolume</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetMusicChannelVolume(this Sound sound, int channel, out float volume)
|
|
{
|
|
fixed (float* volumePtr = &volume)
|
|
return PInvoke.SoundGetMusicChannelVolume(sound, channel, volumePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the volume of a MOD/S3M/XM/IT/MIDI music channel volume.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getmusicchannelvolume">Sound::getMusicChannelVolume</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static float GetMusicChannelVolume(this Sound sound, int channel)
|
|
{
|
|
TryGetMusicChannelVolume(sound, channel, out var volume).Check();
|
|
return volume;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the relative speed of MOD/S3M/XM/IT/MIDI music.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setmusicspeed">Sound::setMusicSpeed</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetMusicSpeed(this Sound sound, float speed) =>
|
|
PInvoke.SoundSetMusicSpeed(sound, speed);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the relative speed of MOD/S3M/XM/IT/MIDI music.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setmusicspeed">Sound::setMusicSpeed</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetMusicSpeed(this Sound sound, float speed) => TrySetMusicSpeed(sound, speed).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Gets the relative speed of MOD/S3M/XM/IT/MIDI music.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getmusicspeed">Sound::getMusicSpeed</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetMusicSpeed(this Sound sound, out float speed)
|
|
{
|
|
fixed (float* speedPtr = &speed)
|
|
return PInvoke.SoundGetMusicSpeed(sound, speedPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Gets the relative speed of MOD/S3M/XM/IT/MIDI music.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getmusicspeed">Sound::getMusicSpeed</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static float GetMusicSpeed(this Sound sound)
|
|
{
|
|
TryGetMusicSpeed(sound, out var speed).Check();
|
|
return speed;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets a user value associated with this object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setuserdata">Sound::setUserData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetUserData(this Sound sound, nint userData) =>
|
|
PInvoke.SoundSetUserData(sound, userData);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets a user value associated with this object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_setuserdata">Sound::setUserData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetUserData(this Sound sound, nint userData) => TrySetUserData(sound, userData).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a user value associated with this object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getuserdata">Sound::getUserData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetUserData(this Sound sound, out nint userData)
|
|
{
|
|
fixed (nint* userDataPtr = &userData)
|
|
return PInvoke.SoundGetUserData(sound, userDataPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a user value associated with this object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-sound.html#sound_getuserdata">Sound::getUserData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static nint GetUserData(this Sound sound)
|
|
{
|
|
TryGetUserData(sound, out var userData).Check();
|
|
return userData;
|
|
}
|
|
}
|
|
}
|