Appl new code style on whole code base

Use a similar code style to bemanitools though reduce indentation
to 2 spaces. Also some other tweaks to be more similar to google
style.
This commit is contained in:
icex2
2021-03-19 15:52:34 +01:00
parent b493b4983a
commit eafb2909d1
322 changed files with 30291 additions and 25084 deletions
+2710 -2440
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+68 -54
View File
@@ -26,47 +26,47 @@
#ifdef _WIN32
#include <windows.h>
# ifdef _MSC_VER
# include <stdio.h> /* _snprintf */
#ifdef _MSC_VER
#include <stdio.h> /* _snprintf */
# undef inline
# define inline __inline
#undef inline
#define inline __inline
# ifndef va_copy
# define va_copy(dest, src) (dest = src)
# endif
#ifndef va_copy
#define va_copy(dest, src) (dest = src)
#endif
# define strcasecmp _stricmp
# define strncasecmp _strnicmp
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
# if defined(HAVE__SNPRINTF_S)
# undef snprintf
# define snprintf(d, n, ...) _snprintf_s((d), (n), _TRUNCATE, __VA_ARGS__)
# else /* HAVE__SNPRINTF_S */
# if defined(HAVE__SNPRINTF)
# undef snprintf
# define snprintf _snprintf
# else /* HAVE__SNPRINTF */
# if !defined(HAVE_SNPRINTF)
# error "no snprintf compatible function found"
# endif /* HAVE_SNPRINTF */
# endif /* HAVE__SNPRINTF */
# endif /* HAVE__SNPRINTF_S */
#if defined(HAVE__SNPRINTF_S)
#undef snprintf
#define snprintf(d, n, ...) _snprintf_s((d), (n), _TRUNCATE, __VA_ARGS__)
#else /* HAVE__SNPRINTF_S */
#if defined(HAVE__SNPRINTF)
#undef snprintf
#define snprintf _snprintf
#else /* HAVE__SNPRINTF */
#if !defined(HAVE_SNPRINTF)
#error "no snprintf compatible function found"
#endif /* HAVE_SNPRINTF */
#endif /* HAVE__SNPRINTF */
#endif /* HAVE__SNPRINTF_S */
# if defined(HAVE__VSNPRINTF_S)
# undef vsnprintf
# define vsnprintf(s, n, f, v) _vsnprintf_s((s), (n), _TRUNCATE, (f), (v))
# else /* HAVE__VSNPRINTF_S */
# if defined(HAVE__VSNPRINTF)
# undef vsnprintf
# define vsnprintf _vsnprintf
# else
# if !defined(HAVE_VSNPRINTF)
# error "No vsnprintf compatible function found"
# endif /* HAVE_VSNPRINTF */
# endif /* HAVE__VSNPRINTF */
# endif /* HAVE__VSNPRINTF_S */
# endif /* _MSC_VER */
#if defined(HAVE__VSNPRINTF_S)
#undef vsnprintf
#define vsnprintf(s, n, f, v) _vsnprintf_s((s), (n), _TRUNCATE, (f), (v))
#else /* HAVE__VSNPRINTF_S */
#if defined(HAVE__VSNPRINTF)
#undef vsnprintf
#define vsnprintf _vsnprintf
#else
#if !defined(HAVE_VSNPRINTF)
#error "No vsnprintf compatible function found"
#endif /* HAVE_VSNPRINTF */
#endif /* HAVE__VSNPRINTF */
#endif /* HAVE__VSNPRINTF_S */
#endif /* _MSC_VER */
/*
* Backwards compatibility with headers shipped with Visual Studio 2005 and
@@ -75,15 +75,15 @@
WINBASEAPI BOOL WINAPI IsDebuggerPresent(VOID);
#ifndef PRIdS
# define PRIdS "Id"
#define PRIdS "Id"
#endif
#ifndef PRIu64
# define PRIu64 "I64u"
#define PRIu64 "I64u"
#endif
#ifndef PRIuMAX
# define PRIuMAX PRIu64
#define PRIuMAX PRIu64
#endif
#ifndef PRIxMAX
@@ -97,23 +97,23 @@ WINBASEAPI BOOL WINAPI IsDebuggerPresent(VOID);
#else /* _WIN32 */
#ifndef __PRI64_PREFIX
# if __WORDSIZE == 64
# define __PRI64_PREFIX "l"
# else
# define __PRI64_PREFIX "ll"
# endif
#if __WORDSIZE == 64
#define __PRI64_PREFIX "l"
#else
#define __PRI64_PREFIX "ll"
#endif
#endif
#ifndef PRIdS
# define PRIdS "zd"
#define PRIdS "zd"
#endif
#ifndef PRIu64
# define PRIu64 __PRI64_PREFIX "u"
#define PRIu64 __PRI64_PREFIX "u"
#endif
#ifndef PRIuMAX
# define PRIuMAX __PRI64_PREFIX "u"
#define PRIuMAX __PRI64_PREFIX "u"
#endif
#ifndef PRIxMAX
@@ -127,19 +127,33 @@ WINBASEAPI BOOL WINAPI IsDebuggerPresent(VOID);
#endif /* _WIN32 */
/** Free memory space */
#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
#define SAFE_FREE(x) \
do { \
if ((x) != NULL) { \
free(x); \
x = NULL; \
} \
} while (0)
/** Zero a structure */
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
#define ZERO_STRUCT(x) memset((char *) &(x), 0, sizeof(x))
/** Zero a structure given a pointer to the structure */
#define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)
#define ZERO_STRUCTP(x) \
do { \
if ((x) != NULL) \
memset((char *) (x), 0, sizeof(*(x))); \
} while (0)
/** Get the size of an array */
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
/** Overwrite the complete string with 'X' */
#define BURN_STRING(x) do { if ((x) != NULL) memset((x), 'X', strlen((x))); } while(0)
#define BURN_STRING(x) \
do { \
if ((x) != NULL) \
memset((x), 'X', strlen((x))); \
} while (0)
/**
* This is a hack to fix warnings. The idea is to use this everywhere that we
@@ -153,11 +167,11 @@ WINBASEAPI BOOL WINAPI IsDebuggerPresent(VOID);
* Also, please call this via the discard_const_p() macro interface, as that
* makes the return type safe.
*/
#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
#define discard_const(ptr) ((void *) ((uintptr_t)(ptr)))
/**
* Type-safe version of discard_const
*/
#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
#define discard_const_p(type, ptr) ((type *) discard_const(ptr))
#endif /* CMOCKA_PRIVATE_H_ */
+3111 -1487
View File
File diff suppressed because it is too large Load Diff
+219 -97
View File
@@ -1,11 +1,17 @@
/* ==================================================================================================== */
/* FMOD Ex - codec development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
/* ====================================================================================================
*/
/* FMOD Ex - codec development header file. Copyright (c), Firelight
* Technologies Pty, Ltd. 2004-2016. */
/* */
/* Use this header if you are wanting to develop your own file format plugin to use with */
/* FMOD's codec system. With this header you can make your own fileformat plugin that FMOD */
/* can register and use. See the documentation and examples on how to make a working plugin. */
/* Use this header if you are wanting to develop your own file format plugin to
* use with */
/* FMOD's codec system. With this header you can make your own fileformat
* plugin that FMOD */
/* can register and use. See the documentation and examples on how to make a
* working plugin. */
/* */
/* ==================================================================================================== */
/* ====================================================================================================
*/
#ifndef _FMOD_CODEC_H
#define _FMOD_CODEC_H
@@ -15,145 +21,261 @@ typedef struct FMOD_CODEC_WAVEFORMAT FMOD_CODEC_WAVEFORMAT;
/*
Codec callbacks
*/
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_OPENCALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_CLOSECALLBACK) (FMOD_CODEC_STATE *codec_state);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_READCALLBACK) (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int sizebytes, unsigned int *bytesread);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETLENGTHCALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *length, FMOD_TIMEUNIT lengthtype);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SETPOSITIONCALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, unsigned int position, FMOD_TIMEUNIT postype);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETPOSITIONCALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *position, FMOD_TIMEUNIT postype);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SOUNDCREATECALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_METADATACALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_TAGTYPE tagtype, char *name, void *data, unsigned int datalen, FMOD_TAGDATATYPE datatype, int unique);
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT) (FMOD_CODEC_STATE *codec_state, int index, FMOD_CODEC_WAVEFORMAT *waveformat);
*/
typedef FMOD_RESULT(F_CALLBACK *FMOD_CODEC_OPENCALLBACK)(
FMOD_CODEC_STATE *codec_state,
FMOD_MODE usermode,
FMOD_CREATESOUNDEXINFO *userexinfo);
typedef FMOD_RESULT(F_CALLBACK *FMOD_CODEC_CLOSECALLBACK)(
FMOD_CODEC_STATE *codec_state);
typedef FMOD_RESULT(F_CALLBACK *FMOD_CODEC_READCALLBACK)(
FMOD_CODEC_STATE *codec_state,
void *buffer,
unsigned int sizebytes,
unsigned int *bytesread);
typedef FMOD_RESULT(F_CALLBACK *FMOD_CODEC_GETLENGTHCALLBACK)(
FMOD_CODEC_STATE *codec_state,
unsigned int *length,
FMOD_TIMEUNIT lengthtype);
typedef FMOD_RESULT(F_CALLBACK *FMOD_CODEC_SETPOSITIONCALLBACK)(
FMOD_CODEC_STATE *codec_state,
int subsound,
unsigned int position,
FMOD_TIMEUNIT postype);
typedef FMOD_RESULT(F_CALLBACK *FMOD_CODEC_GETPOSITIONCALLBACK)(
FMOD_CODEC_STATE *codec_state,
unsigned int *position,
FMOD_TIMEUNIT postype);
typedef FMOD_RESULT(F_CALLBACK *FMOD_CODEC_SOUNDCREATECALLBACK)(
FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound);
typedef FMOD_RESULT(F_CALLBACK *FMOD_CODEC_METADATACALLBACK)(
FMOD_CODEC_STATE *codec_state,
FMOD_TAGTYPE tagtype,
char *name,
void *data,
unsigned int datalen,
FMOD_TAGDATATYPE datatype,
int unique);
typedef FMOD_RESULT(F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT)(
FMOD_CODEC_STATE *codec_state,
int index,
FMOD_CODEC_WAVEFORMAT *waveformat);
/*
[STRUCTURE]
[STRUCTURE]
[
[DESCRIPTION]
When creating a codec, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file.
When creating a codec, declare one of these and provide the relevant
callbacks and name for FMOD to use when it opens and reads a file.
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.<br>
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
Members marked with [in] mean the variable can be written to. The user can
set the value.<br> Members marked with [out] mean the variable is modified by
FMOD and is for reading purposes only. Do not change this value.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable,
PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_CODEC_STATE
]
*/
typedef struct FMOD_CODEC_DESCRIPTION
{
const char *name; /* [in] Name of the codec. */
unsigned int version; /* [in] Plugin writer's version number. */
int defaultasstream; /* [in] Tells FMOD to open the file as a stream when calling System::createSound, and not a static sample. Should normally be 0 (FALSE), because generally the user wants to decode the file into memory when using System::createSound. Mainly used for formats that decode for a very long time, or could use large amounts of memory when decoded. Usually sequenced formats such as mod/s3m/xm/it/midi fall into this category. It is mainly to stop users that don't know what they're doing from getting FMOD_ERR_MEMORY returned from createSound when they should have in fact called System::createStream or used FMOD_CREATESTREAM in System::createSound. */
FMOD_TIMEUNIT timeunits; /* [in] When setposition codec is called, only these time formats will be passed to the codec. Use bitwise OR to accumulate different types. */
FMOD_CODEC_OPENCALLBACK open; /* [in] Open callback for the codec for when FMOD tries to open a sound using this codec. */
FMOD_CODEC_CLOSECALLBACK close; /* [in] Close callback for the codec for when FMOD tries to close a sound using this codec. */
FMOD_CODEC_READCALLBACK read; /* [in] Read callback for the codec for when FMOD tries to read some data from the file to the destination format (specified in the open callback). */
FMOD_CODEC_GETLENGTHCALLBACK getlength; /* [in] Callback to return the length of the song in whatever format required when Sound::getLength is called. */
FMOD_CODEC_SETPOSITIONCALLBACK setposition; /* [in] Seek callback for the codec for when FMOD tries to seek within the file with Channel::setPosition. */
FMOD_CODEC_GETPOSITIONCALLBACK getposition; /* [in] Tell callback for the codec for when FMOD tries to get the current position within the with Channel::getPosition. */
FMOD_CODEC_SOUNDCREATECALLBACK soundcreate; /* [in] Sound creation callback for the codec when FMOD finishes creating the sound. (So the codec can set more parameters for the related created sound, ie loop points/mode or 3D attributes etc). */
FMOD_CODEC_GETWAVEFORMAT getwaveformat; /* [in] Callback to tell FMOD about the waveformat of a particular subsound. This is to save memory, rather than saving 1000 FMOD_CODEC_WAVEFORMAT structures in the codec, the codec might have a more optimal way of storing this information. */
typedef struct FMOD_CODEC_DESCRIPTION {
const char *name; /* [in] Name of the codec. */
unsigned int version; /* [in] Plugin writer's version number. */
int defaultasstream; /* [in] Tells FMOD to open the file as a stream when
calling System::createSound, and not a static sample.
Should normally be 0 (FALSE), because generally the
user wants to decode the file into memory when using
System::createSound. Mainly used for formats that
decode for a very long time, or could use large
amounts of memory when decoded. Usually sequenced
formats such as mod/s3m/xm/it/midi fall into this
category. It is mainly to stop users that don't know
what they're doing from getting FMOD_ERR_MEMORY
returned from createSound when they should have in
fact called System::createStream or used
FMOD_CREATESTREAM in System::createSound. */
FMOD_TIMEUNIT timeunits; /* [in] When setposition codec is called, only these
time formats will be passed to the codec. Use
bitwise OR to accumulate different types. */
FMOD_CODEC_OPENCALLBACK
open; /* [in] Open callback for the codec for when FMOD tries to open a
sound using this codec. */
FMOD_CODEC_CLOSECALLBACK
close; /* [in] Close callback for the codec for when FMOD tries to close a
sound using this codec. */
FMOD_CODEC_READCALLBACK
read; /* [in] Read callback for the codec for when FMOD tries to read some
data from the file to the destination format (specified in the
open callback). */
FMOD_CODEC_GETLENGTHCALLBACK
getlength; /* [in] Callback to return the length of the song in whatever
format required when Sound::getLength is called. */
FMOD_CODEC_SETPOSITIONCALLBACK
setposition; /* [in] Seek callback for the codec for when FMOD tries to
seek within the file with Channel::setPosition. */
FMOD_CODEC_GETPOSITIONCALLBACK
getposition; /* [in] Tell callback for the codec for when FMOD tries to
get the current position within the with
Channel::getPosition. */
FMOD_CODEC_SOUNDCREATECALLBACK
soundcreate; /* [in] Sound creation callback for the codec when FMOD
finishes creating the sound. (So the codec can set more
parameters for the related created sound, ie loop
points/mode or 3D attributes etc). */
FMOD_CODEC_GETWAVEFORMAT
getwaveformat; /* [in] Callback to tell FMOD about the waveformat of a
particular subsound. This is to save memory, rather
than saving 1000 FMOD_CODEC_WAVEFORMAT structures in the
codec, the codec might have a more optimal way of
storing this information. */
} FMOD_CODEC_DESCRIPTION;
/*
[STRUCTURE]
[STRUCTURE]
[
[DESCRIPTION]
Set these values marked 'in' to tell fmod what sort of sound to create.<br>
The format, channels and frequency tell FMOD what sort of hardware buffer to create when you initialize your code. So if you wrote an MP3 codec that decoded to stereo 16bit integer PCM, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2.<br>
Members marked as 'out' are set by fmod. Do not modify these. Simply specify 0 for these values when declaring the structure, FMOD will fill in the values for you after creation with the correct function pointers.<br>
The format, channels and frequency tell FMOD what sort of hardware buffer to
create when you initialize your code. So if you wrote an MP3 codec that decoded
to stereo 16bit integer PCM, you would specify FMOD_SOUND_FORMAT_PCM16, and
channels would be equal to 2.<br> Members marked as 'out' are set by fmod. Do
not modify these. Simply specify 0 for these values when declaring the
structure, FMOD will fill in the values for you after creation with the correct
function pointers.<br>
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.<br>
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
<br>
An FMOD file might be from disk, memory or network, however the file may be opened by the user.<br>
<br>
'numsubsounds' should be 0 if the file is a normal single sound stream or sound. Examples of this would be .WAV, .WMA, .MP3, .AIFF.<br>
'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself. Examples of these types would be CDDA (multiple CD tracks), FSB (contains multiple sounds), MIDI/MOD/S3M/XM/IT (contain instruments).<br>
The arrays of format, channel, frequency, length and blockalign should point to arrays of information based on how many subsounds are in the format. If the number of subsounds is 0 then it should point to 1 of each attribute, the same as if the number of subsounds was 1. If subsounds was 100 for example, each pointer should point to an array of 100 of each attribute.<br>
When a sound has 1 or more subsounds, you must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.
Members marked with [in] mean the variable can be written to. The user can
set the value.<br> Members marked with [out] mean the variable is modified by
FMOD and is for reading purposes only. Do not change this value.<br> <br> An
FMOD file might be from disk, memory or network, however the file may be opened
by the user.<br> <br> 'numsubsounds' should be 0 if the file is a normal single
sound stream or sound. Examples of this would be .WAV, .WMA, .MP3, .AIFF.<br>
'numsubsounds' should be 1+ if the file is a container format, and does not
contain wav data itself. Examples of these types would be CDDA (multiple CD
tracks), FSB (contains multiple sounds), MIDI/MOD/S3M/XM/IT (contain
instruments).<br> The arrays of format, channel, frequency, length and
blockalign should point to arrays of information based on how many subsounds are
in the format. If the number of subsounds is 0 then it should point to 1 of
each attribute, the same as if the number of subsounds was 1. If subsounds was
100 for example, each pointer should point to an array of 100 of each
attribute.<br> When a sound has 1 or more subsounds, you must play the
individual sounds specified by first obtaining the subsound with
Sound::getSubSound.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable,
PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_SOUND_FORMAT
FMOD_FILE_READCALLBACK
FMOD_FILE_SEEKCALLBACK
FMOD_FILE_READCALLBACK
FMOD_FILE_SEEKCALLBACK
FMOD_CODEC_METADATACALLBACK
Sound::getSubSound
Sound::getNumSubSounds
]
*/
struct FMOD_CODEC_WAVEFORMAT
{
char name[256]; /* [in] Name of sound.*/
FMOD_SOUND_FORMAT format; /* [in] Format for (decompressed) codec output, ie FMOD_SOUND_FORMAT_PCM8, FMOD_SOUND_FORMAT_PCM16.*/
int channels; /* [in] Number of channels used by codec, ie mono = 1, stereo = 2. */
int frequency; /* [in] Default frequency in hz of the codec, ie 44100. */
unsigned int lengthbytes; /* [in] Length in bytes of the source data. */
unsigned int lengthpcm; /* [in] Length in decompressed, PCM samples of the file, ie length in seconds * frequency. Used for Sound::getLength and for memory allocation of static decompressed sample data. */
int blockalign; /* [in] Blockalign in decompressed, PCM samples of the optimal decode chunk size for this format. The codec read callback will be called in multiples of this value. */
int loopstart; /* [in] Loopstart in decompressed, PCM samples of file. */
int loopend; /* [in] Loopend in decompressed, PCM samples of file. */
FMOD_MODE mode; /* [in] Mode to determine whether the sound should by default load as looping, non looping, 2d or 3d. */
unsigned int channelmask; /* [in] Microsoft speaker channel mask, as defined for WAVEFORMATEXTENSIBLE and is found in ksmedia.h. Leave at 0 to play in natural speaker order. */
struct FMOD_CODEC_WAVEFORMAT {
char name[256]; /* [in] Name of sound.*/
FMOD_SOUND_FORMAT
format; /* [in] Format for (decompressed) codec output, ie
FMOD_SOUND_FORMAT_PCM8, FMOD_SOUND_FORMAT_PCM16.*/
int channels; /* [in] Number of channels used by codec, ie mono = 1, stereo
= 2. */
int frequency; /* [in] Default frequency in hz of the codec, ie 44100. */
unsigned int lengthbytes; /* [in] Length in bytes of the source data. */
unsigned int lengthpcm; /* [in] Length in decompressed, PCM samples of the
file, ie length in seconds * frequency. Used for
Sound::getLength and for memory allocation of
static decompressed sample data. */
int blockalign; /* [in] Blockalign in decompressed, PCM samples of the optimal
decode chunk size for this format. The codec read callback
will be called in multiples of this value. */
int loopstart; /* [in] Loopstart in decompressed, PCM samples of file. */
int loopend; /* [in] Loopend in decompressed, PCM samples of file. */
FMOD_MODE mode; /* [in] Mode to determine whether the sound should by default
load as looping, non looping, 2d or 3d. */
unsigned int
channelmask; /* [in] Microsoft speaker channel mask, as defined for
WAVEFORMATEXTENSIBLE and is found in ksmedia.h. Leave at
0 to play in natural speaker order. */
};
/*
[STRUCTURE]
[STRUCTURE]
[
[DESCRIPTION]
Codec plugin structure that is passed into each callback.<br>
<br>
Set these numsubsounds and waveformat members when called in FMOD_CODEC_OPENCALLBACK to tell fmod what sort of sound to create.<br>
<br>
The format, channels and frequency tell FMOD what sort of hardware buffer to create when you initialize your code. So if you wrote an MP3 codec that decoded to stereo 16bit integer PCM, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2.<br>
Set these numsubsounds and waveformat members when called in
FMOD_CODEC_OPENCALLBACK to tell fmod what sort of sound to create.<br> <br> The
format, channels and frequency tell FMOD what sort of hardware buffer to create
when you initialize your code. So if you wrote an MP3 codec that decoded to
stereo 16bit integer PCM, you would specify FMOD_SOUND_FORMAT_PCM16, and
channels would be equal to 2.<br>
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.<br>
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
<br>
An FMOD file might be from disk, memory or internet, however the file may be opened by the user.<br>
<br>
'numsubsounds' should be 0 if the file is a normal single sound stream or sound. Examples of this would be .WAV, .WMA, .MP3, .AIFF.<br>
'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself. Examples of these types would be CDDA (multiple CD tracks), FSB (contains multiple sounds), DLS (contain instruments).<br>
The arrays of format, channel, frequency, length and blockalign should point to arrays of information based on how many subsounds are in the format. If the number of subsounds is 0 then it should point to 1 of each attribute, the same as if the number of subsounds was 1. If subsounds was 100 for example, each pointer should point to an array of 100 of each attribute.<br>
When a sound has 1 or more subsounds, you must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.
Members marked with [in] mean the variable can be written to. The user can
set the value.<br> Members marked with [out] mean the variable is modified by
FMOD and is for reading purposes only. Do not change this value.<br> <br> An
FMOD file might be from disk, memory or internet, however the file may be opened
by the user.<br> <br> 'numsubsounds' should be 0 if the file is a normal single
sound stream or sound. Examples of this would be .WAV, .WMA, .MP3, .AIFF.<br>
'numsubsounds' should be 1+ if the file is a container format, and does not
contain wav data itself. Examples of these types would be CDDA (multiple CD
tracks), FSB (contains multiple sounds), DLS (contain instruments).<br> The
arrays of format, channel, frequency, length and blockalign should point to
arrays of information based on how many subsounds are in the format. If the
number of subsounds is 0 then it should point to 1 of each attribute, the same
as if the number of subsounds was 1. If subsounds was 100 for example, each
pointer should point to an array of 100 of each attribute.<br> When a sound has
1 or more subsounds, you must play the individual sounds specified by first
obtaining the subsound with Sound::getSubSound.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable,
PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_SOUND_FORMAT
FMOD_FILE_READCALLBACK
FMOD_FILE_SEEKCALLBACK
FMOD_FILE_READCALLBACK
FMOD_FILE_SEEKCALLBACK
FMOD_CODEC_METADATACALLBACK
Sound::getSubSound
Sound::getNumSubSounds
]
*/
struct FMOD_CODEC_STATE
{
int numsubsounds; /* [in] Number of 'subsounds' in this sound. Anything other than 0 makes it a 'container' format (ie CDDA/DLS/FSB etc which contain 1 or more su bsounds). For most normal, single sound codec such as WAV/AIFF/MP3, this should be 0 as they are not a container for subsounds, they are the sound by itself. */
FMOD_CODEC_WAVEFORMAT *waveformat; /* [in] Pointer to an array of format structures containing information about each sample. Can be 0 or NULL if FMOD_CODEC_GETWAVEFORMAT callback is preferred. The number of entries here must equal the number of subsounds defined in the subsound parameter. If numsubsounds = 0 then there should be 1 instance of this structure. */
void *plugindata; /* [in] Plugin writer created data the codec author wants to attach to this object. */
void *filehandle; /* [out] This will return an internal FMOD file handle to use with the callbacks provided. */
unsigned int filesize; /* [out] This will contain the size of the file in bytes. */
FMOD_FILE_READCALLBACK fileread; /* [out] This will return a callable FMOD file function to use from codec. */
FMOD_FILE_SEEKCALLBACK fileseek; /* [out] This will return a callable FMOD file function to use from codec. */
FMOD_CODEC_METADATACALLBACK metadata; /* [out] This will return a callable FMOD metadata function to use from codec. */
struct FMOD_CODEC_STATE {
int numsubsounds; /* [in] Number of 'subsounds' in this sound. Anything other
than 0 makes it a 'container' format (ie CDDA/DLS/FSB etc
which contain 1 or more su bsounds). For most normal,
single sound codec such as WAV/AIFF/MP3, this should be 0
as they are not a container for subsounds, they are the
sound by itself. */
FMOD_CODEC_WAVEFORMAT
*waveformat; /* [in] Pointer to an array of format structures containing
information about each sample. Can be 0 or NULL if
FMOD_CODEC_GETWAVEFORMAT callback is preferred. The
number of entries here must equal the number of subsounds
defined in the subsound parameter. If numsubsounds = 0
then there should be 1 instance of this structure. */
void *plugindata; /* [in] Plugin writer created data the codec author wants to
attach to this object. */
void *filehandle; /* [out] This will return an internal FMOD file handle to
use with the callbacks provided. */
unsigned int
filesize; /* [out] This will contain the size of the file in bytes. */
FMOD_FILE_READCALLBACK fileread; /* [out] This will return a callable FMOD
file function to use from codec. */
FMOD_FILE_SEEKCALLBACK fileseek; /* [out] This will return a callable FMOD
file function to use from codec. */
FMOD_CODEC_METADATACALLBACK
metadata; /* [out] This will return a callable FMOD metadata function to
use from codec. */
};
#endif
File diff suppressed because it is too large Load Diff
+273 -109
View File
@@ -1,126 +1,290 @@
/*$ preserve start $*/
/* ============================================================================================== */
/* FMOD Ex - Error string header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
/* ==============================================================================================
*/
/* FMOD Ex - Error string header file. Copyright (c), Firelight Technologies
* Pty, Ltd. 2004-2016. */
/* */
/* Use this header if you want to store or display a string version / english explanation of */
/* the FMOD error codes. */
/* Use this header if you want to store or display a string version / english
* explanation of */
/* the FMOD error codes. */
/* */
/* ============================================================================================== */
/* ==============================================================================================
*/
#ifndef _FMOD_ERRORS_H
#define _FMOD_ERRORS_H
#include "fmod.h"
#ifdef __GNUC__
static const char *FMOD_ErrorString(FMOD_RESULT errcode) __attribute__((unused));
#ifdef __GNUC__
static const char *FMOD_ErrorString(FMOD_RESULT errcode)
__attribute__((unused));
#endif
static const char *FMOD_ErrorString(FMOD_RESULT errcode)
{
switch (errcode)
{
/*$ preserve end $*/
case FMOD_ERR_ALREADYLOCKED: return "Tried to call lock a second time before unlock was called. ";
case FMOD_ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound). ";
case FMOD_ERR_CDDA_DRIVERS: return "Neither NTSCSI nor ASPI could be initialised. ";
case FMOD_ERR_CDDA_INIT: return "An error occurred while initialising the CDDA subsystem. ";
case FMOD_ERR_CDDA_INVALID_DEVICE: return "Couldn't find the specified device. ";
case FMOD_ERR_CDDA_NOAUDIO: return "No audio tracks on the specified disc. ";
case FMOD_ERR_CDDA_NODEVICES: return "No CD/DVD devices were found. ";
case FMOD_ERR_CDDA_NODISC: return "No disc present in the specified drive. ";
case FMOD_ERR_CDDA_READ: return "A CDDA read error occurred. ";
case FMOD_ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel. ";
case FMOD_ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound. ";
case FMOD_ERR_COM: return "A Win32 COM related error occured. COM failed to initialize or a QueryInterface failed meaning a Windows codec or driver was not installed properly. ";
case FMOD_ERR_DMA: return "DMA Failure. See debug output for more information. ";
case FMOD_ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependancy. Or tried to connect a tree too many units deep (more than 128). ";
case FMOD_ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format. ";
case FMOD_ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified. ";
case FMOD_ERR_DSP_RUNNING: return "DSP error. Cannot perform this operation while the network is in the middle of running. This will most likely happen if a connection or disconnection is attempted in a DSP callback. ";
case FMOD_ERR_DSP_TOOMANYCONNECTIONS: return "DSP connection error. The unit being connected to or disconnected should only have 1 input or output. ";
case FMOD_ERR_EVENT_ALREADY_LOADED: return "The specified project or bank has already been loaded. Having multiple copies of the same project loaded simultaneously is forbidden. ";
case FMOD_ERR_EVENT_FAILED: return "An Event failed to be retrieved, most likely due to 'just fail' being specified as the max playbacks behavior. ";
case FMOD_ERR_EVENT_GUIDCONFLICT: return "An event with the same GUID already exists. ";
case FMOD_ERR_EVENT_INFOONLY: return "Can't execute this command on an EVENT_INFOONLY event. ";
case FMOD_ERR_EVENT_INTERNAL: return "An error occured that wasn't supposed to. See debug log for reason. ";
case FMOD_ERR_EVENT_MAXSTREAMS: return "Event failed because 'Max streams' was hit when FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS was specified. ";
case FMOD_ERR_EVENT_MISMATCH: return "FSB mismatches the FEV it was compiled with, the stream/sample mode it was meant to be created with was different, or the FEV was built for a different platform. ";
case FMOD_ERR_EVENT_NAMECONFLICT: return "A category with the same name already exists. ";
case FMOD_ERR_EVENT_NEEDSSIMPLE: return "Tried to call a function on a complex event that's only supported by simple events. ";
case FMOD_ERR_EVENT_NOTFOUND: return "The requested event, event group, event category or event property could not be found. ";
case FMOD_ERR_FILE_BAD: return "Error loading file. ";
case FMOD_ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format. ";
case FMOD_ERR_FILE_DISKEJECTED: return "Media was ejected while reading. ";
case FMOD_ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated data?). ";
case FMOD_ERR_FILE_NOTFOUND: return "File not found. ";
case FMOD_ERR_FILE_UNWANTED: return "Unwanted file access occured. ";
case FMOD_ERR_FORMAT: return "Unsupported file or audio format. ";
case FMOD_ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere. ";
case FMOD_ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden. ";
case FMOD_ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource. ";
case FMOD_ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred. ";
case FMOD_ERR_HTTP_TIMEOUT: return "The HTTP request timed out. ";
case FMOD_ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function. ";
case FMOD_ERR_INITIALIZED: return "Cannot call this command after System::init. ";
case FMOD_ERR_INTERNAL: return "An error occured that wasn't supposed to. Contact support. ";
case FMOD_ERR_INVALID_ADDRESS: return "On Xbox 360, this memory address passed to FMOD must be physical, (ie allocated with XPhysicalAlloc.) ";
case FMOD_ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float. ";
case FMOD_ERR_INVALID_HANDLE: return "An invalid object handle was used. ";
case FMOD_ERR_INVALID_PARAM: return "An invalid parameter was passed to this function. ";
case FMOD_ERR_INVALID_POSITION: return "An invalid seek position was passed to this function. ";
case FMOD_ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode. ";
case FMOD_ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle. ";
case FMOD_ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular. ";
case FMOD_ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup. ";
case FMOD_ERR_MEMORY: return "Not enough memory or resources. ";
case FMOD_ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used. ";
case FMOD_ERR_MEMORY_SRAM: return "Not enough memory or resources on console sound ram. ";
case FMOD_ERR_MUSIC_NOCALLBACK: return "The music callback is required, but it has not been set. ";
case FMOD_ERR_MUSIC_NOTFOUND: return "The requested music entity could not be found. ";
case FMOD_ERR_MUSIC_UNINITIALIZED: return "Music system is not initialized probably because no music data is loaded. ";
case FMOD_ERR_NEEDS2D: return "Tried to call a command on a 3d sound when the command was meant for 2d sound. ";
case FMOD_ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound. ";
case FMOD_ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support. (ie trying to play a GCADPCM compressed sound in software on Wii). ";
case FMOD_ERR_NEEDSSOFTWARE: return "Tried to use a feature that requires the software engine. Software engine has either been turned off, or command was executed on a hardware channel which does not support this feature. ";
case FMOD_ERR_NET_CONNECT: return "Couldn't connect to the specified host. ";
case FMOD_ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere. ";
case FMOD_ERR_NET_URL: return "The specified URL couldn't be resolved. ";
case FMOD_ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately. ";
case FMOD_ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready. ";
case FMOD_ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused. ";
case FMOD_ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer. ";
case FMOD_ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted. ";
case FMOD_ERR_OUTPUT_ENUMERATION: return "Error enumerating the available driver list. List may be inconsistent due to a recent device addition or removal. ";
case FMOD_ERR_OUTPUT_FORMAT: return "Soundcard does not support the minimum features needed for this soundsystem (16bit stereo output). ";
case FMOD_ERR_OUTPUT_INIT: return "Error initializing output device. ";
case FMOD_ERR_OUTPUT_NOHARDWARE: return "FMOD_HARDWARE was specified but the sound card does not have the resources necessary to play it. ";
case FMOD_ERR_OUTPUT_NOSOFTWARE: return "Attempted to create a software sound but no software channels were specified in System::init. ";
case FMOD_ERR_PAN: return "Panning only works with mono or stereo sound sources. ";
case FMOD_ERR_PLUGIN: return "An unspecified error has been returned from a 3rd party plugin. ";
case FMOD_ERR_PLUGIN_INSTANCES: return "The number of allowed instances of a plugin has been exceeded. ";
case FMOD_ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available. ";
case FMOD_ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback or other DLLs that it needs to load) ";
case FMOD_ERR_PRELOADED: return "The specified sound is still in use by the event system, call EventSystem::unloadFSB before trying to release it. ";
case FMOD_ERR_PROGRAMMERSOUND: return "The specified sound is still in use by the event system, wait for the event which is using it finish with it. ";
case FMOD_ERR_RECORD: return "An error occured trying to initialize the recording device. ";
case FMOD_ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesnt exist. ";
case FMOD_ERR_SUBSOUNDS: return "The error occured because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound, or a parent sound was played without setting up a sentence first. ";
case FMOD_ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first. ";
case FMOD_ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file. ";
case FMOD_ERR_SUBSOUND_MODE: return "The subsound's mode bits do not match with the parent sound's mode bits. See documentation for function that it was called with. ";
case FMOD_ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags. ";
case FMOD_ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the maxinputchannels parameter in System::setSoftwareFormat. ";
case FMOD_ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support! ";
case FMOD_ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called. ";
case FMOD_ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified. ";
case FMOD_ERR_UPDATE: return "An error caused by System::update occured. ";
case FMOD_ERR_VERSION: return "The version number of this file format is not supported. ";
case FMOD_OK: return "No errors.";
default : return "Unknown error.";
/*$ preserve start $*/
};
switch (errcode) {
/*$ preserve end $*/
case FMOD_ERR_ALREADYLOCKED:
return "Tried to call lock a second time before unlock was called. ";
case FMOD_ERR_BADCOMMAND:
return "Tried to call a function on a data type that does not allow this "
"type of functionality (ie calling Sound::lock on a streaming "
"sound). ";
case FMOD_ERR_CDDA_DRIVERS:
return "Neither NTSCSI nor ASPI could be initialised. ";
case FMOD_ERR_CDDA_INIT:
return "An error occurred while initialising the CDDA subsystem. ";
case FMOD_ERR_CDDA_INVALID_DEVICE:
return "Couldn't find the specified device. ";
case FMOD_ERR_CDDA_NOAUDIO:
return "No audio tracks on the specified disc. ";
case FMOD_ERR_CDDA_NODEVICES:
return "No CD/DVD devices were found. ";
case FMOD_ERR_CDDA_NODISC:
return "No disc present in the specified drive. ";
case FMOD_ERR_CDDA_READ:
return "A CDDA read error occurred. ";
case FMOD_ERR_CHANNEL_ALLOC:
return "Error trying to allocate a channel. ";
case FMOD_ERR_CHANNEL_STOLEN:
return "The specified channel has been reused to play another sound. ";
case FMOD_ERR_COM:
return "A Win32 COM related error occured. COM failed to initialize or a "
"QueryInterface failed meaning a Windows codec or driver was not "
"installed properly. ";
case FMOD_ERR_DMA:
return "DMA Failure. See debug output for more information. ";
case FMOD_ERR_DSP_CONNECTION:
return "DSP connection error. Connection possibly caused a cyclic "
"dependancy. Or tried to connect a tree too many units deep "
"(more than 128). ";
case FMOD_ERR_DSP_FORMAT:
return "DSP Format error. A DSP unit may have attempted to connect to "
"this network with the wrong format. ";
case FMOD_ERR_DSP_NOTFOUND:
return "DSP connection error. Couldn't find the DSP unit specified. ";
case FMOD_ERR_DSP_RUNNING:
return "DSP error. Cannot perform this operation while the network is "
"in the middle of running. This will most likely happen if a "
"connection or disconnection is attempted in a DSP callback. ";
case FMOD_ERR_DSP_TOOMANYCONNECTIONS:
return "DSP connection error. The unit being connected to or "
"disconnected should only have 1 input or output. ";
case FMOD_ERR_EVENT_ALREADY_LOADED:
return "The specified project or bank has already been loaded. Having "
"multiple copies of the same project loaded simultaneously is "
"forbidden. ";
case FMOD_ERR_EVENT_FAILED:
return "An Event failed to be retrieved, most likely due to 'just fail' "
"being specified as the max playbacks behavior. ";
case FMOD_ERR_EVENT_GUIDCONFLICT:
return "An event with the same GUID already exists. ";
case FMOD_ERR_EVENT_INFOONLY:
return "Can't execute this command on an EVENT_INFOONLY event. ";
case FMOD_ERR_EVENT_INTERNAL:
return "An error occured that wasn't supposed to. See debug log for "
"reason. ";
case FMOD_ERR_EVENT_MAXSTREAMS:
return "Event failed because 'Max streams' was hit when "
"FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS was specified. ";
case FMOD_ERR_EVENT_MISMATCH:
return "FSB mismatches the FEV it was compiled with, the stream/sample "
"mode it was meant to be created with was different, or the FEV "
"was built for a different platform. ";
case FMOD_ERR_EVENT_NAMECONFLICT:
return "A category with the same name already exists. ";
case FMOD_ERR_EVENT_NEEDSSIMPLE:
return "Tried to call a function on a complex event that's only "
"supported by simple events. ";
case FMOD_ERR_EVENT_NOTFOUND:
return "The requested event, event group, event category or event "
"property could not be found. ";
case FMOD_ERR_FILE_BAD:
return "Error loading file. ";
case FMOD_ERR_FILE_COULDNOTSEEK:
return "Couldn't perform seek operation. This is a limitation of the "
"medium (ie netstreams) or the file format. ";
case FMOD_ERR_FILE_DISKEJECTED:
return "Media was ejected while reading. ";
case FMOD_ERR_FILE_EOF:
return "End of file unexpectedly reached while trying to read essential "
"data (truncated data?). ";
case FMOD_ERR_FILE_NOTFOUND:
return "File not found. ";
case FMOD_ERR_FILE_UNWANTED:
return "Unwanted file access occured. ";
case FMOD_ERR_FORMAT:
return "Unsupported file or audio format. ";
case FMOD_ERR_HTTP:
return "A HTTP error occurred. This is a catch-all for HTTP errors not "
"listed elsewhere. ";
case FMOD_ERR_HTTP_ACCESS:
return "The specified resource requires authentication or is forbidden. ";
case FMOD_ERR_HTTP_PROXY_AUTH:
return "Proxy authentication is required to access the specified "
"resource. ";
case FMOD_ERR_HTTP_SERVER_ERROR:
return "A HTTP server error occurred. ";
case FMOD_ERR_HTTP_TIMEOUT:
return "The HTTP request timed out. ";
case FMOD_ERR_INITIALIZATION:
return "FMOD was not initialized correctly to support this function. ";
case FMOD_ERR_INITIALIZED:
return "Cannot call this command after System::init. ";
case FMOD_ERR_INTERNAL:
return "An error occured that wasn't supposed to. Contact support. ";
case FMOD_ERR_INVALID_ADDRESS:
return "On Xbox 360, this memory address passed to FMOD must be "
"physical, (ie allocated with XPhysicalAlloc.) ";
case FMOD_ERR_INVALID_FLOAT:
return "Value passed in was a NaN, Inf or denormalized float. ";
case FMOD_ERR_INVALID_HANDLE:
return "An invalid object handle was used. ";
case FMOD_ERR_INVALID_PARAM:
return "An invalid parameter was passed to this function. ";
case FMOD_ERR_INVALID_POSITION:
return "An invalid seek position was passed to this function. ";
case FMOD_ERR_INVALID_SPEAKER:
return "An invalid speaker was passed to this function based on the "
"current speaker mode. ";
case FMOD_ERR_INVALID_SYNCPOINT:
return "The syncpoint did not come from this sound handle. ";
case FMOD_ERR_INVALID_VECTOR:
return "The vectors passed in are not unit length, or perpendicular. ";
case FMOD_ERR_MAXAUDIBLE:
return "Reached maximum audible playback count for this sound's "
"soundgroup. ";
case FMOD_ERR_MEMORY:
return "Not enough memory or resources. ";
case FMOD_ERR_MEMORY_CANTPOINT:
return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non "
"mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used. ";
case FMOD_ERR_MEMORY_SRAM:
return "Not enough memory or resources on console sound ram. ";
case FMOD_ERR_MUSIC_NOCALLBACK:
return "The music callback is required, but it has not been set. ";
case FMOD_ERR_MUSIC_NOTFOUND:
return "The requested music entity could not be found. ";
case FMOD_ERR_MUSIC_UNINITIALIZED:
return "Music system is not initialized probably because no music data "
"is loaded. ";
case FMOD_ERR_NEEDS2D:
return "Tried to call a command on a 3d sound when the command was meant "
"for 2d sound. ";
case FMOD_ERR_NEEDS3D:
return "Tried to call a command on a 2d sound when the command was meant "
"for 3d sound. ";
case FMOD_ERR_NEEDSHARDWARE:
return "Tried to use a feature that requires hardware support. (ie "
"trying to play a GCADPCM compressed sound in software on Wii). ";
case FMOD_ERR_NEEDSSOFTWARE:
return "Tried to use a feature that requires the software engine. "
"Software engine has either been turned off, or command was "
"executed on a hardware channel which does not support this "
"feature. ";
case FMOD_ERR_NET_CONNECT:
return "Couldn't connect to the specified host. ";
case FMOD_ERR_NET_SOCKET_ERROR:
return "A socket error occurred. This is a catch-all for socket-related "
"errors not listed elsewhere. ";
case FMOD_ERR_NET_URL:
return "The specified URL couldn't be resolved. ";
case FMOD_ERR_NET_WOULD_BLOCK:
return "Operation on a non-blocking socket could not complete "
"immediately. ";
case FMOD_ERR_NOTREADY:
return "Operation could not be performed because specified sound/DSP "
"connection is not ready. ";
case FMOD_ERR_OUTPUT_ALLOCATED:
return "Error initializing output device, but more specifically, the "
"output device is already in use and cannot be reused. ";
case FMOD_ERR_OUTPUT_CREATEBUFFER:
return "Error creating hardware sound buffer. ";
case FMOD_ERR_OUTPUT_DRIVERCALL:
return "A call to a standard soundcard driver failed, which could "
"possibly mean a bug in the driver or resources were missing or "
"exhausted. ";
case FMOD_ERR_OUTPUT_ENUMERATION:
return "Error enumerating the available driver list. List may be "
"inconsistent due to a recent device addition or removal. ";
case FMOD_ERR_OUTPUT_FORMAT:
return "Soundcard does not support the minimum features needed for this "
"soundsystem (16bit stereo output). ";
case FMOD_ERR_OUTPUT_INIT:
return "Error initializing output device. ";
case FMOD_ERR_OUTPUT_NOHARDWARE:
return "FMOD_HARDWARE was specified but the sound card does not have the "
"resources necessary to play it. ";
case FMOD_ERR_OUTPUT_NOSOFTWARE:
return "Attempted to create a software sound but no software channels "
"were specified in System::init. ";
case FMOD_ERR_PAN:
return "Panning only works with mono or stereo sound sources. ";
case FMOD_ERR_PLUGIN:
return "An unspecified error has been returned from a 3rd party plugin. ";
case FMOD_ERR_PLUGIN_INSTANCES:
return "The number of allowed instances of a plugin has been exceeded. ";
case FMOD_ERR_PLUGIN_MISSING:
return "A requested output, dsp unit type or codec was not available. ";
case FMOD_ERR_PLUGIN_RESOURCE:
return "A resource that the plugin requires cannot be found. (ie the DLS "
"file for MIDI playback or other DLLs that it needs to load) ";
case FMOD_ERR_PRELOADED:
return "The specified sound is still in use by the event system, call "
"EventSystem::unloadFSB before trying to release it. ";
case FMOD_ERR_PROGRAMMERSOUND:
return "The specified sound is still in use by the event system, wait "
"for the event which is using it finish with it. ";
case FMOD_ERR_RECORD:
return "An error occured trying to initialize the recording device. ";
case FMOD_ERR_REVERB_INSTANCE:
return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. "
"Most likely because it is an invalid instance number or the "
"reverb doesnt exist. ";
case FMOD_ERR_SUBSOUNDS:
return "The error occured because the sound referenced contains "
"subsounds when it shouldn't have, or it doesn't contain "
"subsounds when it should have. The operation may also not be "
"able to be performed on a parent sound, or a parent sound was "
"played without setting up a sentence first. ";
case FMOD_ERR_SUBSOUND_ALLOCATED:
return "This subsound is already being used by another sound, you cannot "
"have more than one parent to a sound. Null out the other "
"parent's entry first. ";
case FMOD_ERR_SUBSOUND_CANTMOVE:
return "Shared subsounds cannot be replaced or moved from their parent "
"stream, such as when the parent stream is an FSB file. ";
case FMOD_ERR_SUBSOUND_MODE:
return "The subsound's mode bits do not match with the parent sound's "
"mode bits. See documentation for function that it was called "
"with. ";
case FMOD_ERR_TAGNOTFOUND:
return "The specified tag could not be found or there are no tags. ";
case FMOD_ERR_TOOMANYCHANNELS:
return "The sound created exceeds the allowable input channel count. "
"This can be increased using the maxinputchannels parameter in "
"System::setSoftwareFormat. ";
case FMOD_ERR_UNIMPLEMENTED:
return "Something in FMOD hasn't been implemented when it should be! "
"contact support! ";
case FMOD_ERR_UNINITIALIZED:
return "This command failed because System::init or System::setDriver "
"was not called. ";
case FMOD_ERR_UNSUPPORTED:
return "A command issued was not supported by this object. Possibly a "
"plugin without certain callbacks specified. ";
case FMOD_ERR_UPDATE:
return "An error caused by System::update occured. ";
case FMOD_ERR_VERSION:
return "The version number of this file format is not supported. ";
case FMOD_OK:
return "No errors.";
default:
return "Unknown error.";
/*$ preserve start $*/
};
}
#endif
+191 -134
View File
@@ -1,10 +1,14 @@
/* ============================================================================================= */
/* FMOD Ex - Memory info header file. Copyright (c), Firelight Technologies Pty, Ltd. 2008-2016. */
/* =============================================================================================
*/
/* FMOD Ex - Memory info header file. Copyright (c), Firelight Technologies Pty,
* Ltd. 2008-2016. */
/* */
/* Use this header if you are interested in getting detailed information on FMOD's memory */
/* usage. See the documentation for more details. */
/* Use this header if you are interested in getting detailed information on
* FMOD's memory */
/* usage. See the documentation for more details. */
/* */
/* ============================================================================================= */
/* =============================================================================================
*/
#ifndef _FMOD_MEMORYINFO_H
#define _FMOD_MEMORYINFO_H
@@ -13,79 +17,85 @@
[STRUCTURE]
[
[DESCRIPTION]
Structure to be filled with detailed memory usage information of an FMOD object
Structure to be filled with detailed memory usage information of an FMOD
object
[REMARKS]
Every public FMOD class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question.
On return from getMemoryInfo, each member of this structure will hold the amount of memory used for its type in bytes.<br>
<br>
Members marked with [in] mean the user sets the value before passing it to the function.<br>
Members marked with [out] mean FMOD sets the value to be used after the function exits.<br>
Every public FMOD class has a getMemoryInfo function which can be used to
get detailed information on what memory resources are associated with the object
in question. On return from getMemoryInfo, each member of this structure will
hold the amount of memory used for its type in bytes.<br> <br> Members marked
with [in] mean the user sets the value before passing it to the function.<br>
Members marked with [out] mean FMOD sets the value to be used after the
function exits.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable,
PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
System::getMemoryInfo
EventSystem::getMemoryInfo
FMOD_MEMBITS
FMOD_MEMBITS
FMOD_EVENT_MEMBITS
]
*/
typedef struct FMOD_MEMORY_USAGE_DETAILS
{
unsigned int other; /* [out] Memory not accounted for by other types */
unsigned int string; /* [out] String data */
unsigned int system; /* [out] System object and various internals */
unsigned int plugins; /* [out] Plugin objects and internals */
unsigned int output; /* [out] Output module object and internals */
unsigned int channel; /* [out] Channel related memory */
unsigned int channelgroup; /* [out] ChannelGroup objects and internals */
unsigned int codec; /* [out] Codecs allocated for streaming */
unsigned int file; /* [out] File buffers and structures */
unsigned int sound; /* [out] Sound objects and internals */
unsigned int secondaryram; /* [out] Sound data stored in secondary RAM */
unsigned int soundgroup; /* [out] SoundGroup objects and internals */
unsigned int streambuffer; /* [out] Stream buffer memory */
unsigned int dspconnection; /* [out] DSPConnection objects and internals */
unsigned int dsp; /* [out] DSP implementation objects */
unsigned int dspcodec; /* [out] Realtime file format decoding DSP objects */
unsigned int profile; /* [out] Profiler memory footprint. */
unsigned int recordbuffer; /* [out] Buffer used to store recorded data from microphone */
unsigned int reverb; /* [out] Reverb implementation objects */
unsigned int reverbchannelprops; /* [out] Reverb channel properties structs */
unsigned int geometry; /* [out] Geometry objects and internals */
unsigned int syncpoint; /* [out] Sync point memory. */
unsigned int eventsystem; /* [out] EventSystem and various internals */
unsigned int musicsystem; /* [out] MusicSystem and various internals */
unsigned int fev; /* [out] Definition of objects contained in all loaded projects e.g. events, groups, categories */
unsigned int memoryfsb; /* [out] Data loaded with preloadFSB */
unsigned int eventproject; /* [out] EventProject objects and internals */
unsigned int eventgroupi; /* [out] EventGroup objects and internals */
unsigned int soundbankclass; /* [out] Objects used to manage wave banks */
unsigned int soundbanklist; /* [out] Data used to manage lists of wave bank usage */
unsigned int streaminstance; /* [out] Stream objects and internals */
unsigned int sounddefclass; /* [out] Sound definition objects */
unsigned int sounddefdefclass; /* [out] Sound definition static data objects */
unsigned int sounddefpool; /* [out] Sound definition pool data */
unsigned int reverbdef; /* [out] Reverb definition objects */
unsigned int eventreverb; /* [out] Reverb objects */
unsigned int userproperty; /* [out] User property objects */
unsigned int eventinstance; /* [out] Event instance base objects */
unsigned int eventinstance_complex; /* [out] Complex event instance objects */
unsigned int eventinstance_simple; /* [out] Simple event instance objects */
unsigned int eventinstance_layer; /* [out] Event layer instance objects */
unsigned int eventinstance_sound; /* [out] Event sound instance objects */
unsigned int eventenvelope; /* [out] Event envelope objects */
unsigned int eventenvelopedef; /* [out] Event envelope definition objects */
unsigned int eventparameter; /* [out] Event parameter objects */
unsigned int eventcategory; /* [out] Event category objects */
unsigned int eventenvelopepoint; /* [out] Event envelope point objects */
unsigned int eventinstancepool; /* [out] Event instance pool memory */
typedef struct FMOD_MEMORY_USAGE_DETAILS {
unsigned int other; /* [out] Memory not accounted for by other types */
unsigned int string; /* [out] String data */
unsigned int system; /* [out] System object and various internals */
unsigned int plugins; /* [out] Plugin objects and internals */
unsigned int output; /* [out] Output module object and internals */
unsigned int channel; /* [out] Channel related memory */
unsigned int channelgroup; /* [out] ChannelGroup objects and internals */
unsigned int codec; /* [out] Codecs allocated for streaming */
unsigned int file; /* [out] File buffers and structures */
unsigned int sound; /* [out] Sound objects and internals */
unsigned int secondaryram; /* [out] Sound data stored in secondary RAM */
unsigned int soundgroup; /* [out] SoundGroup objects and internals */
unsigned int streambuffer; /* [out] Stream buffer memory */
unsigned int dspconnection; /* [out] DSPConnection objects and internals */
unsigned int dsp; /* [out] DSP implementation objects */
unsigned int dspcodec; /* [out] Realtime file format decoding DSP objects */
unsigned int profile; /* [out] Profiler memory footprint. */
unsigned int recordbuffer; /* [out] Buffer used to store recorded data from
microphone */
unsigned int reverb; /* [out] Reverb implementation objects */
unsigned int reverbchannelprops; /* [out] Reverb channel properties structs */
unsigned int geometry; /* [out] Geometry objects and internals */
unsigned int syncpoint; /* [out] Sync point memory. */
unsigned int eventsystem; /* [out] EventSystem and various internals */
unsigned int musicsystem; /* [out] MusicSystem and various internals */
unsigned int fev; /* [out] Definition of objects contained in all loaded
projects e.g. events, groups, categories */
unsigned int memoryfsb; /* [out] Data loaded with preloadFSB */
unsigned int eventproject; /* [out] EventProject objects and internals */
unsigned int eventgroupi; /* [out] EventGroup objects and internals */
unsigned int soundbankclass; /* [out] Objects used to manage wave banks */
unsigned int
soundbanklist; /* [out] Data used to manage lists of wave bank usage */
unsigned int streaminstance; /* [out] Stream objects and internals */
unsigned int sounddefclass; /* [out] Sound definition objects */
unsigned int
sounddefdefclass; /* [out] Sound definition static data objects */
unsigned int sounddefpool; /* [out] Sound definition pool data */
unsigned int reverbdef; /* [out] Reverb definition objects */
unsigned int eventreverb; /* [out] Reverb objects */
unsigned int userproperty; /* [out] User property objects */
unsigned int eventinstance; /* [out] Event instance base objects */
unsigned int eventinstance_complex; /* [out] Complex event instance objects */
unsigned int eventinstance_simple; /* [out] Simple event instance objects */
unsigned int eventinstance_layer; /* [out] Event layer instance objects */
unsigned int eventinstance_sound; /* [out] Event sound instance objects */
unsigned int eventenvelope; /* [out] Event envelope objects */
unsigned int eventenvelopedef; /* [out] Event envelope definition objects */
unsigned int eventparameter; /* [out] Event parameter objects */
unsigned int eventcategory; /* [out] Event category objects */
unsigned int eventenvelopepoint; /* [out] Event envelope point objects */
unsigned int eventinstancepool; /* [out] Event instance pool memory */
} FMOD_MEMORY_USAGE_DETAILS;
/*
[DEFINE]
[
@@ -93,48 +103,62 @@ typedef struct FMOD_MEMORY_USAGE_DETAILS
FMOD_MEMBITS
[DESCRIPTION]
Bitfield used to request specific memory usage information from the getMemoryInfo function of every public FMOD Ex class.
Use with the "memorybits" parameter of getMemoryInfo to get information on FMOD Ex memory usage.
Bitfield used to request specific memory usage information from the
getMemoryInfo function of every public FMOD Ex class. Use with the "memorybits"
parameter of getMemoryInfo to get information on FMOD Ex memory usage.
[REMARKS]
Every public FMOD class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question.
The FMOD_MEMBITS defines can be OR'd together to specify precisely what memory usage you'd like to get information on. See System::getMemoryInfo for an example.
Every public FMOD class has a getMemoryInfo function which can be used to
get detailed information on what memory resources are associated with the object
in question. The FMOD_MEMBITS defines can be OR'd together to specify precisely
what memory usage you'd like to get information on. See System::getMemoryInfo
for an example.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable,
PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_EVENT_MEMBITS
System::getMemoryInfo
]
*/
#define FMOD_MEMBITS_OTHER 0x00000001 /* Memory not accounted for by other types */
#define FMOD_MEMBITS_STRING 0x00000002 /* String data */
#define FMOD_MEMBITS_OTHER \
0x00000001 /* Memory not accounted for by other types */
#define FMOD_MEMBITS_STRING 0x00000002 /* String data */
#define FMOD_MEMBITS_SYSTEM 0x00000004 /* System object and various internals */
#define FMOD_MEMBITS_PLUGINS 0x00000008 /* Plugin objects and internals */
#define FMOD_MEMBITS_OUTPUT 0x00000010 /* Output module object and internals */
#define FMOD_MEMBITS_CHANNEL 0x00000020 /* Channel related memory */
#define FMOD_MEMBITS_CHANNELGROUP 0x00000040 /* ChannelGroup objects and internals */
#define FMOD_MEMBITS_CODEC 0x00000080 /* Codecs allocated for streaming */
#define FMOD_MEMBITS_FILE 0x00000100 /* Codecs allocated for streaming */
#define FMOD_MEMBITS_SOUND 0x00000200 /* Sound objects and internals */
#define FMOD_MEMBITS_SOUND_SECONDARYRAM 0x00000400 /* Sound data stored in secondary RAM */
#define FMOD_MEMBITS_SOUNDGROUP 0x00000800 /* SoundGroup objects and internals */
#define FMOD_MEMBITS_STREAMBUFFER 0x00001000 /* Stream buffer memory */
#define FMOD_MEMBITS_DSPCONNECTION 0x00002000 /* DSPConnection objects and internals */
#define FMOD_MEMBITS_DSP 0x00004000 /* DSP implementation objects */
#define FMOD_MEMBITS_DSPCODEC 0x00008000 /* Realtime file format decoding DSP objects */
#define FMOD_MEMBITS_PROFILE 0x00010000 /* Profiler memory footprint. */
#define FMOD_MEMBITS_RECORDBUFFER 0x00020000 /* Buffer used to store recorded data from microphone */
#define FMOD_MEMBITS_REVERB 0x00040000 /* Reverb implementation objects */
#define FMOD_MEMBITS_REVERBCHANNELPROPS 0x00080000 /* Reverb channel properties structs */
#define FMOD_MEMBITS_GEOMETRY 0x00100000 /* Geometry objects and internals */
#define FMOD_MEMBITS_SYNCPOINT 0x00200000 /* Sync point memory. */
#define FMOD_MEMBITS_ALL 0xffffffff /* All memory used by FMOD Ex */
#define FMOD_MEMBITS_SYSTEM 0x00000004 /* System object and various internals \
*/
#define FMOD_MEMBITS_PLUGINS 0x00000008 /* Plugin objects and internals */
#define FMOD_MEMBITS_OUTPUT 0x00000010 /* Output module object and internals \
*/
#define FMOD_MEMBITS_CHANNEL 0x00000020 /* Channel related memory */
#define FMOD_MEMBITS_CHANNELGROUP \
0x00000040 /* ChannelGroup objects and internals */
#define FMOD_MEMBITS_CODEC 0x00000080 /* Codecs allocated for streaming */
#define FMOD_MEMBITS_FILE 0x00000100 /* Codecs allocated for streaming */
#define FMOD_MEMBITS_SOUND 0x00000200 /* Sound objects and internals */
#define FMOD_MEMBITS_SOUND_SECONDARYRAM \
0x00000400 /* Sound data stored in secondary RAM */
#define FMOD_MEMBITS_SOUNDGROUP \
0x00000800 /* SoundGroup objects and internals */
#define FMOD_MEMBITS_STREAMBUFFER 0x00001000 /* Stream buffer memory */
#define FMOD_MEMBITS_DSPCONNECTION \
0x00002000 /* DSPConnection objects and internals */
#define FMOD_MEMBITS_DSP 0x00004000 /* DSP implementation objects */
#define FMOD_MEMBITS_DSPCODEC \
0x00008000 /* Realtime file format decoding DSP objects */
#define FMOD_MEMBITS_PROFILE 0x00010000 /* Profiler memory footprint. */
#define FMOD_MEMBITS_RECORDBUFFER \
0x00020000 /* Buffer used to store recorded data from microphone */
#define FMOD_MEMBITS_REVERB 0x00040000 /* Reverb implementation objects */
#define FMOD_MEMBITS_REVERBCHANNELPROPS \
0x00080000 /* Reverb channel properties structs */
#define FMOD_MEMBITS_GEOMETRY 0x00100000 /* Geometry objects and internals */
#define FMOD_MEMBITS_SYNCPOINT 0x00200000 /* Sync point memory. */
#define FMOD_MEMBITS_ALL 0xffffffff /* All memory used by FMOD Ex */
/* [DEFINE_END] */
/*
[DEFINE]
[
@@ -142,60 +166,93 @@ typedef struct FMOD_MEMORY_USAGE_DETAILS
FMOD_EVENT_MEMBITS
[DESCRIPTION]
Bitfield used to request specific memory usage information from the getMemoryInfo function of every public FMOD Event System class.
Use with the "event_memorybits" parameter of getMemoryInfo to get information on FMOD Event System memory usage.
Bitfield used to request specific memory usage information from the
getMemoryInfo function of every public FMOD Event System class. Use with the
"event_memorybits" parameter of getMemoryInfo to get information on FMOD Event
System memory usage.
[REMARKS]
Every public FMOD Event System class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question.
The FMOD_EVENT_MEMBITS defines can be OR'd together to specify precisely what memory usage you'd like to get information on. See EventSystem::getMemoryInfo for an example.
Every public FMOD Event System class has a getMemoryInfo function which can
be used to get detailed information on what memory resources are associated with
the object in question. The FMOD_EVENT_MEMBITS defines can be OR'd together to
specify precisely what memory usage you'd like to get information on. See
EventSystem::getMemoryInfo for an example.
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable,
PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_MEMBITS
System::getMemoryInfo
]
*/
#define FMOD_EVENT_MEMBITS_EVENTSYSTEM 0x00000001 /* EventSystem and various internals */
#define FMOD_EVENT_MEMBITS_MUSICSYSTEM 0x00000002 /* MusicSystem and various internals */
#define FMOD_EVENT_MEMBITS_FEV 0x00000004 /* Definition of objects contained in all loaded projects e.g. events, groups, categories */
#define FMOD_EVENT_MEMBITS_MEMORYFSB 0x00000008 /* Data loaded with preloadFSB */
#define FMOD_EVENT_MEMBITS_EVENTPROJECT 0x00000010 /* EventProject objects and internals */
#define FMOD_EVENT_MEMBITS_EVENTGROUPI 0x00000020 /* EventGroup objects and internals */
#define FMOD_EVENT_MEMBITS_SOUNDBANKCLASS 0x00000040 /* Objects used to manage wave banks */
#define FMOD_EVENT_MEMBITS_SOUNDBANKLIST 0x00000080 /* Data used to manage lists of wave bank usage */
#define FMOD_EVENT_MEMBITS_STREAMINSTANCE 0x00000100 /* Stream objects and internals */
#define FMOD_EVENT_MEMBITS_SOUNDDEFCLASS 0x00000200 /* Sound definition objects */
#define FMOD_EVENT_MEMBITS_SOUNDDEFDEFCLASS 0x00000400 /* Sound definition static data objects */
#define FMOD_EVENT_MEMBITS_SOUNDDEFPOOL 0x00000800 /* Sound definition pool data */
#define FMOD_EVENT_MEMBITS_REVERBDEF 0x00001000 /* Reverb definition objects */
#define FMOD_EVENT_MEMBITS_EVENTREVERB 0x00002000 /* Reverb objects */
#define FMOD_EVENT_MEMBITS_USERPROPERTY 0x00004000 /* User property objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE 0x00008000 /* Event instance base objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_COMPLEX 0x00010000 /* Complex event instance objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_SIMPLE 0x00020000 /* Simple event instance objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_LAYER 0x00040000 /* Event layer instance objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_SOUND 0x00080000 /* Event sound instance objects */
#define FMOD_EVENT_MEMBITS_EVENTENVELOPE 0x00100000 /* Event envelope objects */
#define FMOD_EVENT_MEMBITS_EVENTENVELOPEDEF 0x00200000 /* Event envelope definition objects */
#define FMOD_EVENT_MEMBITS_EVENTPARAMETER 0x00400000 /* Event parameter objects */
#define FMOD_EVENT_MEMBITS_EVENTCATEGORY 0x00800000 /* Event category objects */
#define FMOD_EVENT_MEMBITS_EVENTENVELOPEPOINT 0x01000000 /* Event envelope point object+s */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCEPOOL 0x02000000 /* Event instance pool data */
#define FMOD_EVENT_MEMBITS_ALL 0xffffffff /* All memory used by FMOD Event System */
*/
#define FMOD_EVENT_MEMBITS_EVENTSYSTEM \
0x00000001 /* EventSystem and various internals */
#define FMOD_EVENT_MEMBITS_MUSICSYSTEM \
0x00000002 /* MusicSystem and various internals */
#define FMOD_EVENT_MEMBITS_FEV \
0x00000004 /* Definition of objects contained in all loaded projects e.g. \
events, groups, categories */
#define FMOD_EVENT_MEMBITS_MEMORYFSB \
0x00000008 /* Data loaded with preloadFSB */
#define FMOD_EVENT_MEMBITS_EVENTPROJECT \
0x00000010 /* EventProject objects and internals */
#define FMOD_EVENT_MEMBITS_EVENTGROUPI \
0x00000020 /* EventGroup objects and internals */
#define FMOD_EVENT_MEMBITS_SOUNDBANKCLASS \
0x00000040 /* Objects used to manage wave banks */
#define FMOD_EVENT_MEMBITS_SOUNDBANKLIST \
0x00000080 /* Data used to manage lists of wave bank usage */
#define FMOD_EVENT_MEMBITS_STREAMINSTANCE \
0x00000100 /* Stream objects and internals */
#define FMOD_EVENT_MEMBITS_SOUNDDEFCLASS \
0x00000200 /* Sound definition objects */
#define FMOD_EVENT_MEMBITS_SOUNDDEFDEFCLASS \
0x00000400 /* Sound definition static data objects */
#define FMOD_EVENT_MEMBITS_SOUNDDEFPOOL \
0x00000800 /* Sound definition pool data */
#define FMOD_EVENT_MEMBITS_REVERBDEF 0x00001000 /* Reverb definition objects \
*/
#define FMOD_EVENT_MEMBITS_EVENTREVERB 0x00002000 /* Reverb objects */
#define FMOD_EVENT_MEMBITS_USERPROPERTY 0x00004000 /* User property objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE \
0x00008000 /* Event instance base objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_COMPLEX \
0x00010000 /* Complex event instance objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_SIMPLE \
0x00020000 /* Simple event instance objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_LAYER \
0x00040000 /* Event layer instance objects */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_SOUND \
0x00080000 /* Event sound instance objects */
#define FMOD_EVENT_MEMBITS_EVENTENVELOPE 0x00100000 /* Event envelope objects \
*/
#define FMOD_EVENT_MEMBITS_EVENTENVELOPEDEF \
0x00200000 /* Event envelope definition objects */
#define FMOD_EVENT_MEMBITS_EVENTPARAMETER \
0x00400000 /* Event parameter objects */
#define FMOD_EVENT_MEMBITS_EVENTCATEGORY 0x00800000 /* Event category objects \
*/
#define FMOD_EVENT_MEMBITS_EVENTENVELOPEPOINT \
0x01000000 /* Event envelope point object+s */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCEPOOL \
0x02000000 /* Event instance pool data */
#define FMOD_EVENT_MEMBITS_ALL \
0xffffffff /* All memory used by FMOD Event System */
/* All event instance memory */
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_GROUP (FMOD_EVENT_MEMBITS_EVENTINSTANCE | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_COMPLEX | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_SIMPLE | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_LAYER | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_SOUND)
#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_GROUP \
(FMOD_EVENT_MEMBITS_EVENTINSTANCE | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_COMPLEX | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_SIMPLE | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_LAYER | \
FMOD_EVENT_MEMBITS_EVENTINSTANCE_SOUND)
/* All sound definition memory */
#define FMOD_EVENT_MEMBITS_SOUNDDEF_GROUP (FMOD_EVENT_MEMBITS_SOUNDDEFCLASS | \
FMOD_EVENT_MEMBITS_SOUNDDEFDEFCLASS | \
FMOD_EVENT_MEMBITS_SOUNDDEFPOOL)
#define FMOD_EVENT_MEMBITS_SOUNDDEF_GROUP \
(FMOD_EVENT_MEMBITS_SOUNDDEFCLASS | FMOD_EVENT_MEMBITS_SOUNDDEFDEFCLASS | \
FMOD_EVENT_MEMBITS_SOUNDDEFPOOL)
/* [DEFINE_END] */
#endif
+118 -50
View File
@@ -1,11 +1,17 @@
/* ==================================================================================================== */
/* FMOD Ex - output development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
/* ====================================================================================================
*/
/* FMOD Ex - output development header file. Copyright (c), Firelight
* Technologies Pty, Ltd. 2004-2016. */
/* */
/* Use this header if you are wanting to develop your own output plugin to use with */
/* FMOD's output system. With this header you can make your own output plugin that FMOD */
/* can register and use. See the documentation and examples on how to make a working plugin. */
/* Use this header if you are wanting to develop your own output plugin to use
* with */
/* FMOD's output system. With this header you can make your own output plugin
* that FMOD */
/* can register and use. See the documentation and examples on how to make a
* working plugin. */
/* */
/* ==================================================================================================== */
/* ====================================================================================================
*/
#ifndef _FMOD_OUTPUT_H
#define _FMOD_OUTPUT_H
@@ -16,78 +22,140 @@ typedef struct FMOD_OUTPUT_STATE FMOD_OUTPUT_STATE;
/*
Output callbacks
*/
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETNUMDRIVERSCALLBACK)(FMOD_OUTPUT_STATE *output_state, int *numdrivers);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERNAMECALLBACK)(FMOD_OUTPUT_STATE *output_state, int id, char *name, int namelen);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERCAPSCALLBACK)(FMOD_OUTPUT_STATE *output_state, int id, FMOD_CAPS *caps);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_INITCALLBACK) (FMOD_OUTPUT_STATE *output_state, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, int outputchannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, void *extradriverdata);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_CLOSECALLBACK) (FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UPDATECALLBACK) (FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETHANDLECALLBACK) (FMOD_OUTPUT_STATE *output_state, void **handle);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETPOSITIONCALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int *pcm);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_LOCKCALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UNLOCKCALLBACK) (FMOD_OUTPUT_STATE *output_state, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_READFROMMIXER) (FMOD_OUTPUT_STATE *output_state, void *buffer, unsigned int length);
*/
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_GETNUMDRIVERSCALLBACK)(
FMOD_OUTPUT_STATE *output_state, int *numdrivers);
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_GETDRIVERNAMECALLBACK)(
FMOD_OUTPUT_STATE *output_state, int id, char *name, int namelen);
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_GETDRIVERCAPSCALLBACK)(
FMOD_OUTPUT_STATE *output_state, int id, FMOD_CAPS *caps);
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_INITCALLBACK)(
FMOD_OUTPUT_STATE *output_state,
int selecteddriver,
FMOD_INITFLAGS flags,
int *outputrate,
int outputchannels,
FMOD_SOUND_FORMAT *outputformat,
int dspbufferlength,
int dspnumbuffers,
void *extradriverdata);
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_CLOSECALLBACK)(
FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_UPDATECALLBACK)(
FMOD_OUTPUT_STATE *output_state);
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_GETHANDLECALLBACK)(
FMOD_OUTPUT_STATE *output_state, void **handle);
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_GETPOSITIONCALLBACK)(
FMOD_OUTPUT_STATE *output_state, unsigned int *pcm);
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_LOCKCALLBACK)(
FMOD_OUTPUT_STATE *output_state,
unsigned int offset,
unsigned int length,
void **ptr1,
void **ptr2,
unsigned int *len1,
unsigned int *len2);
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_UNLOCKCALLBACK)(
FMOD_OUTPUT_STATE *output_state,
void *ptr1,
void *ptr2,
unsigned int len1,
unsigned int len2);
typedef FMOD_RESULT(F_CALLBACK *FMOD_OUTPUT_READFROMMIXER)(
FMOD_OUTPUT_STATE *output_state, void *buffer, unsigned int length);
/*
[STRUCTURE]
[STRUCTURE]
[
[DESCRIPTION]
When creating an output, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file of this type.
When creating an output, declare one of these and provide the relevant
callbacks and name for FMOD to use when it opens and reads a file of this type.
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.<br>
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
Members marked with [in] mean the variable can be written to. The user can
set the value.<br> Members marked with [out] mean the variable is modified by
FMOD and is for reading purposes only. Do not change this value.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable,
PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_OUTPUT_STATE
]
*/
typedef struct FMOD_OUTPUT_DESCRIPTION
{
const char *name; /* [in] Name of the output. */
unsigned int version; /* [in] Plugin writer's version number. */
int polling; /* [in] If TRUE (non zero), this tells FMOD to start a thread and call getposition / lock / unlock for feeding data. If 0, the output is probably callback based, so all the plugin needs to do is call readfrommixer to the appropriate pointer. */
FMOD_OUTPUT_GETNUMDRIVERSCALLBACK getnumdrivers; /* [in] For sound device enumeration. This callback is to give System::getNumDrivers somthing to return. */
FMOD_OUTPUT_GETDRIVERNAMECALLBACK getdrivername; /* [in] For sound device enumeration. This callback is to give System::getDriverName somthing to return. */
FMOD_OUTPUT_GETDRIVERCAPSCALLBACK getdrivercaps; /* [in] For sound device enumeration. This callback is to give System::getDriverCaps somthing to return. */
FMOD_OUTPUT_INITCALLBACK init; /* [in] Initialization function for the output device. This is called from System::init. */
FMOD_OUTPUT_CLOSECALLBACK close; /* [in] Cleanup / close down function for the output device. This is called from System::close. */
FMOD_OUTPUT_UPDATECALLBACK update; /* [in] Update function that is called once a frame by the user. This is called from System::update. */
FMOD_OUTPUT_GETHANDLECALLBACK gethandle; /* [in] This is called from System::getOutputHandle. This is just to return a pointer to the internal system device object that the system may be using.*/
FMOD_OUTPUT_GETPOSITIONCALLBACK getposition; /* [in] This is called from the FMOD software mixer thread if 'polling' = true. This returns a position value in samples so that FMOD knows where and when to fill its buffer. */
FMOD_OUTPUT_LOCKCALLBACK lock; /* [in] This is called from the FMOD software mixer thread if 'polling' = true. This function provides a pointer to data that FMOD can write to when software mixing. */
FMOD_OUTPUT_UNLOCKCALLBACK unlock; /* [in] This is called from the FMOD software mixer thread if 'polling' = true. This optional function accepts the data that has been mixed and copies it or does whatever it needs to before sending it to the hardware. */
typedef struct FMOD_OUTPUT_DESCRIPTION {
const char *name; /* [in] Name of the output. */
unsigned int version; /* [in] Plugin writer's version number. */
int polling; /* [in] If TRUE (non zero), this tells FMOD to start a thread and
call getposition / lock / unlock for feeding data. If 0, the
output is probably callback based, so all the plugin needs to
do is call readfrommixer to the appropriate pointer. */
FMOD_OUTPUT_GETNUMDRIVERSCALLBACK
getnumdrivers; /* [in] For sound device enumeration. This callback is to
give System::getNumDrivers somthing to return. */
FMOD_OUTPUT_GETDRIVERNAMECALLBACK
getdrivername; /* [in] For sound device enumeration. This callback is to
give System::getDriverName somthing to return. */
FMOD_OUTPUT_GETDRIVERCAPSCALLBACK
getdrivercaps; /* [in] For sound device enumeration. This callback is to
give System::getDriverCaps somthing to return. */
FMOD_OUTPUT_INITCALLBACK
init; /* [in] Initialization function for the output device. This is
called from System::init. */
FMOD_OUTPUT_CLOSECALLBACK
close; /* [in] Cleanup / close down function for the output device. This
is called from System::close. */
FMOD_OUTPUT_UPDATECALLBACK
update; /* [in] Update function that is called once a frame by the user.
This is called from System::update. */
FMOD_OUTPUT_GETHANDLECALLBACK
gethandle; /* [in] This is called from System::getOutputHandle. This is
just to return a pointer to the internal system device
object that the system may be using.*/
FMOD_OUTPUT_GETPOSITIONCALLBACK
getposition; /* [in] This is called from the FMOD software mixer thread if
'polling' = true. This returns a position value in
samples so that FMOD knows where and when to fill its
buffer. */
FMOD_OUTPUT_LOCKCALLBACK
lock; /* [in] This is called from the FMOD software mixer thread if
'polling' = true. This function provides a pointer to data that
FMOD can write to when software mixing. */
FMOD_OUTPUT_UNLOCKCALLBACK
unlock; /* [in] This is called from the FMOD software mixer thread if
'polling' = true. This optional function accepts the data that
has been mixed and copies it or does whatever it needs to
before sending it to the hardware. */
} FMOD_OUTPUT_DESCRIPTION;
/*
[STRUCTURE]
[STRUCTURE]
[
[DESCRIPTION]
Output plugin structure that is passed into each callback.
[REMARKS]
Members marked with [in] mean the variable can be written to. The user can set the value.<br>
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
Members marked with [in] mean the variable can be written to. The user can
set the value.<br> Members marked with [out] mean the variable is modified by
FMOD and is for reading purposes only. Do not change this value.<br>
[PLATFORMS]
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android
Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable,
PlayStation 3, Wii, iPhone, 3GS, NGP, Android
[SEE_ALSO]
FMOD_OUTPUT_DESCRIPTION
]
*/
struct FMOD_OUTPUT_STATE
{
void *plugindata; /* [in] Plugin writer created data the output author wants to attach to this object. */
FMOD_OUTPUT_READFROMMIXER readfrommixer; /* [out] Function to update mixer and write the result to the provided pointer. Used from callback based output only. Polling based output uses lock/unlock/getposition. */
struct FMOD_OUTPUT_STATE {
void *plugindata; /* [in] Plugin writer created data the output author wants
to attach to this object. */
FMOD_OUTPUT_READFROMMIXER
readfrommixer; /* [out] Function to update mixer and write the result to
the provided pointer. Used from callback based output
only. Polling based output uses
lock/unlock/getposition. */
};
#endif
+14 -12
View File
@@ -1,19 +1,21 @@
/* =========================================================================================== */
/* FMOD Linux Specific header file. Copyright (c), Firelight Technologies Pty, Ltd. 2005-2016. */
/* =========================================================================================== */
/* ===========================================================================================
*/
/* FMOD Linux Specific header file. Copyright (c), Firelight Technologies Pty,
* Ltd. 2005-2016. */
/* ===========================================================================================
*/
#ifndef _FMODLINUX_H
#define _FMODLINUX_H
#include "fmod.h"
/*
[STRUCTURE]
[STRUCTURE]
[
[DESCRIPTION]
Use this structure with System::init to set the information required for linux
initialisation.
Use this structure with System::init to set the information required for
linux initialisation.
Pass this structure in as the "extradriverdata" parameter in System::init.
@@ -26,11 +28,11 @@
System::init
]
*/
typedef struct FMOD_LINUX_EXTRADRIVERDATA
{
const char *output_driver_arguments; /* ALSA Only - Arguments to apply to the selected output driver */
const char *record_driver_arguments; /* ALSA Only - Arguments to apply to the selected input (record) driver */
typedef struct FMOD_LINUX_EXTRADRIVERDATA {
const char *output_driver_arguments; /* ALSA Only - Arguments to apply to the
selected output driver */
const char *record_driver_arguments; /* ALSA Only - Arguments to apply to the
selected input (record) driver */
} FMOD_LINUX_EXTRADRIVERDATA;
#endif