⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fmod.h

📁 一个96K的3D游戏源码
💻 H
📖 第 1 页 / 共 4 页
字号:
/* ========================================================================================== */
/* FMOD Main header file. Copyright (c), Firelight Technologies Pty, Ltd 1999-2002.           */
/* ========================================================================================== */

#ifndef _FMOD_H_
#define _FMOD_H_

/* ========================================================================================== */
/* DEFINITIONS                                                                                */
/* ========================================================================================== */

#if defined(__linux__) || (defined(__GNUC__) && defined(WIN32))
    #ifndef _cdecl
        #define _cdecl 
    #endif
    #ifndef _stdcall
        #define _stdcall
    #endif
#endif 

#define F_API _stdcall

#ifdef DLL_EXPORTS
    #define DLL_API __declspec(dllexport)
#else
    #if defined(__LCC__) || defined(__MINGW32__) || defined(__CYGWIN32__)
        #define DLL_API F_API
    #else
        #define DLL_API
    #endif /* __LCC__ ||  __MINGW32__ || __CYGWIN32__ */
#endif /* DLL_EXPORTS */

#define FMOD_VERSION    3.5f

/* 
    FMOD defined types 
*/
typedef struct FSOUND_SAMPLE    FSOUND_SAMPLE;
typedef struct FSOUND_STREAM    FSOUND_STREAM;
typedef struct FSOUND_DSPUNIT   FSOUND_DSPUNIT;
typedef struct FMUSIC_MODULE    FMUSIC_MODULE;
typedef struct FSOUND_MATERIAL  FSOUND_MATERIAL;
typedef struct FSOUND_GEOMLIST  FSOUND_GEOMLIST;

/* 
    Callback types
*/
typedef void *      (_cdecl *FSOUND_DSPCALLBACK)    (void *originalbuffer, void *newbuffer, int length, int param);
typedef signed char (_cdecl *FSOUND_STREAMCALLBACK) (FSOUND_STREAM *stream, void *buff, int len, int param);
typedef void *      (_cdecl *FSOUND_ALLOCCALLBACK)  (unsigned int size);
typedef void *      (_cdecl *FSOUND_REALLOCCALLBACK)(void *ptr, unsigned int size);
typedef void        (_cdecl *FSOUND_FREECALLBACK)   (void *ptr);
typedef unsigned int(_cdecl *FSOUND_OPENCALLBACK)   (const char *name);
typedef void        (_cdecl *FSOUND_CLOSECALLBACK)  (unsigned int handle);
typedef int         (_cdecl *FSOUND_READCALLBACK)   (void *buffer, int size, unsigned int handle);
typedef int         (_cdecl *FSOUND_SEEKCALLBACK)   (unsigned int handle, int pos, signed char mode);
typedef int         (_cdecl *FSOUND_TELLCALLBACK)   (unsigned int handle);
typedef void        (_cdecl *FMUSIC_CALLBACK)       (FMUSIC_MODULE *mod, unsigned char param);


/*
[ENUM]
[
    [DESCRIPTION]   
    On failure of commands in FMOD, use FSOUND_GetError to attain what happened.
    
    [SEE_ALSO]      
    FSOUND_GetError
]
*/
enum FMOD_ERRORS 
{
    FMOD_ERR_NONE,             /* No errors */
    FMOD_ERR_BUSY,             /* Cannot call this command after FSOUND_Init.  Call FSOUND_Close first. */
    FMOD_ERR_UNINITIALIZED,    /* This command failed because FSOUND_Init or FSOUND_SetOutput was not called */
    FMOD_ERR_INIT,             /* Error initializing output device. */
    FMOD_ERR_ALLOCATED,        /* Error initializing output device, but more specifically, the output device is already in use and cannot be reused. */
    FMOD_ERR_PLAY,             /* Playing the sound failed. */
    FMOD_ERR_OUTPUT_FORMAT,    /* Soundcard does not support the features needed for this soundsystem (16bit stereo output) */
    FMOD_ERR_COOPERATIVELEVEL, /* Error setting cooperative level for hardware. */
    FMOD_ERR_CREATEBUFFER,     /* Error creating hardware sound buffer. */
    FMOD_ERR_FILE_NOTFOUND,    /* File not found */
    FMOD_ERR_FILE_FORMAT,      /* Unknown file format */
    FMOD_ERR_FILE_BAD,         /* Error loading file */
    FMOD_ERR_MEMORY,           /* Not enough memory or resources */
    FMOD_ERR_VERSION,          /* The version number of this file format is not supported */
    FMOD_ERR_INVALID_PARAM,    /* An invalid parameter was passed to this function */
    FMOD_ERR_NO_EAX,           /* Tried to use an EAX command on a non EAX enabled channel or output. */
    FMOD_ERR_CHANNEL_ALLOC,    /* Failed to allocate a new channel */
    FMOD_ERR_RECORD,           /* Recording is not supported on this machine */
    FMOD_ERR_MEDIAPLAYER,      /* Windows Media Player not installed so cannot play wma or use internet streaming. */
};


/*
[ENUM]
[
    [DESCRIPTION]   
    These output types are used with FSOUND_SetOutput, to choose which output driver to use.
    
    FSOUND_OUTPUT_DSOUND will not support hardware 3d acceleration if the sound card driver 
    does not support DirectX 6 Voice Manager Extensions.

    FSOUND_OUTPUT_WINMM is recommended for NT and CE.

    [SEE_ALSO]      
    FSOUND_SetOutput
    FSOUND_GetOutput
]
*/
enum FSOUND_OUTPUTTYPES
{
    FSOUND_OUTPUT_NOSOUND,    /* NoSound driver, all calls to this succeed but do nothing. */
    FSOUND_OUTPUT_WINMM,      /* Windows Multimedia driver. */
    FSOUND_OUTPUT_DSOUND,     /* DirectSound driver.  You need this to get EAX2 or EAX3 support, or FX api support. */
    FSOUND_OUTPUT_A3D,        /* A3D driver.  You need this to get geometry support. */

    FSOUND_OUTPUT_OSS,        /* Linux/Unix OSS (Open Sound System) driver, i.e. the kernel sound drivers. */
    FSOUND_OUTPUT_ESD,        /* Linux/Unix ESD (Enlightment Sound Daemon) driver. */
    FSOUND_OUTPUT_ALSA,       /* Linux Alsa driver. */

    FSOUND_OUTPUT_XBOX        /* Xbox driver */
};


/*
[ENUM]
[
    [DESCRIPTION]   
    These mixer types are used with FSOUND_SetMixer, to choose which mixer to use, or to act 
    upon for other reasons using FSOUND_GetMixer.
    It is not nescessary to set the mixer.  FMOD will autodetect the best mixer for you.

    [SEE_ALSO]      
    FSOUND_SetMixer
    FSOUND_GetMixer
]
*/
enum FSOUND_MIXERTYPES
{
    FSOUND_MIXER_AUTODETECT,        /* Windows CE only - Non interpolating/low quality mixer. */
    FSOUND_MIXER_BLENDMODE,         /* removed / obsolete. */
    FSOUND_MIXER_MMXP5,             /* removed / obsolete. */
    FSOUND_MIXER_MMXP6,             /* removed / obsolete. */

    FSOUND_MIXER_QUALITY_AUTODETECT,/* All platforms - Autodetect the fastest quality mixer based on your cpu. */
    FSOUND_MIXER_QUALITY_FPU,       /* Win32/Linux only - Interpolating/volume ramping FPU mixer.  */
    FSOUND_MIXER_QUALITY_MMXP5,     /* Win32/Linux only - Interpolating/volume ramping P5 MMX mixer.  */
    FSOUND_MIXER_QUALITY_MMXP6,     /* Win32/Linux only - Interpolating/volume ramping ppro+ MMX mixer. */

    FSOUND_MIXER_MONO,              /* Windows CE only - MONO non interpolating/low quality mixer. For speed*/
    FSOUND_MIXER_QUALITY_MONO       /* Windows CE only - MONO Interpolating mixer.  For speed */
};


/*
[ENUM]
[
    [DESCRIPTION]   
    These definitions describe the type of song being played.

    [SEE_ALSO]      
    FMUSIC_GetType  
]
*/
enum FMUSIC_TYPES
{
    FMUSIC_TYPE_NONE,       
    FMUSIC_TYPE_MOD,        /* Protracker / Fasttracker */
    FMUSIC_TYPE_S3M,        /* ScreamTracker 3 */
    FMUSIC_TYPE_XM,         /* FastTracker 2 */
    FMUSIC_TYPE_IT,         /* Impulse Tracker. */
    FMUSIC_TYPE_MIDI,       /* MIDI file */
};


/*
[DEFINE_START] 
[
    [NAME] 
    FSOUND_DSP_PRIORITIES

    [DESCRIPTION]   
    These default priorities are used by FMOD internal system DSP units.  They describe the 
    position of the DSP chain, and the order of how audio processing is executed.
    You can actually through the use of FSOUND_DSP_GetxxxUnit (where xxx is the name of the DSP
    unit), disable or even change the priority of a DSP unit.

    [SEE_ALSO]      
    FSOUND_DSP_Create
    FSOUND_DSP_SetPriority
    FSOUND_DSP_GetSpectrum
]
*/
#define FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT        0       /* DSP CLEAR unit - done first */
#define FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT          100     /* DSP SFX unit - done second */
#define FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT        200     /* DSP MUSIC unit - done third */
#define FSOUND_DSP_DEFAULTPRIORITY_USER             300     /* User priority, use this as reference */
#define FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT          900     /* This reads data for FSOUND_DSP_GetSpectrum, so it comes after user units */
#define FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT  1000    /* DSP CLIP AND COPY unit - last */
/* [DEFINE_END] */


/*
[DEFINE_START] 
[
    [NAME] 
    FSOUND_CAPS

    [DESCRIPTION]   
    Driver description bitfields.  Use FSOUND_Driver_GetCaps to determine if a driver enumerated
    has the settings you are after.  The enumerated driver depends on the output mode, see
    FSOUND_OUTPUTTYPES

    [SEE_ALSO]
    FSOUND_GetDriverCaps
    FSOUND_OUTPUTTYPES
]
*/
#define FSOUND_CAPS_HARDWARE                0x1     /* This driver supports hardware accelerated 3d sound. */
#define FSOUND_CAPS_EAX2                    0x2     /* This driver supports EAX 2 reverb */
#define FSOUND_CAPS_GEOMETRY_OCCLUSIONS     0x4     /* This driver supports (A3D) geometry occlusions */
#define FSOUND_CAPS_GEOMETRY_REFLECTIONS    0x8     /* This driver supports (A3D) geometry reflections */
#define FSOUND_CAPS_EAX3                    0x10    /* This driver supports EAX 3 reverb */
/* [DEFINE_END] */


/*
[DEFINE_START] 
[
    [NAME] 
    FSOUND_MODES
    
    [DESCRIPTION]   
    Sample description bitfields, OR them together for loading and describing samples.
    NOTE.  If the file format being loaded already has a defined format, such as WAV or MP3, then 
    trying to override the pre-defined format with a new set of format flags will not work.  For
    example, an 8 bit WAV file will not load as 16bit if you specify FSOUND_16BITS.  It will just
    ignore the flag and go ahead loading it as 8bits.  For these type of formats the only flags
    you can specify that will really alter the behaviour of how it is loaded, are the following.

    FSOUND_LOOP_OFF     
    FSOUND_LOOP_NORMAL  
    FSOUND_LOOP_BIDI    
    FSOUND_HW3D
    FSOUND_2D
    FSOUND_STREAMABLE   
    FSOUND_LOADMEMORY   
    FSOUND_LOADRAW          
    FSOUND_MPEGACCURATE     

    See flag descriptions for what these do.
]
*/
#define FSOUND_LOOP_OFF     0x00000001  /* For non looping samples. */
#define FSOUND_LOOP_NORMAL  0x00000002  /* For forward looping samples. */
#define FSOUND_LOOP_BIDI    0x00000004  /* For bidirectional looping samples.  (no effect if in hardware). */
#define FSOUND_8BITS        0x00000008  /* For 8 bit samples. */
#define FSOUND_16BITS       0x00000010  /* For 16 bit samples. */
#define FSOUND_MONO         0x00000020  /* For mono samples. */
#define FSOUND_STEREO       0x00000040  /* For stereo samples. */
#define FSOUND_UNSIGNED     0x00000080  /* For user created source data containing unsigned samples. */
#define FSOUND_SIGNED       0x00000100  /* For user created source data containing signed data. */
#define FSOUND_DELTA        0x00000200  /* For user created source data stored as delta values. */
#define FSOUND_IT214        0x00000400  /* For user created source data stored using IT214 compression. */
#define FSOUND_IT215        0x00000800  /* For user created source data stored using IT215 compression. */
#define FSOUND_HW3D         0x00001000  /* Attempts to make samples use 3d hardware acceleration. (if the card supports it) */
#define FSOUND_2D           0x00002000  /* Ignores any 3d processing.  Overrides FSOUND_HW3D.  Located in software. */
#define FSOUND_STREAMABLE   0x00004000  /* For a streamomg sound where you feed the data to it.  If you dont supply this sound may come out corrupted.  (only affects a3d output) */
#define FSOUND_LOADMEMORY   0x00008000  /* "name" will be interpreted as a pointer to data for streaming and samples. */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -