XT-Audio
|
Helper functions and bootstrapping. More...
Go to the source code of this file.
Functions | |
XtVersion | XtAudioGetVersion (void) |
Get XT-Audio library version. More... | |
char const * | XtAudioGetLastAssert (void) |
Indicates last internal assertion failure, if any. More... | |
XtErrorInfo | XtAudioGetErrorInfo (XtError error) |
Translate opaque error code to error details. More... | |
void | XtAudioSetOnError (XtOnError onError) |
Set error logging callback. More... | |
XtPlatform * | XtAudioInit (char const *id, void *window) |
Initialize the XT-Audio library. More... | |
XtAttributes | XtAudioGetSampleAttributes (XtSample sample) |
Get sample attributes for a specific sample type. More... | |
void | XtAudioSetAssertTerminates (XtBool terminates) |
Indicates whether internal assertion failures should result in std::terminate (true) or be handled by client code (false). More... | |
Helper functions and bootstrapping.
XtErrorInfo XtAudioGetErrorInfo | ( | XtError | error | ) |
Translate opaque error code to error details.
error | the error code (must not be 0) |
This function may be called from any thread.
char const * XtAudioGetLastAssert | ( | void | ) |
Indicates last internal assertion failure, if any.
Note: this function is only applicable to the C API. .NET, Java and C++ language bindings use it to translate assertion failures to exceptions, but do not expose this function. By default, in the C API, any assertion failures result in std::terminate().
A C language application must check the result of XtAudioGetLastAssert() after each call into the XT-Audio library only if it disabled the default behaviour of calling std::terminate() on assertion failures using XtAudioSetAssertTerminates(XtFalse).
This function may be called from any thread.
XtAttributes XtAudioGetSampleAttributes | ( | XtSample | sample | ) |
Get sample attributes for a specific sample type.
sample | the sample type. |
This function may be called from any thread.
XtVersion XtAudioGetVersion | ( | void | ) |
Get XT-Audio library version.
This function may be called from any thread.
XtPlatform * XtAudioInit | ( | char const * | id, |
void * | window | ||
) |
Initialize the XT-Audio library.
id | the application id. Used to identify against sound servers such as JACK and PulseAudio. When NULL, "XT-Audio" is used. |
window | application main window handle. ASIO uses this to show modal control panels. DSound uses this for SetCooperativeLevel. When NULL, a dummy message window is used. |
This function may be called from any thread. The thread on which it is called becomes the main thread, many other functions may only be called from the main thread. On Windows, COM is initialized in STA mode by this call. If desired, use XtAudioSetOnError() to enable error logging before calling this function.
void XtAudioSetAssertTerminates | ( | XtBool | terminates | ) |
Indicates whether internal assertion failures should result in std::terminate (true) or be handled by client code (false).
terminates | If true, assertion failures call std::terminate(). If false, client code should check XtAudioGetLastAssert(). |
Note: this function is only applicable to the C API. .NET, Java and C++ language bindings use it to translate assertion failures to exceptions, but do not expose this function. By default, in the C API, any assertion failures result in std::terminate(). In all languages, assertion failures pass through XtOnError.
C language applications may call XtAudioSetAssertTerminates(XtFalse) to enable their own fatal error handling. To do so, any call into the XT-Audio library should be followed by a call to XtAudioGetLastAssert(), and if that returns non-null, invoke an application -defined fatal error handler. Note that if XtAudioGetLastAssert() returns non-null, the application should be considered in a non-recoverable error state.
This function may be called from any thread.