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

📄 fmod.h

📁 一个小飞机游戏
💻 H
📖 第 1 页 / 共 3 页
字号:
/* ========================================================================================== */
/* FMOD Main header file. Copyright (c), FireLight Multimedia 1999-2001.                      */
/* ========================================================================================== */

#ifndef _FMOD_H_
#define _FMOD_H_

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

#if defined(PLATFORM_LINUX) || defined(__linux__) || (defined(__GNUC__) && defined(WIN32))
    #ifndef _cdecl
        #define _cdecl 
    #endif
    #ifndef _stdcall
        #define _stdcall
    #endif
    #define __PS __attribute__((packed)) /* gcc packed */
#else 
    #define __PS /*dummy*/
#endif 

#define F_API _stdcall

#ifdef DLL_EXPORTS
	#define DLL_API __declspec(dllexport)
#else
	#ifdef __LCC__
		#define DLL_API F_API
	#else
		#define DLL_API
	#endif /* __LCC__ */
#endif /* DLL_EXPORTS */



#define FMOD_VERSION	3.4f


/* 
    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 signed char (_cdecl *FSOUND_STREAMCALLBACK)	(FSOUND_STREAM *stream, void *buff, int len, int param);
typedef void *		(_cdecl *FSOUND_DSPCALLBACK)	(void *originalbuffer, void *newbuffer, int length, int param);
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  */
	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_NO_EAX2,		   /* Tried to use an advanced EAX2 command on a non EAX2 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 noaward. */
	FSOUND_OUTPUT_WINMM,      /* Windows Multimedia driver. */
	FSOUND_OUTPUT_DSOUND,     /* DirectSound driver.  You need this to get EAX or EAX2 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. */
};


/*
[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.

	[SEE_ALSO]		
	FSOUND_SetMixer
	FSOUND_GetMixer
]
*/
enum FSOUND_MIXERTYPES
{
	FSOUND_MIXER_AUTODETECT,		/* Enables autodetection of the fastest mixer based on your cpu. */
	FSOUND_MIXER_BLENDMODE,			/* Enables the standard non mmx, blendmode mixer. */
	FSOUND_MIXER_MMXP5,				/* Enables the mmx, pentium optimized blendmode mixer. */
	FSOUND_MIXER_MMXP6,				/* Enables the mmx, ppro/p2/p3 optimized mixer. */

	FSOUND_MIXER_QUALITY_AUTODETECT,/* Enables autodetection of the fastest quality mixer based on your cpu. */
	FSOUND_MIXER_QUALITY_FPU,		/* Enables the interpolating/volume ramping FPU mixer.  */
	FSOUND_MIXER_QUALITY_MMXP5,		/* Enables the interpolating/volume ramping p5 MMX mixer.  */
	FSOUND_MIXER_QUALITY_MMXP6,		/* Enables the interpolating/volume ramping ppro/p2/p3+ MMX mixer.  */
};


/*
[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 

	[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_EAX						0x2		/* This driver supports EAX 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_EAX2					0x10	/* This driver supports EAX2/A3D3 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 source data containing unsigned samples. */
#define FSOUND_SIGNED		0x00000100	/* For source data containing signed data. */
#define FSOUND_DELTA		0x00000200	/* For source data stored as delta values. */
#define FSOUND_IT214		0x00000400	/* For source data stored using IT214 compression. */
#define FSOUND_IT215		0x00000800	/* For 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. */
#define FSOUND_LOADRAW		0x00010000	/* Will ignore file format and treat as raw pcm. */
#define FSOUND_MPEGACCURATE	0x00020000	/* For FSOUND_Stream_OpenFile - for accurate FSOUND_Stream_GetLengthMs/FSOUND_Stream_SetTime.  WARNING, see FSOUNDStream_OpenFile for inital opening time performance issues. */
#define FSOUND_FORCEMONO    0x00040000  /* For forcing stereo streams and samples to be mono - needed with FSOUND_HW3D - incurs speed hit */
#define FSOUND_HW2D         0x00080000  /* 2D hardware sounds.  allows hardware specific effects */
#define FSOUND_ENABLEFX     0x00100000  /* Allows DX8 FX to be played back on a sound.  Requires DirectX 8 - Note these sounds cannot be played more than once, be 8 bit, be less than a certain size, or have a changing frequency */

/* 
    FSOUND_NORMAL is a default sample type.  Loop off, 8bit mono, signed, not hardware 
    accelerated.  Some API functions ignore 8bits and mono, as it may be an mpeg/wav/etc which 
    has its format predetermined.
*/
#define FSOUND_NORMAL		(FSOUND_LOOP_OFF | FSOUND_8BITS | FSOUND_MONO)		
/* [DEFINE_END] */


/*
[DEFINE_START] 
[
 	[NAME] 
	FSOUND_CDPLAYMODES
	
	[DESCRIPTION]	
	Playback method for a CD Audio track, using FSOUND_CD_Play

	[SEE_ALSO]		
	FSOUND_CD_Play
]
*/
#define FSOUND_CD_PLAYCONTINUOUS	0	/* Starts from the current track and plays to end of CD. */
#define FSOUND_CD_PLAYONCE			1	/* Plays the specified track then stops. */
#define FSOUND_CD_PLAYLOOPED		2	/* Plays the specified track looped, forever until stopped manually. */
#define FSOUND_CD_PLAYRANDOM		3	/* Plays tracks in random order */
/* [DEFINE_END] */


/*
[DEFINE_START] 
[
 	[NAME] 
	FSOUND_MISC_VALUES
	
	[DESCRIPTION]
	Miscellaneous values for FMOD functions.

	[SEE_ALSO]
	FSOUND_PlaySound
	FSOUND_PlaySoundEx
	FSOUND_Sample_Alloc
	FSOUND_Sample_Load
	FSOUND_SetPan
]
*/
#define FSOUND_FREE			    -1	    /* value to play on any free channel, or to allocate a sample in a free sample slot. */
#define FSOUND_UNMANAGED    	-2	    /* value to allocate a sample that is NOT managed by FSOUND or placed in a sample slot. */
#define FSOUND_ALL			    -3	    /* for a channel index , this flag will affect ALL channels available!  Not supported by every function. */
#define FSOUND_STEREOPAN	    -1	    /* value for FSOUND_SetPan so that stereo sounds are not played at half volume.  See FSOUND_SetPan for more on this. */
#define FSOUND_SYSTEMCHANNEL    -1000   /* special channel ID for channel based functions that want to alter the global FSOUND software mixing output channel */
/* [DEFINE_END] */


/*
[ENUM]
[
	[DESCRIPTION]	
	These are environment types defined for use with the FSOUND_Reverb API.

	[SEE_ALSO]		
	FSOUND_Reverb_SetEnvironment
	FSOUND_Reverb_SetEnvironmentAdvanced
]
*/
enum FSOUND_REVERB_ENVIRONMENTS

⌨️ 快捷键说明

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