mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
* 2006/04/26 * * Little Alien * * Developed in VS 2003 * ********************************************************* Source: - Soundmanager v1.1 added - Some changes for international versions git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@39 3b4a5df2-a311-0410-b5c6-a8a6f20db521
105 lines
3.0 KiB
C
105 lines
3.0 KiB
C
#ifndef __SOUNDMAN_
|
|
#define __SOUNDMAN_
|
|
|
|
#include "types.h"
|
|
#include "fmod.h"
|
|
#include "fmod_errors.h"
|
|
|
|
/*
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
*/
|
|
|
|
// Sample status flags
|
|
#define SAMPLE_ALLOCATED 0x00000001
|
|
#define SAMPLE_LOCKED 0x00000002
|
|
#define SAMPLE_RANDOM 0x00000004
|
|
#define SAMPLE_RANDOM_MANUAL 0x00000008
|
|
|
|
// Sound error values (they're all the same)
|
|
#define NO_SAMPLE 0xffffffff
|
|
#define SOUND_ERROR 0xffffffff
|
|
|
|
// Maximum allowable priority value
|
|
#define PRIORITY_MAX 0xfffffffe
|
|
#define PRIORITY_RANDOM PRIORITY_MAX-1
|
|
|
|
|
|
// Structure definition for sound parameters being passed down to the sample playing function
|
|
typedef struct {
|
|
UINT32 uiSpeed;
|
|
UINT32 uiPitchBend; // Random pitch bend range +/-
|
|
UINT32 uiVolume;
|
|
UINT32 uiPan;
|
|
UINT32 uiLoop;
|
|
UINT32 uiPriority;
|
|
void (*EOSCallback)(void *);
|
|
void *pCallbackData;
|
|
} SOUNDPARMS;
|
|
|
|
|
|
// Structure definition for parameters to the random sample playing function
|
|
typedef struct {
|
|
UINT32 uiTimeMin, uiTimeMax;
|
|
UINT32 uiSpeedMin, uiSpeedMax;
|
|
UINT32 uiVolMin, uiVolMax;
|
|
UINT32 uiPanMin, uiPanMax;
|
|
UINT32 uiPriority;
|
|
UINT32 uiMaxInstances;
|
|
} RANDOMPARMS;
|
|
|
|
|
|
// Global startup/shutdown functions
|
|
extern BOOLEAN InitializeSoundManager(void);
|
|
extern void ShutdownSoundManager(void);
|
|
|
|
// Configuration functions
|
|
extern BOOLEAN SoundSetMemoryLimit(UINT32 uiLimit);
|
|
extern BOOLEAN SoundSetCacheThreshhold(UINT32 uiThreshold);
|
|
extern void * SoundGetDriverHandle( void );
|
|
|
|
// Master volume control functions
|
|
extern void SoundSetDefaultVolume(UINT32 uiVolume);
|
|
extern UINT32 SoundGetDefaultVolume(void);
|
|
|
|
// Cache control functions
|
|
//extern UINT32 SoundLoadSample(STR pFilename);
|
|
UINT32 SoundLoadSample(STR pFilename);
|
|
|
|
extern UINT32 SoundFreeSample(STR pFilename);
|
|
extern UINT32 SoundLockSample(STR pFilename);
|
|
extern UINT32 SoundUnlockSample(STR pFilename);
|
|
extern BOOLEAN SoundEmptyCache(void);
|
|
|
|
// Play/service sample functions
|
|
extern UINT32 SoundPlay(STR pFilename, SOUNDPARMS *pParms);
|
|
extern UINT32 SoundPlayStreamedFile( STR pFilename, SOUNDPARMS *pParms );
|
|
extern UINT32 SoundPlayRandom(STR pFilename, RANDOMPARMS *pParms);
|
|
extern BOOLEAN SoundServiceStreams(void);
|
|
extern BOOLEAN SoundServiceRandom(void);
|
|
|
|
// Sound instance manipulation functions
|
|
extern BOOLEAN SoundStopAll(void);
|
|
extern BOOLEAN SoundStopAllRandom(void);
|
|
extern BOOLEAN SoundStop(UINT32 uiSoundID);
|
|
extern BOOLEAN SoundIsPlaying(UINT32 uiSoundID);
|
|
extern BOOLEAN SoundSetVolume(UINT32 uiSoundID, UINT32 uiVolume);
|
|
extern BOOLEAN SoundSetPan(UINT32 uiSoundID, UINT32 uiPan);
|
|
extern UINT32 SoundGetVolume(UINT32 uiSoundID);
|
|
extern UINT32 SoundGetPosition(UINT32 uiSoundID);
|
|
|
|
extern void SoundSetSampleFlags( UINT32 uiSample, UINT32 uiFlags );
|
|
extern void SoundRemoveSampleFlags( UINT32 uiSample, UINT32 uiFlags );
|
|
|
|
extern void SoundEnableSound(BOOLEAN fEnable);
|
|
|
|
extern void SoundLog(CHAR8 *strMessage);
|
|
|
|
/*
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
*/
|
|
|
|
#endif |