Clean up header files of sound library:
* Change file-specific comments into Doxygen comments * Remove a whole load of unused and unnecessary macros * When compiling as C++ make sure to use C linkage git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3627 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
fe397ef7f9
commit
6ddb4af1d5
|
@ -17,24 +17,19 @@
|
|||
along with Warzone 2100; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/***************************************************************************/
|
||||
/*
|
||||
* Aud.h
|
||||
*
|
||||
* Audio wrapper functions
|
||||
*
|
||||
* Gareth Jones 16/12/97
|
||||
/** \file
|
||||
* Audio wrapper functions
|
||||
*/
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef _AUD_H_
|
||||
#define _AUD_H_
|
||||
|
||||
/***************************************************************************/
|
||||
#ifndef __INCLUDED_LIB_SOUND_AUD_H__
|
||||
#define __INCLUDED_LIB_SOUND_AUD_H__
|
||||
|
||||
#include "audio.h"
|
||||
|
||||
/***************************************************************************/
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
void audio_GetObjectPos( void *psObj, SDWORD *piX, SDWORD *piY,
|
||||
SDWORD *piZ );
|
||||
|
@ -44,8 +39,8 @@ BOOL audio_ObjectDead( void * psObj );
|
|||
void audio_Get3DPlayerPos( SDWORD *piX, SDWORD *piY, SDWORD *piZ );
|
||||
void audio_Get3DPlayerRotAboutVerticalAxis( SDWORD *piA );
|
||||
|
||||
/***************************************************************************/
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _AUD_H_ */
|
||||
|
||||
/***************************************************************************/
|
||||
#endif // __INCLUDED_LIB_SOUND_AUD_H__
|
||||
|
|
|
@ -18,11 +18,16 @@
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _AUDIO_H_
|
||||
#define _AUDIO_H_
|
||||
#ifndef __INCLUDED_LIB_SOUND_AUDIO_H__
|
||||
#define __INCLUDED_LIB_SOUND_AUDIO_H__
|
||||
|
||||
#include "track.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern BOOL audio_Init( AUDIO_CALLBACK pStopTrackCallback );
|
||||
extern void audio_Update(void);
|
||||
extern BOOL audio_Shutdown(void);
|
||||
|
@ -65,4 +70,8 @@ extern unsigned int audio_GetSampleQueueCount(void);
|
|||
extern unsigned int audio_GetSampleListCount(void);
|
||||
extern unsigned int sound_GetActiveSamplesCount(void);
|
||||
|
||||
#endif // _AUDIO_H_
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __INCLUDED_LIB_SOUND_AUDIO_H__
|
||||
|
|
|
@ -18,8 +18,13 @@
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _AUDIO_ID_H_
|
||||
#define _AUDIO_ID_H_
|
||||
#ifndef __INCLUDED_LIB_SOUND_AUDIO_ID_H__
|
||||
#define __INCLUDED_LIB_SOUND_AUDIO_ID_H__
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* INGAME AUDIO */
|
||||
|
||||
|
@ -494,4 +499,8 @@ INGAME_AUDIO;
|
|||
|
||||
INGAME_AUDIO audio_GetIDFromStr(const char *pWavStr);
|
||||
|
||||
#endif // _AUDIO_ID_H_
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __INCLUDED_LIB_SOUND_AUDIO_ID_H__
|
||||
|
|
|
@ -18,8 +18,13 @@
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _CDAUDIO_H_
|
||||
#define _CDAUDIO_H_
|
||||
#ifndef __INCLUDED_LIB_SOUND_CDAUDIO_H__
|
||||
#define __INCLUDED_LIB_SOUND_CDAUDIO_H__
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
BOOL cdAudio_Open(const char* user_musicdir);
|
||||
void cdAudio_Close(void);
|
||||
|
@ -28,4 +33,8 @@ void cdAudio_Stop(void);
|
|||
void cdAudio_Pause(void);
|
||||
void cdAudio_Resume(void);
|
||||
|
||||
#endif /* _CDAUDIO_H_ */
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __INCLUDED_LIB_SOUND_CDAUDIO_H__
|
||||
|
|
|
@ -17,17 +17,17 @@
|
|||
along with Warzone 2100; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef _MIXER_H_
|
||||
#define _MIXER_H_
|
||||
|
||||
/***************************************************************************/
|
||||
#ifndef __INCLUDED_LIB_SOUND_MIXER_H__
|
||||
#define __INCLUDED_LIB_SOUND_MIXER_H__
|
||||
|
||||
#include "lib/framework/frame.h"
|
||||
#include "audio.h"
|
||||
|
||||
/***************************************************************************/
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
float sound_GetMusicVolume(void);
|
||||
void sound_SetMusicVolume(float volume);
|
||||
|
@ -36,8 +36,8 @@ void sound_SetUIVolume(float volume);
|
|||
float sound_GetEffectsVolume(void);
|
||||
void sound_SetEffectsVolume(float volume);
|
||||
|
||||
/***************************************************************************/
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // #ifndef _MIXER_H_
|
||||
|
||||
/***************************************************************************/
|
||||
#endif // __INCLUDED_LIB_SOUND_MIXER_H__
|
||||
|
|
|
@ -23,6 +23,11 @@
|
|||
#include "lib/framework/frame.h"
|
||||
#include <physfs.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// the size of the data contained in *data (NOTE: this is *NOT* the size of *data itself)
|
||||
|
@ -51,4 +56,8 @@ void sound_DestroyOggVorbisDecoder(struct OggVorbisDecoderState* decoder);
|
|||
|
||||
soundDataBuffer* sound_DecodeOggVorbis(struct OggVorbisDecoderState* decoder, size_t bufferSize);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _LIBSOUND_OGGVORBIS_H_
|
||||
|
|
|
@ -32,6 +32,11 @@
|
|||
# include <AL/alc.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern ALenum __sound_GetError(const char* location_description);
|
||||
extern ALenum __sound_GetDeviceError(ALCdevice* device, const char* location_description);
|
||||
|
||||
|
@ -55,4 +60,8 @@ extern ALenum __sound_GetDeviceError(ALCdevice* device, const char* location_des
|
|||
# define sound_GetDeviceError(err_code) ALC_NO_ERROR
|
||||
#endif // !defined(WZ_NOSOUND)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __INCLUDED_LIB_SOUND_OPENAL_ERROR_H__
|
||||
|
|
|
@ -18,11 +18,16 @@
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _PLAYLIST_H_
|
||||
#define _PLAYLIST_H_
|
||||
#ifndef __INCLUDED_LIB_SOUND_PLAYLIST_H__
|
||||
#define __INCLUDED_LIB_SOUND_PLAYLIST_H__
|
||||
|
||||
#include "lib/framework/types.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
void PlayList_Init(void);
|
||||
void PlayList_Quit(void);
|
||||
bool PlayList_Read(const char* path);
|
||||
|
@ -30,4 +35,8 @@ void PlayList_SetTrack(unsigned int t);
|
|||
const char* PlayList_CurrentSong(void);
|
||||
const char* PlayList_NextSong(void);
|
||||
|
||||
#endif /* _PLAYLIST_H_ */
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __INCLUDED_LIB_SOUND_PLAYLIST_H__
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _TRACK_H_
|
||||
#define _TRACK_H_
|
||||
|
||||
/* defines */
|
||||
#ifndef __INCLUDED_LIB_SOUND_TRACK_H__
|
||||
#define __INCLUDED_LIB_SOUND_TRACK_H__
|
||||
|
||||
#include "lib/framework/frame.h"
|
||||
#include <physfs.h>
|
||||
|
@ -34,32 +32,23 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MAX_STR
|
||||
#define MAX_STR 255
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#define MAX_PITCH 127
|
||||
|
||||
#define SAMPLE_NOT_ALLOCATED -1
|
||||
#define SAMPLE_NOT_FOUND -3
|
||||
#define SAMPLE_COORD_INVALID -5
|
||||
|
||||
#define AUDIO_VOL_MIN 0L
|
||||
#define AUDIO_VOL_MAX 100L
|
||||
#define AUDIO_VOL_RANGE (AUDIO_VOL_MAX-AUDIO_VOL_MIN)
|
||||
|
||||
/***************************************************************************/
|
||||
/* enums */
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* typedefs
|
||||
*/
|
||||
|
||||
typedef BOOL (* AUDIO_CALLBACK) ( void *psObj );
|
||||
typedef struct __audio_stream AUDIO_STREAM;
|
||||
|
||||
/***************************************************************************/
|
||||
/* structs */
|
||||
|
||||
typedef struct AUDIO_SAMPLE
|
||||
|
@ -91,7 +80,6 @@ typedef struct TRACK
|
|||
const char* fileName;
|
||||
} TRACK;
|
||||
|
||||
/***************************************************************************/
|
||||
/* functions
|
||||
*/
|
||||
|
||||
|
@ -140,4 +128,8 @@ extern void sound_PauseStream(AUDIO_STREAM* stream);
|
|||
extern void sound_ResumeStream(AUDIO_STREAM* stream);
|
||||
extern AUDIO_STREAM* sound_PlayStreamWithBuf(PHYSFS_file* fileHandle, float volume, void (*onFinished)(void*), void* user_data, size_t streamBufferSize, unsigned int buffer_count);
|
||||
|
||||
#endif // _TRACK_H_
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __INCLUDED_LIB_SOUND_TRACK_H__
|
||||
|
|
|
@ -17,29 +17,20 @@
|
|||
along with Warzone 2100; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/***************************************************************************/
|
||||
/*
|
||||
* Library-specific sound library functions;
|
||||
* these need to be re-written for each library.
|
||||
/** \file
|
||||
* Library-specific sound library functions;
|
||||
* these need to be re-written for each library.
|
||||
*/
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef _TRACKLIB_H_
|
||||
#define _TRACKLIB_H_
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __INCLUDED_LIB_SOUND_TRACKLIB_H__
|
||||
#define __INCLUDED_LIB_SOUND_TRACKLIB_H__
|
||||
|
||||
#include "track.h"
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
#define KHZ22 (22050L)
|
||||
#define KHZ11 (11025L)
|
||||
#define MAX_AUDIO_SAMPLES 20
|
||||
|
||||
/***************************************************************************/
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
BOOL sound_InitLibrary( void );
|
||||
void sound_ShutdownLibrary( void );
|
||||
|
@ -80,8 +71,8 @@ unsigned int sound_GetActiveSamplesCount(void);
|
|||
|
||||
UDWORD sound_GetGameTime( void );
|
||||
|
||||
/***************************************************************************/
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _TRACKLIB_H_
|
||||
|
||||
/***************************************************************************/
|
||||
#endif // __INCLUDED_LIB_SOUND_TRACKLIB_H__
|
||||
|
|
Loading…
Reference in New Issue