30#include "engines/icb/common/px_common.h"
31#include "engines/icb/common/px_clu_api.h"
32#include "engines/icb/common/px_sfx_description.h"
33#include "engines/icb/sound_lowlevel.h"
37#define SPECIAL_SOUND (0xffffff)
39#define SPEECH_CHANNEL 1
40#define MUSIC_CHANNEL 0
44#define GUNSHOT_SFX_VAR 0
45#define RICOCHET_SFX_VAR 1
46#define TINKLE_SFX_VAR 2
49#define CLOSE_SFX_VAR 1
51extern const char *gunSfxVar;
52extern const char *defaultGunSfx;
53extern const char *gunDesc;
55extern const char *ricochetSfxVar;
56extern const char *defaultRicochetSfx;
57extern const char *ricochetDesc;
59extern const char *openSfxVar;
60extern const char *defaultOpenSfx;
61extern const char *openDesc;
63extern const char *closeSfxVar;
64extern const char *defaultCloseSfx;
65extern const char *closeDesc;
67extern const char *addingMediSfxVar;
68extern const char *defaultAddingMediSfx;
69extern const char *defaultUsingMediSfx;
70extern const char *addingMediDesc;
72extern const char *addingClipSfxVar;
73extern const char *defaultAddingClipSfx;
74extern const char *addingClipDesc;
76extern const char *activateRemoraSfxVar;
77extern const char *activateRemoraSfx;
78extern const char *activateRemoraDesc;
80extern const char *deactivateRemoraSfxVar;
81extern const char *deactivateRemoraSfx;
82extern const char *deactivateRemoraDesc;
84extern const char *emailSfxVar;
85extern const char *defaultEmailSfx;
86extern const char *emailDesc;
88extern const char *menuUpDownSfx;
89extern const char *menuSelectSfx;
90extern const char *menuCancelSfx;
92extern const char *tinkleSfxVar;
93extern const char *defaultTinkleSfx;
94extern const char *tinkleDesc;
96#define NO_REGISTERED_SOUND 0xffffffff
97#define MAX_REGISTERED_SOUNDS 128
110 int32 m_restart_time;
119 int32 m_current_pitch;
120 int32 m_sample_pitch;
121 int32 m_rand_pitch_value;
122 int32 m_next_random_pos;
130 int8 m_volume_offset;
139 inline uint32 GetObjectID() {
return m_objID; }
141 bool8 IsThisSound(uint32 obj, uint32 sndHash) {
143 if ((obj == m_objID) && (sndHash == m_sndHash))
149 inline bool8 IsFree() {
return (bool8)(m_objID == NO_REGISTERED_SOUND); }
150 inline bool8 IsUsed() {
return (bool8)(m_objID != NO_REGISTERED_SOUND); }
152 int32 GetChannel() {
return m_channel; }
155 void SetUnhearable();
164 void UpdateGameCycle(int32 newVol, int32 newPan);
166 void GetRandom(
CSfx *sfx);
167 void Register(
const char *sndName,
const char *sfxName, uint32 sfxHash, int8 volume);
169 void RegisterFromObject(
const uint32 objID,
const char *sndName,
const char *sfxName, uint32 sfxHash, PXreal xo, PXreal yo, PXreal zo, int8 volume);
170 void RegisterFromAbsolute(
const uint32 objID,
const char *sndName,
const char *sfxName, uint32 sfxHash, PXreal x, PXreal y, PXreal z, int8 volume);
177 void GetVolumeAndPan(int32 &vol, int32 &pan);
188bool8 SfxExists(uint32 sfxHash);
189bool8 SfxExists(
const char *sfx);
192#define menuSfxUpDown() RegisterMenuSound(menuUpDownSfx, 127, 0)
193#define menuSfxSelect() RegisterMenuSound(menuSelectSfx, 127, 0)
194#define menuSfxCancel() RegisterMenuSound(menuCancelSfx, 127, 0)
196int32 GetSpeechVolume();
198int32 GetMusicVolume();
199void SetSpeechVolume(int32 v);
200void SetSfxVolume(int32 v);
201void SetMusicVolume(int32 v);
205int32 GetCurrentSoundLevel();
208void UpdateRemoraScannerSound();
211void UpdateHearableSounds();
214void UpdateSounds10Hz();
227int32 GetAssignedSounds();
231void RegisterSoundOffset(uint32 obj,
const char *offsetName,
const char *sfxName, uint32 sfxHash,
const char *sndID, PXreal xo, PXreal yo, PXreal zo, int32 isNico, int32 time,
233void RegisterSound(uint32 obj,
const char *sfxName, uint32 sfxHash,
const char *sndID, int8 volume_offset);
234void RegisterSoundAbsolute(uint32 obj,
const char *sfxName, uint32 sfxHash,
const char *sndID, PXreal x, PXreal y, PXreal z, int8 volume_offset);
235void RegisterSoundTime(uint32 obj,
const char *sfxName, uint32 sfxHash,
const char *sndID, int32 time, int8 volume_offset);
236void RegisterSoundSpecial(
const char *sfxName, uint32 sfxHash,
const char *sndID, int32 volume, int32 pan, int8 volume_offset);
239void RegisterMenuSound(
const char *sfxName, uint32 sfxHash, int32 volume, int32 pan, int8 volume_offset);
243inline void RegisterSoundOffset(uint32 obj,
const char *offsetName,
const char *sfxName,
const char *sndID, PXreal xo, PXreal yo, PXreal zo, int32 isNico, int32 time) {
244 RegisterSoundOffset(obj, offsetName, sfxName, NULL_HASH, sndID, xo, yo, zo, isNico, time, (int8)127);
247inline void RegisterSound(uint32 obj,
const char *sfxName,
const char *sndID) { RegisterSound(obj, sfxName, NULL_HASH, sndID, (int8)127); }
249inline void RegisterSoundAbsolute(uint32 obj,
const char *sfxName,
const char *sndID, PXreal x, PXreal y, PXreal z) {
250 RegisterSoundAbsolute(obj, sfxName, NULL_HASH, sndID, x, y, z, (int8)127);
253inline void RegisterSoundTime(uint32 obj,
const char *sfxName,
const char *sndID, int32 time) { RegisterSoundTime(obj, sfxName, NULL_HASH, sndID, time, (int8)127); }
255inline void RegisterSoundSpecial(
const char *sfxName,
const char *sndID, int32 volume, int32 pan) { RegisterSoundSpecial(sfxName, NULL_HASH, sndID, volume, pan, (int8)127); }
257inline void RegisterMenuSound(
const char *sfxName, int32 volume, int32 pan) { RegisterMenuSound(sfxName, NULL_HASH, volume, pan, (int8)127); }
261void RemoveRegisteredSound(uint32 obj,
const char *sndID);
263void RemoveAllSoundsWithID(uint32 obj);
265void StopAllSoundsNow();
Definition: px_sfx_description.h:59