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"
|
2019-12-07 17:28:30 +00:00
|
|
|
#include "z_music.h"
|
2013-09-08 20:18:56 +00:00
|
|
|
|
2019-09-21 20:53:00 +00:00
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
2012-06-17 19:45:41 +00:00
|
|
|
// KEEPINSYNC lunatic/con_lang.lua
|
2011-10-30 19:48:46 +00:00
|
|
|
#define MAXSOUNDS 4096
|
2018-02-27 15:21:01 +00:00
|
|
|
#define LOUDESTVOLUME 111
|
2008-07-12 14:09:52 +00:00
|
|
|
|
2010-08-02 08:13:51 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2019-12-15 12:34:00 +00:00
|
|
|
int pitchStart, pitchEnd, volAdjust;
|
|
|
|
int priority, flags;
|
2010-08-02 08:13:51 +00:00
|
|
|
} sound_t;
|
|
|
|
|
2019-08-07 22:44:29 +00:00
|
|
|
int A_CheckSoundPlaying(int spriteNum,int soundNum);
|
2019-12-15 12:34:00 +00:00
|
|
|
int A_PlaySound(int soundNum, int spriteNum, bool looped = false);
|
2019-09-19 18:22:09 +00:00
|
|
|
void S_Callback(intptr_t num);
|
2019-08-07 22:44:29 +00:00
|
|
|
int A_CheckAnySoundPlaying(int spriteNum);
|
|
|
|
int S_CheckSoundPlaying(int soundNum);
|
2019-11-28 01:36:34 +00:00
|
|
|
inline void S_ClearSoundLocks(void) {}
|
2018-11-18 18:08:14 +00:00
|
|
|
void cacheAllSounds(void);
|
2010-08-02 08:13:51 +00:00
|
|
|
void S_MenuSound(void);
|
2018-10-25 23:32:29 +00:00
|
|
|
void S_PauseMusic(bool paused);
|
|
|
|
void S_PauseSounds(bool paused);
|
2018-01-29 11:13:43 +00:00
|
|
|
void S_PlayLevelMusicOrNothing(unsigned int);
|
|
|
|
int S_TryPlaySpecialMusic(unsigned int);
|
|
|
|
void S_PlaySpecialMusicOrNothing(unsigned int);
|
2018-01-29 11:14:08 +00:00
|
|
|
void S_ContinueLevelMusic(void);
|
2019-12-15 12:34:00 +00:00
|
|
|
int S_PlaySound(int num, bool looped = false);
|
|
|
|
int S_PlaySound3D(int num, int spriteNum, const vec3_t *pos, bool looped = false);
|
2019-08-09 11:00:34 +00:00
|
|
|
void S_StopEnvSound(int sndNum,int sprNum);
|
2017-01-05 05:29:25 +00:00
|
|
|
void S_StopAllSounds(void);
|
2010-08-02 08:13:51 +00:00
|
|
|
void S_Update(void);
|
2018-10-25 23:32:29 +00:00
|
|
|
void S_ChangeSoundPitch(int soundNum, int spriteNum, int pitchoffset);
|
2019-12-15 12:34:00 +00:00
|
|
|
int S_GetUserFlags(int sndnum);
|
|
|
|
int S_DefineSound(unsigned index, const char* filename, int ps, int pe, int pr, int m, int vo, float vol);
|
2019-12-15 16:16:11 +00:00
|
|
|
void S_InitSound();
|
2010-08-02 08:13:51 +00:00
|
|
|
|
2018-10-25 23:32:29 +00:00
|
|
|
static inline bool S_IsAmbientSFX(int spriteNum)
|
2013-03-31 18:58:17 +00:00
|
|
|
{
|
2018-10-25 23:32:29 +00:00
|
|
|
return (sprite[spriteNum].picnum == MUSICANDSFX && sprite[spriteNum].lotag < 999);
|
2013-03-31 18:58:17 +00:00
|
|
|
}
|
|
|
|
|
2019-09-21 20:53:00 +00:00
|
|
|
END_DUKE_NS
|
|
|
|
|
2008-07-12 14:09:52 +00:00
|
|
|
#endif
|