mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
2959 lines
121 KiB
C#
2959 lines
121 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>
|
|
/// Closes and frees this object and its resources.
|
|
/// </para>
|
|
/// <para>
|
|
/// This will internally call System::close, so calling System::close before this function is not necessary.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::init
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_release">System::release</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryRelease(this FmodSystem system) => PInvoke.SystemRelease(system);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Closes and frees this object and its resources.
|
|
/// </para>
|
|
/// <para>
|
|
/// This will internally call System::close, so calling System::close before this function is not necessary.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::init
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_release">System::release</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Release(this FmodSystem system) => TryRelease(system).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the type of output interface used to run the mixer.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setoutput">System::setOutput</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetOutput(this FmodSystem system, OutputType output) =>
|
|
PInvoke.SystemSetOutput(system, output);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the type of output interface used to run the mixer.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setoutput">System::setOutput</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetOutput(this FmodSystem system, OutputType output) => TrySetOutput(system, output).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the type of output interface used to run the mixer.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getoutput">System::getOutput</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetOutput(this FmodSystem system, out OutputType output)
|
|
{
|
|
fixed (OutputType* outputPtr = &output)
|
|
return PInvoke.SystemGetOutput(system, outputPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the type of output interface used to run the mixer.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getoutput">System::getOutput</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static OutputType GetOutput(this FmodSystem system)
|
|
{
|
|
TryGetOutput(system, out var output).Check();
|
|
return output;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of output drivers available for the selected output type.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnumdrivers">System::getNumDrivers</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetNumDrivers(this FmodSystem system, out int numDrivers)
|
|
{
|
|
fixed (int* numDriversPtr = &numDrivers)
|
|
return PInvoke.SystemGetNumDrivers(system, numDriversPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of output drivers available for the selected output type.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnumdrivers">System::getNumDrivers</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetNumDrivers(this FmodSystem system)
|
|
{
|
|
TryGetNumDrivers(system, out var numDrivers).Check();
|
|
return numDrivers;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves identification information about a sound device specified by its index, and specific to the
|
|
/// selected output mode.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdriverinfo">System::getDriverInfo</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetDriverInfo(
|
|
this FmodSystem system,
|
|
int id,
|
|
byte* name,
|
|
int nameLen,
|
|
out Guid guid,
|
|
out int systemRate,
|
|
out SpeakerMode speakerMode,
|
|
out int speakerModeChannels
|
|
)
|
|
{
|
|
fixed (Guid* guidPtr = &guid)
|
|
fixed (int* systemRatePtr = &systemRate)
|
|
fixed (SpeakerMode* speakerModePtr = &speakerMode)
|
|
fixed (int* speakerModeChannelsPtr = &speakerModeChannels)
|
|
return PInvoke.SystemGetDriverInfo(
|
|
system,
|
|
id,
|
|
name,
|
|
nameLen,
|
|
guidPtr,
|
|
systemRatePtr,
|
|
speakerModePtr,
|
|
speakerModeChannelsPtr
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves identification information about a sound device specified by its index, and specific to the
|
|
/// selected output mode.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdriverinfo">System::getDriverInfo</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void GetDriverInfo(
|
|
this FmodSystem system,
|
|
int id,
|
|
byte* name,
|
|
int nameLen,
|
|
out Guid guid,
|
|
out int systemRate,
|
|
out SpeakerMode speakerMode,
|
|
out int speakerModeChannels
|
|
) =>
|
|
TryGetDriverInfo(
|
|
system,
|
|
id,
|
|
name,
|
|
nameLen,
|
|
out guid,
|
|
out systemRate,
|
|
out speakerMode,
|
|
out speakerModeChannels
|
|
)
|
|
.Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the output driver for the selected output type.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setdriver">System::setDriver</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetDriver(this FmodSystem system, int driver) =>
|
|
PInvoke.SystemSetDriver(system, driver);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the output driver for the selected output type.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setdriver">System::setDriver</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetDriver(this FmodSystem system, int driver) => TrySetDriver(system, driver).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the output driver for the selected output type.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdriver">System::getDriver</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetDriver(this FmodSystem system, out int driver)
|
|
{
|
|
fixed (int* driverPtr = &driver)
|
|
return PInvoke.SystemGetDriver(system, driverPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the output driver for the selected output type.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdriver">System::getDriver</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetDriver(this FmodSystem system)
|
|
{
|
|
TryGetDriver(system, out var driver).Check();
|
|
return driver;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the maximum number of software mixed Channels possible.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setsoftwarechannels">System::setSoftwareChannels</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetSoftwareChannels(this FmodSystem system, int numSoftwareChannels) =>
|
|
PInvoke.SystemSetSoftwareChannels(system, numSoftwareChannels);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the maximum number of software mixed Channels possible.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setsoftwarechannels">System::setSoftwareChannels</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetSoftwareChannels(this FmodSystem system, int numSoftwareChannels) =>
|
|
TrySetSoftwareChannels(system, numSoftwareChannels).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the maximum number of software mixed Channels possible.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getsoftwarechannels">System::getSoftwareChannels</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetSoftwareChannels(this FmodSystem system, out int numSoftwareChannels)
|
|
{
|
|
fixed (int* numSoftwareChannelsPtr = &numSoftwareChannels)
|
|
return PInvoke.SystemGetSoftwareChannels(system, numSoftwareChannelsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the maximum number of software mixed Channels possible.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getsoftwarechannels">System::getSoftwareChannels</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetSoftwareChannels(this FmodSystem system)
|
|
{
|
|
TryGetSoftwareChannels(system, out var numSoftwareChannels).Check();
|
|
return numSoftwareChannels;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the output format for the software mixer.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setsoftwareformat">System::setSoftwareFormat</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetSoftwareFormat(
|
|
this FmodSystem system,
|
|
int sampleRate,
|
|
SpeakerMode speakerMode,
|
|
int numRawSpeakers
|
|
) => PInvoke.SystemSetSoftwareFormat(system, sampleRate, speakerMode, numRawSpeakers);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the output format for the software mixer.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setsoftwareformat">System::setSoftwareFormat</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetSoftwareFormat(
|
|
this FmodSystem system,
|
|
int sampleRate,
|
|
SpeakerMode speakerMode,
|
|
int numRawSpeakers
|
|
) => TrySetSoftwareFormat(system, sampleRate, speakerMode, numRawSpeakers).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the output format for the software mixer.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getsoftwareformat">System::getSoftwareFormat</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetSoftwareFormat(
|
|
this FmodSystem system,
|
|
out int sampleRate,
|
|
out SpeakerMode speakerMode,
|
|
out int numRawSpeakers
|
|
)
|
|
{
|
|
fixed (int* sampleRatePtr = &sampleRate)
|
|
fixed (SpeakerMode* speakerModePtr = &speakerMode)
|
|
fixed (int* numRawSpeakersPtr = &numRawSpeakers)
|
|
return PInvoke.SystemGetSoftwareFormat(system, sampleRatePtr, speakerModePtr, numRawSpeakersPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the output format for the software mixer.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getsoftwareformat">System::getSoftwareFormat</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetSoftwareFormat(
|
|
this FmodSystem system,
|
|
out int sampleRate,
|
|
out SpeakerMode speakerMode,
|
|
out int numRawSpeakers
|
|
) => TryGetSoftwareFormat(system, out sampleRate, out speakerMode, out numRawSpeakers).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the buffer size for the FMOD software mixing engine.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function is used if you need to control mixer latency or granularity. Smaller buffersizes lead to
|
|
/// smaller latency, but can lead to stuttering/skipping/unstable sound on slower machines or soundcards
|
|
/// with bad drivers.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setdspbuffersize">System::setDSPBufferSize</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetDspBufferSize(this FmodSystem system, uint bufferLength, int numBuffers) =>
|
|
PInvoke.SystemSetDspBufferSize(system, bufferLength, numBuffers);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the buffer size for the FMOD software mixing engine.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function is used if you need to control mixer latency or granularity. Smaller buffersizes lead to
|
|
/// smaller latency, but can lead to stuttering/skipping/unstable sound on slower machines or soundcards
|
|
/// with bad drivers.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setdspbuffersize">System::setDSPBufferSize</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetDspBufferSize(this FmodSystem system, uint bufferLength, int numBuffers) =>
|
|
TrySetDspBufferSize(system, bufferLength, numBuffers).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the buffer size settings for the FMOD software mixing engine.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdspbuffersize">System::getDSPBufferSize</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetDspBufferSize(
|
|
this FmodSystem system,
|
|
out uint bufferLength,
|
|
out int numBuffers
|
|
)
|
|
{
|
|
fixed (uint* bufferLengthPtr = &bufferLength)
|
|
fixed (int* numBuffersPtr = &numBuffers)
|
|
return PInvoke.SystemGetDspBufferSize(system, bufferLengthPtr, numBuffersPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the buffer size settings for the FMOD software mixing engine.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdspbuffersize">System::getDSPBufferSize</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetDspBufferSize(this FmodSystem system, out uint bufferLength, out int numBuffers) =>
|
|
TryGetDspBufferSize(system, out bufferLength, out numBuffers).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Set callbacks to implement all file I/O instead of using the platform native method.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setfilesystem">System::setFileSystem</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetFileSystem(
|
|
this FmodSystem system,
|
|
FileOpenCallbackPtr userOpen,
|
|
FileCloseCallbackPtr userClose,
|
|
FileReadCallbackPtr userRead,
|
|
FileSeekCallbackPtr userSeek,
|
|
FileAsyncReadCallbackPtr userAsyncRead,
|
|
FileAsyncCancelCallbackPtr userAsyncCancel,
|
|
int blockAlign
|
|
) =>
|
|
PInvoke.SystemSetFileSystem(
|
|
system,
|
|
userOpen,
|
|
userClose,
|
|
userRead,
|
|
userSeek,
|
|
userAsyncRead,
|
|
userAsyncCancel,
|
|
blockAlign
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Set callbacks to implement all file I/O instead of using the platform native method.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setfilesystem">System::setFileSystem</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetFileSystem(
|
|
this FmodSystem system,
|
|
FileOpenCallbackPtr userOpen,
|
|
FileCloseCallbackPtr userClose,
|
|
FileReadCallbackPtr userRead,
|
|
FileSeekCallbackPtr userSeek,
|
|
FileAsyncReadCallbackPtr userAsyncRead,
|
|
FileAsyncCancelCallbackPtr userAsyncCancel,
|
|
int blockAlign
|
|
) =>
|
|
TrySetFileSystem(
|
|
system,
|
|
userOpen,
|
|
userClose,
|
|
userRead,
|
|
userSeek,
|
|
userAsyncRead,
|
|
userAsyncCancel,
|
|
blockAlign
|
|
)
|
|
.Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// 'Piggyback' on FMOD file reading routines to capture data as it's read.
|
|
/// </para>
|
|
/// <para>
|
|
/// This allows users to capture data as FMOD reads it, which may be useful for extracting the raw data that
|
|
/// FMOD reads for hard to support sources (for example internet streams).
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_attachfilesystem">System::attachFileSystem</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryAttachFileSystem(
|
|
this FmodSystem system,
|
|
FileOpenCallbackPtr userOpen,
|
|
FileCloseCallbackPtr userClose,
|
|
FileReadCallbackPtr userRead,
|
|
FileSeekCallbackPtr userSeek
|
|
) => PInvoke.SystemAttachFileSystem(system, userOpen, userClose, userRead, userSeek);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// 'Piggyback' on FMOD file reading routines to capture data as it's read.
|
|
/// </para>
|
|
/// <para>
|
|
/// This allows users to capture data as FMOD reads it, which may be useful for extracting the raw data that
|
|
/// FMOD reads for hard to support sources (for example internet streams).
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_attachfilesystem">System::attachFileSystem</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void AttachFileSystem(
|
|
this FmodSystem system,
|
|
FileOpenCallbackPtr userOpen,
|
|
FileCloseCallbackPtr userClose,
|
|
FileReadCallbackPtr userRead,
|
|
FileSeekCallbackPtr userSeek
|
|
) => TryAttachFileSystem(system, userOpen, userClose, userRead, userSeek).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets advanced settings for the system object, typically to allow adjusting of settings related to
|
|
/// resource usage or audio quality.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setadvancedsettings">System::setAdvancedSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TrySetAdvancedSettings(this FmodSystem system, in AdvancedSettings settings)
|
|
{
|
|
fixed (AdvancedSettings* settingsPtr = &settings)
|
|
return PInvoke.SystemSetAdvancedSettings(system, settingsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets advanced settings for the system object, typically to allow adjusting of settings related to
|
|
/// resource usage or audio quality.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setadvancedsettings">System::setAdvancedSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetAdvancedSettings(this FmodSystem system, in AdvancedSettings settings) =>
|
|
TrySetAdvancedSettings(system, settings).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the advanced settings for the system object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getadvancedsettings">System::getAdvancedSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetAdvancedSettings(this FmodSystem system, out AdvancedSettings settings)
|
|
{
|
|
fixed (AdvancedSettings* settingsPtr = &settings)
|
|
return PInvoke.SystemGetAdvancedSettings(system, settingsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the advanced settings for the system object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getadvancedsettings">System::getAdvancedSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static AdvancedSettings GetAdvancedSettings(this FmodSystem system)
|
|
{
|
|
TryGetAdvancedSettings(system, out var settings).Check();
|
|
return settings;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the callback for System level notifications.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setcallback">System::setCallback</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetCallback(
|
|
this FmodSystem system,
|
|
SystemCallbackPtr callback,
|
|
SystemCallbackType callbackMask
|
|
) => PInvoke.SystemSetCallback(system, callback, callbackMask);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the callback for System level notifications.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setcallback">System::setCallback</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetCallback(
|
|
this FmodSystem system,
|
|
SystemCallbackPtr callback,
|
|
SystemCallbackType callbackMask
|
|
) => TrySetCallback(system, callback, callbackMask).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Specify a base search path for plug-ins so they can be placed somewhere else than the directory of the
|
|
/// main executable.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setpluginpath">System::setPluginPath</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TrySetPluginPath(this FmodSystem system, RefString8 path)
|
|
{
|
|
fixed (byte* pathPtr = path)
|
|
return PInvoke.SystemSetPluginPath(system, pathPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Specify a base search path for plug-ins so they can be placed somewhere else than the directory of the
|
|
/// main executable.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setpluginpath">System::setPluginPath</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetPluginPath(this FmodSystem system, RefString8 path) =>
|
|
TrySetPluginPath(system, path).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Loads an FMOD plug-in (DSP, output or codec) from a file.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_loadplugin">System::loadPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryLoadPlugin(
|
|
this FmodSystem system,
|
|
RefString8 fileName,
|
|
out uint handle,
|
|
uint priority
|
|
)
|
|
{
|
|
fixed (byte* fileNamePtr = fileName)
|
|
fixed (uint* handlePtr = &handle)
|
|
return PInvoke.SystemLoadPlugin(system, fileNamePtr, handlePtr, priority);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Loads an FMOD plug-in (DSP, output or codec) from a file.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_loadplugin">System::loadPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint LoadPlugin(this FmodSystem system, RefString8 fileName, uint priority)
|
|
{
|
|
TryLoadPlugin(system, fileName, out var handle, priority).Check();
|
|
return handle;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Unloads an FMOD (DSP, Output or Codec) plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_unloadplugin">System::unloadPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryUnloadPlugin(this FmodSystem system, uint handle) =>
|
|
PInvoke.SystemUnloadPlugin(system, handle);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Unloads an FMOD (DSP, Output or Codec) plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_unloadplugin">System::unloadPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void UnloadPlugin(this FmodSystem system, uint handle) => TryUnloadPlugin(system, handle).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of nested plug-ins from the selected plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnumnestedplugins">System::getNumNestedPlugins</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetNumNestedPlugins(this FmodSystem system, uint handle, out int count)
|
|
{
|
|
fixed (int* countPtr = &count)
|
|
return PInvoke.SystemGetNumNestedPlugins(system, handle, countPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of nested plug-ins from the selected plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnumnestedplugins">System::getNumNestedPlugins</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetNumNestedPlugins(this FmodSystem system, uint handle)
|
|
{
|
|
TryGetNumNestedPlugins(system, handle, out var count).Check();
|
|
return count;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the handle of a nested plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnestedplugin">System::getNestedPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetNestedPlugin(
|
|
this FmodSystem system,
|
|
uint handle,
|
|
int index,
|
|
out uint nestedHandle
|
|
)
|
|
{
|
|
fixed (uint* nestedHandlePtr = &nestedHandle)
|
|
return PInvoke.SystemGetNestedPlugin(system, handle, index, nestedHandlePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the handle of a nested plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnestedplugin">System::getNestedPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint GetNestedPlugin(this FmodSystem system, uint handle, int index)
|
|
{
|
|
TryGetNestedPlugin(system, handle, index, out var nestedHandle).Check();
|
|
return nestedHandle;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of loaded plug-ins.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnumplugins">System::getNumPlugins</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetNumPlugins(this FmodSystem system, PluginType pluginType, out int numPlugins)
|
|
{
|
|
fixed (int* numPluginsPtr = &numPlugins)
|
|
return PInvoke.SystemGetNumPlugins(system, pluginType, numPluginsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of loaded plug-ins.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnumplugins">System::getNumPlugins</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetNumPlugins(this FmodSystem system, PluginType pluginType)
|
|
{
|
|
TryGetNumPlugins(system, pluginType, out var numPlugins).Check();
|
|
return numPlugins;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the handle of a plug-in based on its type and relative index.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getpluginhandle">System::getPluginHandle</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetPluginHandle(
|
|
this FmodSystem system,
|
|
PluginType pluginType,
|
|
int index,
|
|
out uint handle
|
|
)
|
|
{
|
|
fixed (uint* handlePtr = &handle)
|
|
return PInvoke.SystemGetPluginHandle(system, pluginType, index, handlePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the handle of a plug-in based on its type and relative index.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getpluginhandle">System::getPluginHandle</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint GetPluginHandle(this FmodSystem system, PluginType pluginType, int index)
|
|
{
|
|
TryGetPluginHandle(system, pluginType, index, out var handle).Check();
|
|
return handle;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves information for the selected plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getplugininfo">System::getPluginInfo</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetPluginInfo(
|
|
this FmodSystem system,
|
|
uint handle,
|
|
out PluginType pluginType,
|
|
byte* name,
|
|
int nameLen,
|
|
out uint version
|
|
)
|
|
{
|
|
fixed (PluginType* pluginTypePtr = &pluginType)
|
|
fixed (uint* versionPtr = &version)
|
|
return PInvoke.SystemGetPluginInfo(system, handle, pluginTypePtr, name, nameLen, versionPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves information for the selected plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getplugininfo">System::getPluginInfo</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void GetPluginInfo(
|
|
this FmodSystem system,
|
|
uint handle,
|
|
out PluginType pluginType,
|
|
byte* name,
|
|
int nameLen,
|
|
out uint version
|
|
) => TryGetPluginInfo(system, handle, out pluginType, name, nameLen, out version).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Selects an output type given a plug-in handle.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setoutputbyplugin">System::setOutputByPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetOutputByPlugin(this FmodSystem system, uint handle) =>
|
|
PInvoke.SystemSetOutputByPlugin(system, handle);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Selects an output type given a plug-in handle.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setoutputbyplugin">System::setOutputByPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetOutputByPlugin(this FmodSystem system, uint handle) =>
|
|
TrySetOutputByPlugin(system, handle).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the plug-in handle for the currently selected output type.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getoutputbyplugin">System::getOutputByPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetOutputByPlugin(this FmodSystem system, out uint handle)
|
|
{
|
|
fixed (uint* handlePtr = &handle)
|
|
return PInvoke.SystemGetOutputByPlugin(system, handlePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the plug-in handle for the currently selected output type.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getoutputbyplugin">System::getOutputByPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint GetOutputByPlugin(this FmodSystem system)
|
|
{
|
|
TryGetOutputByPlugin(system, out var handle).Check();
|
|
return handle;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Create a DSP unit with a specified plug-in handle.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createdspbyplugin">System::createDSPByPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryCreateDspByPlugin(this FmodSystem system, uint handle, out Dsp dsp)
|
|
{
|
|
fixed (Dsp* dspPtr = &dsp)
|
|
return PInvoke.SystemCreateDspByPlugin(system, handle, dspPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Create a DSP unit with a specified plug-in handle.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createdspbyplugin">System::createDSPByPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Dsp CreateDspByPlugin(this FmodSystem system, uint handle)
|
|
{
|
|
TryCreateDspByPlugin(system, handle, out var dsp).Check();
|
|
return dsp;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieve the description structure for a pre-existing DSP plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdspinfobyplugin">System::getDSPInfoByPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetDspInfoByPlugin(
|
|
this FmodSystem system,
|
|
uint handle,
|
|
out DspDescription* description
|
|
)
|
|
{
|
|
fixed (DspDescription** descriptionPtr = &description)
|
|
return PInvoke.SystemGetDspInfoByPlugin(system, handle, descriptionPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieve the description structure for a pre-existing DSP plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdspinfobyplugin">System::getDSPInfoByPlugin</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe DspDescription* GetDspInfoByPlugin(this FmodSystem system, uint handle)
|
|
{
|
|
TryGetDspInfoByPlugin(system, handle, out var description).Check();
|
|
return description;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Register a Codec plug-in description structure for later use.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_registercodec">System::registerCodec</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryRegisterCodec(
|
|
this FmodSystem system,
|
|
out CodecDescription description,
|
|
out uint handle,
|
|
uint priority
|
|
)
|
|
{
|
|
fixed (CodecDescription* descriptionPtr = &description)
|
|
fixed (uint* handlePtr = &handle)
|
|
return PInvoke.SystemRegisterCodec(system, descriptionPtr, handlePtr, priority);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Register a Codec plug-in description structure for later use.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_registercodec">System::registerCodec</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void RegisterCodec(
|
|
this FmodSystem system,
|
|
out CodecDescription description,
|
|
out uint handle,
|
|
uint priority
|
|
) => TryRegisterCodec(system, out description, out handle, priority).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Register a DSP plug-in description structure for later use.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_registerdsp">System::registerDSP</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryRegisterDsp(
|
|
this FmodSystem system,
|
|
in DspDescription description,
|
|
out uint handle
|
|
)
|
|
{
|
|
fixed (DspDescription* descriptionPtr = &description)
|
|
fixed (uint* handlePtr = &handle)
|
|
return PInvoke.SystemRegisterDsp(system, descriptionPtr, handlePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Register a DSP plug-in description structure for later use.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_registerdsp">System::registerDSP</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint RegisterDsp(this FmodSystem system, in DspDescription description)
|
|
{
|
|
TryRegisterDsp(system, description, out var handle).Check();
|
|
return handle;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Register an Output plug-in description structure for later use.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_registeroutput">System::registerOutput</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryRegisterOutput(
|
|
this FmodSystem system,
|
|
in OutputDescription description,
|
|
out uint handle
|
|
)
|
|
{
|
|
fixed (OutputDescription* descriptionPtr = &description)
|
|
fixed (uint* handlePtr = &handle)
|
|
return PInvoke.SystemRegisterOutput(system, descriptionPtr, handlePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Register an Output plug-in description structure for later use.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_registeroutput">System::registerOutput</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint RegisterOutput(this FmodSystem system, in OutputDescription description)
|
|
{
|
|
TryRegisterOutput(system, description, out var handle).Check();
|
|
return handle;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Initialize the system object and prepare FMOD for playback.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_init">System::init</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryInit(this FmodSystem system, int maxChannels, InitFlags flags, nint extraDriverData) =>
|
|
PInvoke.SystemInit(system, maxChannels, flags, extraDriverData);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Initialize the system object and prepare FMOD for playback.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_init">System::init</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Init(this FmodSystem system, int maxChannels, InitFlags flags, nint extraDriverData) =>
|
|
TryInit(system, maxChannels, flags, extraDriverData).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Close the connection to the output and return to an uninitialized state without releasing the object.
|
|
/// </para>
|
|
/// <para>
|
|
/// Closing renders objects created with this System invalid. Make sure any Sound, ChannelGroup, Geometry
|
|
/// and DSP objects are released before calling this.
|
|
/// </para>
|
|
/// <para>
|
|
/// All pre-initialize configuration settings will remain and the System can be reinitialized as needed.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::init, System::release
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_close">System::close</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryClose(this FmodSystem system) => PInvoke.SystemClose(system);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Close the connection to the output and return to an uninitialized state without releasing the object.
|
|
/// </para>
|
|
/// <para>
|
|
/// Closing renders objects created with this System invalid. Make sure any Sound, ChannelGroup, Geometry
|
|
/// and DSP objects are released before calling this.
|
|
/// </para>
|
|
/// <para>
|
|
/// All pre-initialize configuration settings will remain and the System can be reinitialized as needed.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::init, System::release
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_close">System::close</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Close(this FmodSystem system) => TryClose(system).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Updates the FMOD system.
|
|
/// </para>
|
|
/// <para>
|
|
/// Should be called once per 'game' tick, or once per frame in your application to perform actions such as:
|
|
/// </para>
|
|
/// <para>
|
|
/// If FMOD_OUTPUTTYPE_NOSOUND_NRT or FMOD_OUTPUTTYPE_WAVWRITER_NRT output modes are used, this function
|
|
/// also drives the software / DSP engine, instead of it running asynchronously in a thread as is the
|
|
/// default behavior.This can be used for faster than realtime updates to the decoding or DSP engine which
|
|
/// might be useful if the output is the wav writer for example.
|
|
/// </para>
|
|
/// <para>
|
|
/// If FMOD_INIT_STREAM_FROM_UPDATE is used, this function will update the stream engine. Combining this
|
|
/// with the non realtime output will mean smoother captured output.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::init, FMOD_INITFLAGS, FMOD_OUTPUTTYPE, FMOD_MODE
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_update">System::update</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryUpdate(this FmodSystem system) => PInvoke.SystemUpdate(system);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Updates the FMOD system.
|
|
/// </para>
|
|
/// <para>
|
|
/// Should be called once per 'game' tick, or once per frame in your application to perform actions such as:
|
|
/// </para>
|
|
/// <para>
|
|
/// If FMOD_OUTPUTTYPE_NOSOUND_NRT or FMOD_OUTPUTTYPE_WAVWRITER_NRT output modes are used, this function
|
|
/// also drives the software / DSP engine, instead of it running asynchronously in a thread as is the
|
|
/// default behavior.This can be used for faster than realtime updates to the decoding or DSP engine which
|
|
/// might be useful if the output is the wav writer for example.
|
|
/// </para>
|
|
/// <para>
|
|
/// If FMOD_INIT_STREAM_FROM_UPDATE is used, this function will update the stream engine. Combining this
|
|
/// with the non realtime output will mean smoother captured output.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::init, FMOD_INITFLAGS, FMOD_OUTPUTTYPE, FMOD_MODE
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_update">System::update</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Update(this FmodSystem system) => TryUpdate(system).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the position of the specified speaker for the current speaker mode.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function allows the user to specify the position of their speaker to account for non standard
|
|
/// setups.It also allows the user to disable speakers from 3D consideration in a game.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setspeakerposition">System::setSpeakerPosition</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetSpeakerPosition(
|
|
this FmodSystem system,
|
|
Speaker speaker,
|
|
float x,
|
|
float y,
|
|
Bool32 active
|
|
) => PInvoke.SystemSetSpeakerPosition(system, speaker, x, y, active);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the position of the specified speaker for the current speaker mode.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function allows the user to specify the position of their speaker to account for non standard
|
|
/// setups.It also allows the user to disable speakers from 3D consideration in a game.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setspeakerposition">System::setSpeakerPosition</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetSpeakerPosition(
|
|
this FmodSystem system,
|
|
Speaker speaker,
|
|
float x,
|
|
float y,
|
|
Bool32 active
|
|
) => TrySetSpeakerPosition(system, speaker, x, y, active).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the position of the specified speaker for the current speaker mode.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getspeakerposition">System::getSpeakerPosition</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetSpeakerPosition(
|
|
this FmodSystem system,
|
|
Speaker speaker,
|
|
out float x,
|
|
out float y,
|
|
out Bool32 active
|
|
)
|
|
{
|
|
fixed (float* xPtr = &x)
|
|
fixed (float* yPtr = &y)
|
|
fixed (Bool32* activePtr = &active)
|
|
return PInvoke.SystemGetSpeakerPosition(system, speaker, xPtr, yPtr, activePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the position of the specified speaker for the current speaker mode.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getspeakerposition">System::getSpeakerPosition</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetSpeakerPosition(
|
|
this FmodSystem system,
|
|
Speaker speaker,
|
|
out float x,
|
|
out float y,
|
|
out Bool32 active
|
|
) => TryGetSpeakerPosition(system, speaker, out x, out y, out active).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the default file buffer size for newly opened streams.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setstreambuffersize">System::setStreamBufferSize</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetStreamBufferSize(
|
|
this FmodSystem system,
|
|
uint fileBufferSize,
|
|
TimeUnit fileBufferSizeType
|
|
) => PInvoke.SystemSetStreamBufferSize(system, fileBufferSize, fileBufferSizeType);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the default file buffer size for newly opened streams.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setstreambuffersize">System::setStreamBufferSize</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetStreamBufferSize(
|
|
this FmodSystem system,
|
|
uint fileBufferSize,
|
|
TimeUnit fileBufferSizeType
|
|
) => TrySetStreamBufferSize(system, fileBufferSize, fileBufferSizeType).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the default file buffer size for newly opened streams.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getstreambuffersize">System::getStreamBufferSize</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetStreamBufferSize(
|
|
this FmodSystem system,
|
|
out uint fileBufferSize,
|
|
out TimeUnit fileBufferSizeType
|
|
)
|
|
{
|
|
fixed (uint* fileBufferSizePtr = &fileBufferSize)
|
|
fixed (TimeUnit* fileBufferSizeTypePtr = &fileBufferSizeType)
|
|
return PInvoke.SystemGetStreamBufferSize(system, fileBufferSizePtr, fileBufferSizeTypePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the default file buffer size for newly opened streams.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getstreambuffersize">System::getStreamBufferSize</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetStreamBufferSize(
|
|
this FmodSystem system,
|
|
out uint fileBufferSize,
|
|
out TimeUnit fileBufferSizeType
|
|
) => TryGetStreamBufferSize(system, out fileBufferSize, out fileBufferSizeType).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the global doppler scale, distance factor and log roll-off scale for all 3D sound in FMOD.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_set3dsettings">System::set3DSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySet3dSettings(
|
|
this FmodSystem system,
|
|
float dopplerScale,
|
|
float distanceFactor,
|
|
float rolloffScale
|
|
) => PInvoke.SystemSet3dSettings(system, dopplerScale, distanceFactor, rolloffScale);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the global doppler scale, distance factor and log roll-off scale for all 3D sound in FMOD.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_set3dsettings">System::set3DSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Set3dSettings(
|
|
this FmodSystem system,
|
|
float dopplerScale,
|
|
float distanceFactor,
|
|
float rolloffScale
|
|
) => TrySet3dSettings(system, dopplerScale, distanceFactor, rolloffScale).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the global doppler scale, distance factor and roll-off scale for all 3D sounds.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_get3dsettings">System::get3DSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGet3dSettings(
|
|
this FmodSystem system,
|
|
out float dopplerScale,
|
|
out float distanceFactor,
|
|
out float rolloffScale
|
|
)
|
|
{
|
|
fixed (float* dopplerScalePtr = &dopplerScale)
|
|
fixed (float* distanceFactorPtr = &distanceFactor)
|
|
fixed (float* rolloffScalePtr = &rolloffScale)
|
|
return PInvoke.SystemGet3dSettings(system, dopplerScalePtr, distanceFactorPtr, rolloffScalePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the global doppler scale, distance factor and roll-off scale for all 3D sounds.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_get3dsettings">System::get3DSettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Get3dSettings(
|
|
this FmodSystem system,
|
|
out float dopplerScale,
|
|
out float distanceFactor,
|
|
out float rolloffScale
|
|
) => TryGet3dSettings(system, out dopplerScale, out distanceFactor, out rolloffScale).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the number of 3D 'listeners' in the 3D sound scene.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_set3dnumlisteners">System::set3DNumListeners</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySet3dNumListeners(this FmodSystem system, int numListeners) =>
|
|
PInvoke.SystemSet3dNumListeners(system, numListeners);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the number of 3D 'listeners' in the 3D sound scene.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_set3dnumlisteners">System::set3DNumListeners</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Set3dNumListeners(this FmodSystem system, int numListeners) =>
|
|
TrySet3dNumListeners(system, numListeners).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of 3D listeners.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_get3dnumlisteners">System::get3DNumListeners</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGet3dNumListeners(this FmodSystem system, out int numListeners)
|
|
{
|
|
fixed (int* numListenersPtr = &numListeners)
|
|
return PInvoke.SystemGet3dNumListeners(system, numListenersPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of 3D listeners.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_get3dnumlisteners">System::get3DNumListeners</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int Get3dNumListeners(this FmodSystem system)
|
|
{
|
|
TryGet3dNumListeners(system, out var numListeners).Check();
|
|
return numListeners;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the position, velocity and orientation of the specified 3D sound listener.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_set3dlistenerattributes">System::set3DListenerAttributes</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TrySet3dListenerAttributes(
|
|
this FmodSystem system,
|
|
int listener,
|
|
in float3 pos,
|
|
in float3 vel,
|
|
in float3 forward,
|
|
in float3 up
|
|
)
|
|
{
|
|
fixed (float3* posPtr = &pos)
|
|
fixed (float3* velPtr = &vel)
|
|
fixed (float3* forwardPtr = &forward)
|
|
fixed (float3* upPtr = &up)
|
|
return PInvoke.SystemSet3dListenerAttributes(system, listener, posPtr, velPtr, forwardPtr, upPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the position, velocity and orientation of the specified 3D sound listener.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_set3dlistenerattributes">System::set3DListenerAttributes</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Set3dListenerAttributes(
|
|
this FmodSystem system,
|
|
int listener,
|
|
in float3 pos,
|
|
in float3 vel,
|
|
in float3 forward,
|
|
in float3 up
|
|
) => TrySet3dListenerAttributes(system, listener, pos, vel, forward, up).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the position, velocity and orientation of the specified 3D sound listener.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_get3dlistenerattributes">System::get3DListenerAttributes</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGet3dListenerAttributes(
|
|
this FmodSystem system,
|
|
int listener,
|
|
out float3 pos,
|
|
out float3 vel,
|
|
out float3 forward,
|
|
out float3 up
|
|
)
|
|
{
|
|
fixed (float3* posPtr = &pos)
|
|
fixed (float3* velPtr = &vel)
|
|
fixed (float3* forwardPtr = &forward)
|
|
fixed (float3* upPtr = &up)
|
|
return PInvoke.SystemGet3dListenerAttributes(system, listener, posPtr, velPtr, forwardPtr, upPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the position, velocity and orientation of the specified 3D sound listener.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_get3dlistenerattributes">System::get3DListenerAttributes</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Get3dListenerAttributes(
|
|
this FmodSystem system,
|
|
int listener,
|
|
out float3 pos,
|
|
out float3 vel,
|
|
out float3 forward,
|
|
out float3 up
|
|
) => TryGet3dListenerAttributes(system, listener, out pos, out vel, out forward, out up).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets a callback to allow custom calculation of distance attenuation.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_set3drolloffcallback">System::set3DRolloffCallback</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySet3dRolloffCallback(this FmodSystem system, Rolloff3dCallbackPtr callback) =>
|
|
PInvoke.SystemSet3dRolloffCallback(system, callback);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets a callback to allow custom calculation of distance attenuation.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_set3drolloffcallback">System::set3DRolloffCallback</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void Set3dRolloffCallback(this FmodSystem system, Rolloff3dCallbackPtr callback) =>
|
|
TrySet3dRolloffCallback(system, callback).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Suspend mixer thread and relinquish usage of audio hardware while maintaining internal state.
|
|
/// </para>
|
|
/// <para>
|
|
/// Used on mobile platforms when entering a backgrounded state to reduce CPU to 0%.
|
|
/// </para>
|
|
/// <para>
|
|
/// All internal state will be maintained, i.e. created Sound and Channels will stay available in memory.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::mixerResume
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_mixersuspend">System::mixerSuspend</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryMixerSuspend(this FmodSystem system) => PInvoke.SystemMixerSuspend(system);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Suspend mixer thread and relinquish usage of audio hardware while maintaining internal state.
|
|
/// </para>
|
|
/// <para>
|
|
/// Used on mobile platforms when entering a backgrounded state to reduce CPU to 0%.
|
|
/// </para>
|
|
/// <para>
|
|
/// All internal state will be maintained, i.e. created Sound and Channels will stay available in memory.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::mixerResume
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_mixersuspend">System::mixerSuspend</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void MixerSuspend(this FmodSystem system) => TryMixerSuspend(system).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Resume mixer thread and reacquire access to audio hardware.
|
|
/// </para>
|
|
/// <para>
|
|
/// Used on mobile platforms when entering the foreground after being suspended.
|
|
/// </para>
|
|
/// <para>
|
|
/// All internal state will resume, i.e. created Sound and Channels are still valid and playback will
|
|
/// continue.
|
|
/// </para>
|
|
/// <para>
|
|
/// Android specific: Must be called on the same thread as System::mixerSuspend.
|
|
/// </para>
|
|
/// <para>
|
|
/// HTML5 specific: Used to start audio from a user interaction event, like a mouse click or screen touch
|
|
/// event. Without this call audio may not start on some browsers.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::mixerSuspend
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_mixerresume">System::mixerResume</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryMixerResume(this FmodSystem system) => PInvoke.SystemMixerResume(system);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Resume mixer thread and reacquire access to audio hardware.
|
|
/// </para>
|
|
/// <para>
|
|
/// Used on mobile platforms when entering the foreground after being suspended.
|
|
/// </para>
|
|
/// <para>
|
|
/// All internal state will resume, i.e. created Sound and Channels are still valid and playback will
|
|
/// continue.
|
|
/// </para>
|
|
/// <para>
|
|
/// Android specific: Must be called on the same thread as System::mixerSuspend.
|
|
/// </para>
|
|
/// <para>
|
|
/// HTML5 specific: Used to start audio from a user interaction event, like a mouse click or screen touch
|
|
/// event. Without this call audio may not start on some browsers.
|
|
/// </para>
|
|
/// <para>
|
|
/// <b>See Also:</b> System::mixerSuspend
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_mixerresume">System::mixerResume</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void MixerResume(this FmodSystem system) => TryMixerResume(system).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the default matrix used to convert from one speaker mode to another.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdefaultmixmatrix">System::getDefaultMixMatrix</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetDefaultMixMatrix(
|
|
this FmodSystem system,
|
|
SpeakerMode sourceSpeakerMode,
|
|
SpeakerMode targetSpeakerMode,
|
|
float* matrix,
|
|
int matrixHop
|
|
) => PInvoke.SystemGetDefaultMixMatrix(system, sourceSpeakerMode, targetSpeakerMode, matrix, matrixHop);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the default matrix used to convert from one speaker mode to another.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdefaultmixmatrix">System::getDefaultMixMatrix</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void GetDefaultMixMatrix(
|
|
this FmodSystem system,
|
|
SpeakerMode sourceSpeakerMode,
|
|
SpeakerMode targetSpeakerMode,
|
|
float* matrix,
|
|
int matrixHop
|
|
) => TryGetDefaultMixMatrix(system, sourceSpeakerMode, targetSpeakerMode, matrix, matrixHop).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the channel count for a given speaker mode.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getspeakermodechannels">System::getSpeakerModeChannels</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetSpeakerModeChannels(
|
|
this FmodSystem system,
|
|
SpeakerMode mode,
|
|
out int channels
|
|
)
|
|
{
|
|
fixed (int* channelsPtr = &channels)
|
|
return PInvoke.SystemGetSpeakerModeChannels(system, mode, channelsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the channel count for a given speaker mode.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getspeakermodechannels">System::getSpeakerModeChannels</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetSpeakerModeChannels(this FmodSystem system, SpeakerMode mode)
|
|
{
|
|
TryGetSpeakerModeChannels(system, mode, out var channels).Check();
|
|
return channels;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the FMOD version and build number.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getversion">System::getVersion</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetVersion(this FmodSystem system, out uint version, out uint buildnumber)
|
|
{
|
|
fixed (uint* versionPtr = &version)
|
|
fixed (uint* buildnumberPtr = &buildnumber)
|
|
return PInvoke.SystemGetVersion(system, versionPtr, buildnumberPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the FMOD version and build number.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getversion">System::getVersion</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetVersion(this FmodSystem system, out uint version, out uint buildnumber) =>
|
|
TryGetVersion(system, out version, out buildnumber).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves an output type specific internal native interface.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getoutputhandle">System::getOutputHandle</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetOutputHandle(this FmodSystem system, out nint handle)
|
|
{
|
|
fixed (nint* handlePtr = &handle)
|
|
return PInvoke.SystemGetOutputHandle(system, handlePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves an output type specific internal native interface.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getoutputhandle">System::getOutputHandle</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static nint GetOutputHandle(this FmodSystem system)
|
|
{
|
|
TryGetOutputHandle(system, out var handle).Check();
|
|
return handle;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of currently playing Channels.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getchannelsplaying">System::getChannelsPlaying</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetChannelsPlaying(
|
|
this FmodSystem system,
|
|
out int channels,
|
|
out int realChannels
|
|
)
|
|
{
|
|
fixed (int* channelsPtr = &channels)
|
|
fixed (int* realChannelsPtr = &realChannels)
|
|
return PInvoke.SystemGetChannelsPlaying(system, channelsPtr, realChannelsPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of currently playing Channels.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getchannelsplaying">System::getChannelsPlaying</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetChannelsPlaying(this FmodSystem system, out int channels, out int realChannels) =>
|
|
TryGetChannelsPlaying(system, out channels, out realChannels).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the amount of CPU used for different parts of the Core API.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getcpuusage">System::getCPUUsage</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetCpuUsage(this FmodSystem system, out CpuUsage usage)
|
|
{
|
|
fixed (CpuUsage* usagePtr = &usage)
|
|
return PInvoke.SystemGetCpuUsage(system, usagePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the amount of CPU used for different parts of the Core API.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getcpuusage">System::getCPUUsage</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static CpuUsage GetCpuUsage(this FmodSystem system)
|
|
{
|
|
TryGetCpuUsage(system, out var usage).Check();
|
|
return usage;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves information about file reads.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getfileusage">System::getFileUsage</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetFileUsage(
|
|
this FmodSystem system,
|
|
out long sampleBytesRead,
|
|
out long streamBytesRead,
|
|
out long otherBytesRead
|
|
)
|
|
{
|
|
fixed (long* sampleBytesReadPtr = &sampleBytesRead)
|
|
fixed (long* streamBytesReadPtr = &streamBytesRead)
|
|
fixed (long* otherBytesReadPtr = &otherBytesRead)
|
|
return PInvoke.SystemGetFileUsage(system, sampleBytesReadPtr, streamBytesReadPtr, otherBytesReadPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves information about file reads.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getfileusage">System::getFileUsage</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetFileUsage(
|
|
this FmodSystem system,
|
|
out long sampleBytesRead,
|
|
out long streamBytesRead,
|
|
out long otherBytesRead
|
|
) => TryGetFileUsage(system, out sampleBytesRead, out streamBytesRead, out otherBytesRead).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Loads a sound into memory, opens it for streaming or sets it up for callback based sounds.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createsound">System::createSound</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryCreateSound(
|
|
this FmodSystem system,
|
|
RefString8 nameOrData,
|
|
Mode mode,
|
|
in CreateSoundExInfo exInfo,
|
|
out Sound sound
|
|
)
|
|
{
|
|
fixed (byte* nameOrDataPtr = nameOrData)
|
|
fixed (CreateSoundExInfo* exInfoPtr = &exInfo)
|
|
fixed (Sound* soundPtr = &sound)
|
|
return PInvoke.SystemCreateSound(system, nameOrDataPtr, mode, exInfoPtr, soundPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Loads a sound into memory, opens it for streaming or sets it up for callback based sounds.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createsound">System::createSound</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Sound CreateSound(
|
|
this FmodSystem system,
|
|
RefString8 nameOrData,
|
|
Mode mode,
|
|
in CreateSoundExInfo exInfo
|
|
)
|
|
{
|
|
TryCreateSound(system, nameOrData, mode, exInfo, out var sound).Check();
|
|
return sound;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Opens a sound for streaming.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createstream">System::createStream</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryCreateStream(
|
|
this FmodSystem system,
|
|
RefString8 nameOrData,
|
|
Mode mode,
|
|
in CreateSoundExInfo exInfo,
|
|
out Sound sound
|
|
)
|
|
{
|
|
fixed (byte* nameOrDataPtr = nameOrData)
|
|
fixed (CreateSoundExInfo* exInfoPtr = &exInfo)
|
|
fixed (Sound* soundPtr = &sound)
|
|
return PInvoke.SystemCreateStream(system, nameOrDataPtr, mode, exInfoPtr, soundPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Opens a sound for streaming.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createstream">System::createStream</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Sound CreateStream(
|
|
this FmodSystem system,
|
|
RefString8 nameOrData,
|
|
Mode mode,
|
|
in CreateSoundExInfo exInfo
|
|
)
|
|
{
|
|
TryCreateStream(system, nameOrData, mode, exInfo, out var sound).Check();
|
|
return sound;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Create a DSP unit given a plug-in description structure.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createdsp">System::createDSP</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryCreateDsp(this FmodSystem system, in DspDescription description, out Dsp dsp)
|
|
{
|
|
fixed (DspDescription* descriptionPtr = &description)
|
|
fixed (Dsp* dspPtr = &dsp)
|
|
return PInvoke.SystemCreateDsp(system, descriptionPtr, dspPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Create a DSP unit given a plug-in description structure.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createdsp">System::createDSP</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Dsp CreateDsp(this FmodSystem system, in DspDescription description)
|
|
{
|
|
TryCreateDsp(system, description, out var dsp).Check();
|
|
return dsp;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Create a DSP unit with a specified built-in type index.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createdspbytype">System::createDSPByType</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryCreateDspByType(this FmodSystem system, DspType type, out Dsp dsp)
|
|
{
|
|
fixed (Dsp* dspPtr = &dsp)
|
|
return PInvoke.SystemCreateDspByType(system, type, dspPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Create a DSP unit with a specified built-in type index.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createdspbytype">System::createDSPByType</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Dsp CreateDspByType(this FmodSystem system, DspType type)
|
|
{
|
|
TryCreateDspByType(system, type, out var dsp).Check();
|
|
return dsp;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Create a ChannelGroup object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createchannelgroup">System::createChannelGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryCreateChannelGroup(
|
|
this FmodSystem system,
|
|
RefString8 name,
|
|
out ChannelGroup channelGroup
|
|
)
|
|
{
|
|
fixed (byte* namePtr = name)
|
|
fixed (ChannelGroup* channelGroupPtr = &channelGroup)
|
|
return PInvoke.SystemCreateChannelGroup(system, namePtr, channelGroupPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Create a ChannelGroup object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createchannelgroup">System::createChannelGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static ChannelGroup CreateChannelGroup(this FmodSystem system, RefString8 name)
|
|
{
|
|
TryCreateChannelGroup(system, name, out var channelGroup).Check();
|
|
return channelGroup;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Creates a SoundGroup object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createsoundgroup">System::createSoundGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryCreateSoundGroup(
|
|
this FmodSystem system,
|
|
RefString8 name,
|
|
out SoundGroup soundGroup
|
|
)
|
|
{
|
|
fixed (byte* namePtr = name)
|
|
fixed (SoundGroup* soundGroupPtr = &soundGroup)
|
|
return PInvoke.SystemCreateSoundGroup(system, namePtr, soundGroupPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Creates a SoundGroup object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createsoundgroup">System::createSoundGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static SoundGroup CreateSoundGroup(this FmodSystem system, RefString8 name)
|
|
{
|
|
TryCreateSoundGroup(system, name, out var soundGroup).Check();
|
|
return soundGroup;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Creates a 'virtual reverb' object. This object reacts to 3D location and morphs the reverb environment
|
|
/// based on how close it is to the reverb object's center.
|
|
/// </para>
|
|
/// <para>
|
|
/// Multiple reverb objects can be created to achieve a multi-reverb environment. 1 reverb object is used
|
|
/// for all 3D reverb objects (slot 0 by default).
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createreverb3d">System::createReverb3D</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryCreateReverb3d(this FmodSystem system, out Reverb3d reverb)
|
|
{
|
|
fixed (Reverb3d* reverbPtr = &reverb)
|
|
return PInvoke.SystemCreateReverb3d(system, reverbPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Creates a 'virtual reverb' object. This object reacts to 3D location and morphs the reverb environment
|
|
/// based on how close it is to the reverb object's center.
|
|
/// </para>
|
|
/// <para>
|
|
/// Multiple reverb objects can be created to achieve a multi-reverb environment. 1 reverb object is used
|
|
/// for all 3D reverb objects (slot 0 by default).
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_createreverb3d">System::createReverb3D</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Reverb3d CreateReverb3d(this FmodSystem system)
|
|
{
|
|
TryCreateReverb3d(system, out var reverb).Check();
|
|
return reverb;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Plays a Sound on a Channel.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_playsound">System::playSound</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryPlaySound(
|
|
this FmodSystem system,
|
|
Sound sound,
|
|
ChannelGroup channelGroup,
|
|
Bool32 paused,
|
|
out Channel channel
|
|
)
|
|
{
|
|
fixed (Channel* channelPtr = &channel)
|
|
return PInvoke.SystemPlaySound(system, sound, channelGroup, paused, channelPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Plays a Sound on a Channel.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_playsound">System::playSound</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Channel PlaySound(this FmodSystem system, Sound sound, ChannelGroup channelGroup, Bool32 paused)
|
|
{
|
|
TryPlaySound(system, sound, channelGroup, paused, out var channel).Check();
|
|
return channel;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Plays a DSP along with any of its inputs on a Channel.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_playdsp">System::playDSP</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryPlayDsp(
|
|
this FmodSystem system,
|
|
Dsp dsp,
|
|
ChannelGroup channelGroup,
|
|
Bool32 paused,
|
|
out Channel channel
|
|
)
|
|
{
|
|
fixed (Channel* channelPtr = &channel)
|
|
return PInvoke.SystemPlayDsp(system, dsp, channelGroup, paused, channelPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Plays a DSP along with any of its inputs on a Channel.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_playdsp">System::playDSP</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Channel PlayDsp(this FmodSystem system, Dsp dsp, ChannelGroup channelGroup, Bool32 paused)
|
|
{
|
|
TryPlayDsp(system, dsp, channelGroup, paused, out var channel).Check();
|
|
return channel;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a handle to a Channel by ID.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getchannel">System::getChannel</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetChannel(this FmodSystem system, int channelId, out Channel channel)
|
|
{
|
|
fixed (Channel* channelPtr = &channel)
|
|
return PInvoke.SystemGetChannel(system, channelId, channelPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a handle to a Channel by ID.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getchannel">System::getChannel</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Channel GetChannel(this FmodSystem system, int channelId)
|
|
{
|
|
TryGetChannel(system, channelId, out var channel).Check();
|
|
return channel;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieve the description structure for a built-in DSP plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdspinfobytype">System::getDSPInfoByType</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetDspInfoByType(
|
|
this FmodSystem system,
|
|
DspType type,
|
|
out DspDescription* description
|
|
)
|
|
{
|
|
fixed (DspDescription** descriptionPtr = &description)
|
|
return PInvoke.SystemGetDspInfoByType(system, type, descriptionPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieve the description structure for a built-in DSP plug-in.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getdspinfobytype">System::getDSPInfoByType</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe DspDescription* GetDspInfoByType(this FmodSystem system, DspType type)
|
|
{
|
|
TryGetDspInfoByType(system, type, out var description).Check();
|
|
return description;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the master ChannelGroup that all sounds ultimately route to.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getmasterchannelgroup">System::getMasterChannelGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetMasterChannelGroup(this FmodSystem system, out ChannelGroup channelGroup)
|
|
{
|
|
fixed (ChannelGroup* channelGroupPtr = &channelGroup)
|
|
return PInvoke.SystemGetMasterChannelGroup(system, channelGroupPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the master ChannelGroup that all sounds ultimately route to.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getmasterchannelgroup">System::getMasterChannelGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static ChannelGroup GetMasterChannelGroup(this FmodSystem system)
|
|
{
|
|
TryGetMasterChannelGroup(system, out var channelGroup).Check();
|
|
return channelGroup;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the default SoundGroup, where all sounds are placed when they are created.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getmastersoundgroup">System::getMasterSoundGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetMasterSoundGroup(this FmodSystem system, out SoundGroup soundGroup)
|
|
{
|
|
fixed (SoundGroup* soundGroupPtr = &soundGroup)
|
|
return PInvoke.SystemGetMasterSoundGroup(system, soundGroupPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the default SoundGroup, where all sounds are placed when they are created.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getmastersoundgroup">System::getMasterSoundGroup</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static SoundGroup GetMasterSoundGroup(this FmodSystem system)
|
|
{
|
|
TryGetMasterSoundGroup(system, out var soundGroup).Check();
|
|
return soundGroup;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Connect the output of the specified ChannelGroup to an audio port on the output driver.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_attachchannelgrouptoport">System::attachChannelGroupToPort</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryAttachChannelGroupToPort(
|
|
this FmodSystem system,
|
|
PortType portType,
|
|
PortIndex portIndex,
|
|
ChannelGroup channelGroup,
|
|
Bool32 passThru
|
|
) => PInvoke.SystemAttachChannelGroupToPort(system, portType, portIndex, channelGroup, passThru);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Connect the output of the specified ChannelGroup to an audio port on the output driver.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_attachchannelgrouptoport">System::attachChannelGroupToPort</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void AttachChannelGroupToPort(
|
|
this FmodSystem system,
|
|
PortType portType,
|
|
PortIndex portIndex,
|
|
ChannelGroup channelGroup,
|
|
Bool32 passThru
|
|
) => TryAttachChannelGroupToPort(system, portType, portIndex, channelGroup, passThru).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Disconnect the output of the specified ChannelGroup from an audio port on the output driver.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_detachchannelgroupfromport">System::detachChannelGroupFromPort</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryDetachChannelGroupFromPort(this FmodSystem system, ChannelGroup channelGroup) =>
|
|
PInvoke.SystemDetachChannelGroupFromPort(system, channelGroup);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Disconnect the output of the specified ChannelGroup from an audio port on the output driver.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_detachchannelgroupfromport">System::detachChannelGroupFromPort</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void DetachChannelGroupFromPort(this FmodSystem system, ChannelGroup channelGroup) =>
|
|
TryDetachChannelGroupFromPort(system, channelGroup).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets parameters for the global reverb environment.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setreverbproperties">System::setReverbProperties</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TrySetReverbProperties(
|
|
this FmodSystem system,
|
|
int instance,
|
|
in ReverbProperties prop
|
|
)
|
|
{
|
|
fixed (ReverbProperties* propPtr = &prop)
|
|
return PInvoke.SystemSetReverbProperties(system, instance, propPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets parameters for the global reverb environment.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setreverbproperties">System::setReverbProperties</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetReverbProperties(this FmodSystem system, int instance, in ReverbProperties prop) =>
|
|
TrySetReverbProperties(system, instance, prop).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the current reverb environment for the specified reverb instance.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getreverbproperties">System::getReverbProperties</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetReverbProperties(
|
|
this FmodSystem system,
|
|
int instance,
|
|
out ReverbProperties prop
|
|
)
|
|
{
|
|
fixed (ReverbProperties* propPtr = &prop)
|
|
return PInvoke.SystemGetReverbProperties(system, instance, propPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the current reverb environment for the specified reverb instance.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getreverbproperties">System::getReverbProperties</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static ReverbProperties GetReverbProperties(this FmodSystem system, int instance)
|
|
{
|
|
TryGetReverbProperties(system, instance, out var prop).Check();
|
|
return prop;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Mutual exclusion function to lock the DSP engine (which runs asynchronously in another thread), so that
|
|
/// it will not execute.
|
|
/// </para>
|
|
/// <para>
|
|
/// If the DSP engine is already executing, this function is blocked until it has completed.
|
|
/// </para>
|
|
/// <para>
|
|
/// The function may be used to synchronize DSP graph operations carried out by your code. For example, you
|
|
/// could use this to construct a DSP sub-graph without the DSP engine executing in the background while the
|
|
/// sub-graph is still under construction.
|
|
/// </para>
|
|
/// <para>
|
|
/// Once you no longer need the DSP engine to be locked, it can be unlocked with System::unlockDSP.
|
|
/// </para>
|
|
/// <para>
|
|
/// Note that if the DSP engine is locked for a significant amount of time, it may result in audible
|
|
/// skipping or stuttering.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_lockdsp">System::lockDSP</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryLockDsp(this FmodSystem system) => PInvoke.SystemLockDsp(system);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Mutual exclusion function to lock the DSP engine (which runs asynchronously in another thread), so that
|
|
/// it will not execute.
|
|
/// </para>
|
|
/// <para>
|
|
/// If the DSP engine is already executing, this function is blocked until it has completed.
|
|
/// </para>
|
|
/// <para>
|
|
/// The function may be used to synchronize DSP graph operations carried out by your code. For example, you
|
|
/// could use this to construct a DSP sub-graph without the DSP engine executing in the background while the
|
|
/// sub-graph is still under construction.
|
|
/// </para>
|
|
/// <para>
|
|
/// Once you no longer need the DSP engine to be locked, it can be unlocked with System::unlockDSP.
|
|
/// </para>
|
|
/// <para>
|
|
/// Note that if the DSP engine is locked for a significant amount of time, it may result in audible
|
|
/// skipping or stuttering.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_lockdsp">System::lockDSP</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void LockDsp(this FmodSystem system) => TryLockDsp(system).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Mutual exclusion function to unlock the DSP engine (which runs asynchronously in another thread) and let
|
|
/// it continue executing.
|
|
/// </para>
|
|
/// <para>
|
|
/// The DSP engine must be locked with System::lockDSP before this function is called.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_unlockdsp">System::unlockDSP</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryUnlockDsp(this FmodSystem system) => PInvoke.SystemUnlockDsp(system);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Mutual exclusion function to unlock the DSP engine (which runs asynchronously in another thread) and let
|
|
/// it continue executing.
|
|
/// </para>
|
|
/// <para>
|
|
/// The DSP engine must be locked with System::lockDSP before this function is called.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_unlockdsp">System::unlockDSP</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void UnlockDsp(this FmodSystem system) => TryUnlockDsp(system).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of recording devices available for this output mode. Use this to enumerate all
|
|
/// recording devices possible so that the user can select one.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getrecordnumdrivers">System::getRecordNumDrivers</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetRecordNumDrivers(
|
|
this FmodSystem system,
|
|
out int numDrivers,
|
|
out int numConnected
|
|
)
|
|
{
|
|
fixed (int* numDriversPtr = &numDrivers)
|
|
fixed (int* numConnectedPtr = &numConnected)
|
|
return PInvoke.SystemGetRecordNumDrivers(system, numDriversPtr, numConnectedPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the number of recording devices available for this output mode. Use this to enumerate all
|
|
/// recording devices possible so that the user can select one.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getrecordnumdrivers">System::getRecordNumDrivers</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetRecordNumDrivers(this FmodSystem system, out int numDrivers, out int numConnected) =>
|
|
TryGetRecordNumDrivers(system, out numDrivers, out numConnected).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves identification information about an audio device specified by its index, and specific to the
|
|
/// output mode.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getrecorddriverinfo">System::getRecordDriverInfo</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetRecordDriverInfo(
|
|
this FmodSystem system,
|
|
int id,
|
|
byte* name,
|
|
int nameLen,
|
|
out Guid guid,
|
|
out int systemRate,
|
|
out SpeakerMode speakerMode,
|
|
out int speakerModeChannels,
|
|
out DriverState state
|
|
)
|
|
{
|
|
fixed (Guid* guidPtr = &guid)
|
|
fixed (int* systemRatePtr = &systemRate)
|
|
fixed (SpeakerMode* speakerModePtr = &speakerMode)
|
|
fixed (int* speakerModeChannelsPtr = &speakerModeChannels)
|
|
fixed (DriverState* statePtr = &state)
|
|
return PInvoke.SystemGetRecordDriverInfo(
|
|
system,
|
|
id,
|
|
name,
|
|
nameLen,
|
|
guidPtr,
|
|
systemRatePtr,
|
|
speakerModePtr,
|
|
speakerModeChannelsPtr,
|
|
statePtr
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves identification information about an audio device specified by its index, and specific to the
|
|
/// output mode.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getrecorddriverinfo">System::getRecordDriverInfo</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void GetRecordDriverInfo(
|
|
this FmodSystem system,
|
|
int id,
|
|
byte* name,
|
|
int nameLen,
|
|
out Guid guid,
|
|
out int systemRate,
|
|
out SpeakerMode speakerMode,
|
|
out int speakerModeChannels,
|
|
out DriverState state
|
|
) =>
|
|
TryGetRecordDriverInfo(
|
|
system,
|
|
id,
|
|
name,
|
|
nameLen,
|
|
out guid,
|
|
out systemRate,
|
|
out speakerMode,
|
|
out speakerModeChannels,
|
|
out state
|
|
)
|
|
.Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the current recording position of the record buffer in PCM samples.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getrecordposition">System::getRecordPosition</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetRecordPosition(this FmodSystem system, int id, out uint position)
|
|
{
|
|
fixed (uint* positionPtr = &position)
|
|
return PInvoke.SystemGetRecordPosition(system, id, positionPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the current recording position of the record buffer in PCM samples.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getrecordposition">System::getRecordPosition</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static uint GetRecordPosition(this FmodSystem system, int id)
|
|
{
|
|
TryGetRecordPosition(system, id, out var position).Check();
|
|
return position;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Starts the recording engine recording to a pre-created Sound object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_recordstart">System::recordStart</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryRecordStart(this FmodSystem system, int id, Sound sound, Bool32 loop) =>
|
|
PInvoke.SystemRecordStart(system, id, sound, loop);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Starts the recording engine recording to a pre-created Sound object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_recordstart">System::recordStart</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void RecordStart(this FmodSystem system, int id, Sound sound, Bool32 loop) =>
|
|
TryRecordStart(system, id, sound, loop).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Stops the recording engine from recording to a pre-created Sound object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_recordstop">System::recordStop</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TryRecordStop(this FmodSystem system, int id) => PInvoke.SystemRecordStop(system, id);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Stops the recording engine from recording to a pre-created Sound object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_recordstop">System::recordStop</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void RecordStop(this FmodSystem system, int id) => TryRecordStop(system, id).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the state of the FMOD recording API, ie if it is currently recording or not.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_isrecording">System::isRecording</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryIsRecording(this FmodSystem system, int id, out Bool32 recording)
|
|
{
|
|
fixed (Bool32* recordingPtr = &recording)
|
|
return PInvoke.SystemIsRecording(system, id, recordingPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the state of the FMOD recording API, ie if it is currently recording or not.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_isrecording">System::isRecording</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Bool32 IsRecording(this FmodSystem system, int id)
|
|
{
|
|
TryIsRecording(system, id, out var recording).Check();
|
|
return recording;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Geometry creation function. This function will create a base geometry object which can then have
|
|
/// polygons added to it.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_creategeometry">System::createGeometry</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryCreateGeometry(
|
|
this FmodSystem system,
|
|
int maxPolygons,
|
|
int maxVertices,
|
|
out Geometry geometry
|
|
)
|
|
{
|
|
fixed (Geometry* geometryPtr = &geometry)
|
|
return PInvoke.SystemCreateGeometry(system, maxPolygons, maxVertices, geometryPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Geometry creation function. This function will create a base geometry object which can then have
|
|
/// polygons added to it.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_creategeometry">System::createGeometry</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Geometry CreateGeometry(this FmodSystem system, int maxPolygons, int maxVertices)
|
|
{
|
|
TryCreateGeometry(system, maxPolygons, maxVertices, out var geometry).Check();
|
|
return geometry;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the maximum world size for the geometry engine for performance / precision reasons.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setgeometrysettings">System::setGeometrySettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetGeometrySettings(this FmodSystem system, float maxWorldSize) =>
|
|
PInvoke.SystemSetGeometrySettings(system, maxWorldSize);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets the maximum world size for the geometry engine for performance / precision reasons.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setgeometrysettings">System::setGeometrySettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetGeometrySettings(this FmodSystem system, float maxWorldSize) =>
|
|
TrySetGeometrySettings(system, maxWorldSize).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the maximum world size for the geometry engine.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getgeometrysettings">System::getGeometrySettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetGeometrySettings(this FmodSystem system, out float maxWorldSize)
|
|
{
|
|
fixed (float* maxWorldSizePtr = &maxWorldSize)
|
|
return PInvoke.SystemGetGeometrySettings(system, maxWorldSizePtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the maximum world size for the geometry engine.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getgeometrysettings">System::getGeometrySettings</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static float GetGeometrySettings(this FmodSystem system)
|
|
{
|
|
TryGetGeometrySettings(system, out var maxWorldSize).Check();
|
|
return maxWorldSize;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Creates a geometry object from a block of memory which contains pre-saved geometry data.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function avoids the need to manually create and add geometry for faster start time.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_loadgeometry">System::loadGeometry</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryLoadGeometry(
|
|
this FmodSystem system,
|
|
void* data,
|
|
int dataSize,
|
|
out Geometry geometry
|
|
)
|
|
{
|
|
fixed (Geometry* geometryPtr = &geometry)
|
|
return PInvoke.SystemLoadGeometry(system, data, dataSize, geometryPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Creates a geometry object from a block of memory which contains pre-saved geometry data.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function avoids the need to manually create and add geometry for faster start time.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_loadgeometry">System::loadGeometry</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Geometry LoadGeometry(this FmodSystem system, void* data, int dataSize)
|
|
{
|
|
TryLoadGeometry(system, data, dataSize, out var geometry).Check();
|
|
return geometry;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculates geometry occlusion between a listener and a sound source.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getgeometryocclusion">System::getGeometryOcclusion</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetGeometryOcclusion(
|
|
this FmodSystem system,
|
|
in float3 listener,
|
|
in float3 source,
|
|
out float direct,
|
|
out float reverb
|
|
)
|
|
{
|
|
fixed (float3* listenerPtr = &listener)
|
|
fixed (float3* sourcePtr = &source)
|
|
fixed (float* directPtr = &direct)
|
|
fixed (float* reverbPtr = &reverb)
|
|
return PInvoke.SystemGetGeometryOcclusion(system, listenerPtr, sourcePtr, directPtr, reverbPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculates geometry occlusion between a listener and a sound source.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getgeometryocclusion">System::getGeometryOcclusion</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void GetGeometryOcclusion(
|
|
this FmodSystem system,
|
|
in float3 listener,
|
|
in float3 source,
|
|
out float direct,
|
|
out float reverb
|
|
) => TryGetGeometryOcclusion(system, listener, source, out direct, out reverb).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Set a proxy server to use for all subsequent internet connections.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setnetworkproxy">System::setNetworkProxy</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TrySetNetworkProxy(this FmodSystem system, RefString8 proxy)
|
|
{
|
|
fixed (byte* proxyPtr = proxy)
|
|
return PInvoke.SystemSetNetworkProxy(system, proxyPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Set a proxy server to use for all subsequent internet connections.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setnetworkproxy">System::setNetworkProxy</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetNetworkProxy(this FmodSystem system, RefString8 proxy) =>
|
|
TrySetNetworkProxy(system, proxy).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the URL of the proxy server used in internet streaming.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnetworkproxy">System::getNetworkProxy</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetNetworkProxy(this FmodSystem system, byte* proxy, int proxyLen) =>
|
|
PInvoke.SystemGetNetworkProxy(system, proxy, proxyLen);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves the URL of the proxy server used in internet streaming.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnetworkproxy">System::getNetworkProxy</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe void GetNetworkProxy(this FmodSystem system, byte* proxy, int proxyLen) =>
|
|
TryGetNetworkProxy(system, proxy, proxyLen).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Set the timeout for network streams.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setnetworktimeout">System::setNetworkTimeout</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetNetworkTimeout(this FmodSystem system, int timeOut) =>
|
|
PInvoke.SystemSetNetworkTimeout(system, timeOut);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Set the timeout for network streams.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setnetworktimeout">System::setNetworkTimeout</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetNetworkTimeout(this FmodSystem system, int timeOut) =>
|
|
TrySetNetworkTimeout(system, timeOut).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieve the timeout value for network streams.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnetworktimeout">System::getNetworkTimeout</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetNetworkTimeout(this FmodSystem system, out int timeOut)
|
|
{
|
|
fixed (int* timeOutPtr = &timeOut)
|
|
return PInvoke.SystemGetNetworkTimeout(system, timeOutPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieve the timeout value for network streams.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getnetworktimeout">System::getNetworkTimeout</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static int GetNetworkTimeout(this FmodSystem system)
|
|
{
|
|
TryGetNetworkTimeout(system, out var timeOut).Check();
|
|
return timeOut;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets a user value associated with a System object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setuserdata">System::setUserData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static Result TrySetUserData(this FmodSystem system, nint userData) =>
|
|
PInvoke.SystemSetUserData(system, userData);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Sets a user value associated with a System object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_setuserdata">System::setUserData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static void SetUserData(this FmodSystem system, nint userData) =>
|
|
TrySetUserData(system, userData).Check();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a user value associated with a System object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getuserdata">System::getUserData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static unsafe Result TryGetUserData(this FmodSystem system, out nint userData)
|
|
{
|
|
fixed (nint* userDataPtr = &userData)
|
|
return PInvoke.SystemGetUserData(system, userDataPtr);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Retrieves a user value associated with a System object.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see href="https://www.fmod.com/docs/2.03/api/core-api-system.html#system_getuserdata">System::getUserData</see>
|
|
/// </para>
|
|
/// </summary>
|
|
public static nint GetUserData(this FmodSystem system)
|
|
{
|
|
TryGetUserData(system, out var userData).Check();
|
|
return userData;
|
|
}
|
|
}
|
|
}
|