2007-02-08 04:19:39 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
2010-05-25 10:56:00 +00:00
|
|
|
Copyright (C) 2010 EDuke32 developers and contributors
|
2007-02-08 04:19:39 +00:00
|
|
|
|
2010-05-25 10:56:00 +00:00
|
|
|
This file is part of EDuke32.
|
2007-02-08 04:19:39 +00:00
|
|
|
|
|
|
|
EDuke32 is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2014-07-20 08:55:56 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2007-02-08 04:19:39 +00:00
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
2008-07-12 14:09:52 +00:00
|
|
|
|
|
|
|
//****************************************************************************
|
|
|
|
//
|
|
|
|
// sounds.h
|
|
|
|
//
|
|
|
|
//****************************************************************************
|
|
|
|
|
2014-11-22 12:32:56 +00:00
|
|
|
#ifndef sounds_public_h_
|
|
|
|
#define sounds_public_h_
|
2008-07-12 14:09:52 +00:00
|
|
|
|
2013-09-08 20:18:56 +00:00
|
|
|
#include "sounds_common.h"
|
|
|
|
|
2014-11-26 04:39:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-06-17 19:45:41 +00:00
|
|
|
// KEEPINSYNC lunatic/con_lang.lua
|
2011-10-30 19:48:46 +00:00
|
|
|
#define MAXSOUNDS 4096
|
2010-08-02 08:13:51 +00:00
|
|
|
#define MAXSOUNDINSTANCES 8
|
|
|
|
#define LOUDESTVOLUME 150
|
|
|
|
#define MUSIC_ID -65536
|
2008-07-12 14:09:52 +00:00
|
|
|
|
2014-05-31 12:26:41 +00:00
|
|
|
#define FX_VOLUME(x) (ud.config.FXVolume > 0 ? scale(x, 255, ud.config.FXVolume) : 0)
|
2013-08-06 23:53:55 +00:00
|
|
|
#define MASTER_VOLUME(x) scale(ud.config.MasterVolume, x, 255)
|
|
|
|
|
2010-08-02 08:13:51 +00:00
|
|
|
struct audioenumdev
|
|
|
|
{
|
2008-07-12 14:09:52 +00:00
|
|
|
char *def;
|
|
|
|
char **devs;
|
|
|
|
struct audioenumdev *next;
|
|
|
|
};
|
2010-08-02 08:13:51 +00:00
|
|
|
struct audioenumdrv
|
|
|
|
{
|
2008-07-12 14:09:52 +00:00
|
|
|
char *def;
|
|
|
|
char **drvs;
|
|
|
|
struct audioenumdev *devs;
|
|
|
|
};
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t EnumAudioDevs(struct audioenumdrv **wave, struct audioenumdev **midi, struct audioenumdev **cda);
|
2008-07-12 14:09:52 +00:00
|
|
|
|
2010-08-02 08:13:51 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2015-02-11 05:22:00 +00:00
|
|
|
int16_t ow;
|
|
|
|
int16_t voice;
|
2012-10-08 07:07:59 +00:00
|
|
|
uint32_t sndist;
|
|
|
|
uint32_t clock;
|
2010-08-02 08:13:51 +00:00
|
|
|
} SOUNDOWNER;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2015-01-25 12:17:59 +00:00
|
|
|
char *filename, *ptr; // 8b/16b
|
2010-08-02 08:13:51 +00:00
|
|
|
int32_t length, num, soundsiz; // 12b
|
2012-10-08 07:07:17 +00:00
|
|
|
SOUNDOWNER SoundOwner[MAXSOUNDINSTANCES]; // 64b
|
2010-08-02 08:13:51 +00:00
|
|
|
int16_t ps,pe,vo; // 6b
|
|
|
|
char pr,m; // 2b
|
|
|
|
} sound_t;
|
|
|
|
|
2016-01-11 05:05:38 +00:00
|
|
|
extern char g_soundlocks[MAXSOUNDS];
|
2010-08-02 08:13:51 +00:00
|
|
|
extern sound_t g_sounds[MAXSOUNDS];
|
2014-04-19 22:42:20 +00:00
|
|
|
extern int32_t g_skillSoundVoice;
|
2012-08-13 18:25:48 +00:00
|
|
|
extern int32_t g_numEnvSoundsPlaying,g_maxSoundPos;
|
2010-08-02 08:13:51 +00:00
|
|
|
|
|
|
|
int32_t A_CheckSoundPlaying(int32_t i,int32_t num);
|
|
|
|
int32_t A_PlaySound(uint32_t num,int32_t i);
|
|
|
|
void S_Callback(uint32_t num);
|
2013-01-02 22:33:32 +00:00
|
|
|
int32_t A_CheckAnySoundPlaying(int32_t i);
|
2010-08-02 08:13:51 +00:00
|
|
|
int32_t S_CheckSoundPlaying(int32_t i,int32_t num);
|
|
|
|
void S_Cleanup(void);
|
|
|
|
void S_ClearSoundLocks(void);
|
|
|
|
int32_t S_LoadSound(uint32_t num);
|
|
|
|
void S_MenuSound(void);
|
|
|
|
void S_MusicShutdown(void);
|
|
|
|
void S_MusicStartup(void);
|
|
|
|
void S_MusicVolume(int32_t volume);
|
2014-09-07 18:10:09 +00:00
|
|
|
void S_RestartMusic(void);
|
2010-08-02 08:13:51 +00:00
|
|
|
void S_PauseMusic(int32_t onf);
|
2015-01-25 12:17:59 +00:00
|
|
|
int32_t S_PlayMusic(const char *fn);
|
2010-08-02 08:13:51 +00:00
|
|
|
int32_t S_PlaySound(int32_t num);
|
|
|
|
int32_t S_PlaySound3D(int32_t num,int32_t i,const vec3_t *pos);
|
|
|
|
void S_SoundShutdown(void);
|
|
|
|
void S_SoundStartup(void);
|
|
|
|
void S_StopEnvSound(int32_t num,int32_t i);
|
|
|
|
void S_StopMusic(void);
|
|
|
|
void S_Update(void);
|
2011-11-03 23:08:54 +00:00
|
|
|
void S_ChangeSoundPitch(int32_t num, int32_t i, int32_t pitchoffset);
|
2015-01-17 00:28:49 +00:00
|
|
|
int32_t S_GetMusicPosition(void);
|
|
|
|
void S_SetMusicPosition(int32_t position);
|
2010-08-02 08:13:51 +00:00
|
|
|
|
2013-03-31 18:58:17 +00:00
|
|
|
static inline int32_t S_IsAmbientSFX(int32_t i)
|
|
|
|
{
|
|
|
|
return (sprite[i].picnum==MUSICANDSFX && sprite[i].lotag < 999);
|
|
|
|
}
|
|
|
|
|
2014-11-26 04:39:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-07-12 14:09:52 +00:00
|
|
|
#endif
|