XT-Audio
Functions
XtAudio.h File Reference

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...
 
XtPlatformXtAudioInit (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...
 

Detailed Description

Helper functions and bootstrapping.

Function Documentation

XtErrorInfo XtAudioGetErrorInfo ( XtError  error)

Translate opaque error code to error details.

Returns
detailed error information
Parameters
errorthe 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.

Returns
a pointer to a statically allocated string containing the last assertion failure.

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.

See also
XtAudioSetAssertTerminates
XtAttributes XtAudioGetSampleAttributes ( XtSample  sample)

Get sample attributes for a specific sample type.

Returns
resulting sample attributes.
Parameters
samplethe sample type.

This function may be called from any thread.

XtVersion XtAudioGetVersion ( void  )

Get XT-Audio library version.

Returns
XT-Audio library version

This function may be called from any thread.

XtPlatform * XtAudioInit ( char const *  id,
void *  window 
)

Initialize the XT-Audio library.

Returns
platform-specific library handle. Use XtPlatformDestroy to cleanup.
Parameters
idthe application id. Used to identify against sound servers such as JACK and PulseAudio. When NULL, "XT-Audio" is used.
windowapplication 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.

See also
XtPlatformDestroy
XtAudioSetOnError
void XtAudioSetAssertTerminates ( XtBool  terminates)

Indicates whether internal assertion failures should result in std::terminate (true) or be handled by client code (false).

Parameters
terminatesIf 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.

See also
XtAudioSetOnError
XtAudioGetLastAssert
void XtAudioSetOnError ( XtOnError  onError)

Set error logging callback.

Parameters
onErrorapplication-defined error logging callback. When NULL, no logging is performed.

This function may be called from any thread.

See also
XtOnError