2020-06-11 07:22:16 +00:00
|
|
|
//****************************************************************************
|
|
|
|
//
|
|
|
|
// sounds.h
|
|
|
|
//
|
|
|
|
//****************************************************************************
|
2020-10-11 09:41:49 +00:00
|
|
|
#pragma once
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
#include "raze_sound.h"
|
|
|
|
#include "raze_music.h"
|
2020-07-07 11:19:09 +00:00
|
|
|
struct MapRecord;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
2020-06-24 19:21:02 +00:00
|
|
|
// Sound flags
|
|
|
|
enum {
|
2020-07-20 21:21:27 +00:00
|
|
|
SF_LOOP = 1,
|
|
|
|
SF_MSFX = 2,
|
|
|
|
SF_TALK = 4,
|
|
|
|
SF_ADULT = 8,
|
|
|
|
SF_GLOBAL = 16,
|
|
|
|
SF_ONEINST_INTERNAL = 32,
|
|
|
|
|
|
|
|
SF_DTAG = 128,
|
2020-06-24 19:21:02 +00:00
|
|
|
};
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
enum esound_t
|
|
|
|
{
|
2020-07-20 21:21:27 +00:00
|
|
|
kPitchStart,
|
|
|
|
kPitchEnd,
|
|
|
|
kVolAdjust,
|
|
|
|
kPriority,
|
|
|
|
kFlags,
|
2020-09-11 18:17:36 +00:00
|
|
|
kWorldTourMapping,
|
2020-07-20 21:21:27 +00:00
|
|
|
kMaxUserData
|
2020-06-11 07:22:16 +00:00
|
|
|
};
|
|
|
|
|
2020-07-25 07:32:54 +00:00
|
|
|
void S_InitSound();
|
|
|
|
void S_CacheAllSounds(void);
|
|
|
|
int S_DefineSound(unsigned index, const char* filename, int ps, int pe, int pr, int m, int vo, float vol);
|
2020-09-11 18:17:36 +00:00
|
|
|
void S_WorldTourMappingsForOldSounds();
|
2020-07-25 07:32:54 +00:00
|
|
|
|
2020-08-10 18:59:04 +00:00
|
|
|
int S_PlaySound(int num, int channel = CHAN_AUTO, EChanFlags flags = 0, float vol =0.8f);
|
2022-09-14 16:35:53 +00:00
|
|
|
int S_PlaySound3D(int num, DDukeActor* spriteNum, const DVector3& pos, int channel = CHAN_AUTO, EChanFlags flags = 0);
|
2022-09-13 17:48:44 +00:00
|
|
|
|
2020-11-02 21:59:37 +00:00
|
|
|
int S_PlayActorSound(int soundNum, DDukeActor* spriteNum, int channel = CHAN_AUTO, EChanFlags flags = 0);
|
2020-07-25 07:32:54 +00:00
|
|
|
void S_MenuSound(void);
|
|
|
|
|
2020-11-02 21:59:37 +00:00
|
|
|
void S_StopSound(int sndNum, DDukeActor* spr = nullptr, int flags = -1);
|
2020-07-25 07:32:54 +00:00
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
int S_CheckSoundPlaying(int soundNum);
|
2020-11-02 21:59:37 +00:00
|
|
|
int S_CheckActorSoundPlaying(DDukeActor* spriteNum, int soundNum, int channel = 0);
|
2020-10-25 05:40:05 +00:00
|
|
|
int S_CheckAnyActorSoundPlaying(DDukeActor* spriteNum);
|
2020-07-06 19:10:20 +00:00
|
|
|
|
2020-11-02 21:59:37 +00:00
|
|
|
void S_ChangeSoundPitch(int soundNum, DDukeActor* spriteNum, int pitchoffset);
|
2020-06-11 07:22:16 +00:00
|
|
|
int S_GetUserFlags(int sndnum);
|
|
|
|
|
2020-05-10 10:42:47 +00:00
|
|
|
inline bool S_IsSoundValid(int num)
|
|
|
|
{
|
2020-07-20 21:21:27 +00:00
|
|
|
return (!soundEngine->isValidSoundId(num + 1));
|
2020-05-10 10:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 07:32:54 +00:00
|
|
|
|
|
|
|
void S_PlayRRMusic(int newTrack = -1);
|
|
|
|
void S_PlayBonusMusic();
|
|
|
|
void S_PlayLevelMusic(MapRecord* mi);
|
|
|
|
void S_ContinueLevelMusic(void);
|
|
|
|
|
2020-05-12 05:51:45 +00:00
|
|
|
// Placeholders.
|
2020-09-26 14:18:44 +00:00
|
|
|
|
|
|
|
void S_ParseDeveloperCommentary();
|
|
|
|
|
2020-09-26 15:43:34 +00:00
|
|
|
void StopCommentary();
|
2020-10-26 06:30:34 +00:00
|
|
|
bool StartCommentary(int tag, DDukeActor* sprnum);
|
2020-05-10 10:42:47 +00:00
|
|
|
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
END_DUKE_NS
|
|
|
|
|