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 48 #define OPEN_SFX_VAR 0 49 #define CLOSE_SFX_VAR 1 51 extern const char *gunSfxVar;
52 extern const char *defaultGunSfx;
53 extern const char *gunDesc;
55 extern const char *ricochetSfxVar;
56 extern const char *defaultRicochetSfx;
57 extern const char *ricochetDesc;
59 extern const char *openSfxVar;
60 extern const char *defaultOpenSfx;
61 extern const char *openDesc;
63 extern const char *closeSfxVar;
64 extern const char *defaultCloseSfx;
65 extern const char *closeDesc;
67 extern const char *addingMediSfxVar;
68 extern const char *defaultAddingMediSfx;
69 extern const char *defaultUsingMediSfx;
70 extern const char *addingMediDesc;
72 extern const char *addingClipSfxVar;
73 extern const char *defaultAddingClipSfx;
74 extern const char *addingClipDesc;
76 extern const char *activateRemoraSfxVar;
77 extern const char *activateRemoraSfx;
78 extern const char *activateRemoraDesc;
80 extern const char *deactivateRemoraSfxVar;
81 extern const char *deactivateRemoraSfx;
82 extern const char *deactivateRemoraDesc;
84 extern const char *emailSfxVar;
85 extern const char *defaultEmailSfx;
86 extern const char *emailDesc;
88 extern const char *menuUpDownSfx;
89 extern const char *menuSelectSfx;
90 extern const char *menuCancelSfx;
92 extern const char *tinkleSfxVar;
93 extern const char *defaultTinkleSfx;
94 extern 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);
188 bool8 SfxExists(uint32 sfxHash);
189 bool8 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) 196 int32 GetSpeechVolume();
197 int32 GetSfxVolume();
198 int32 GetMusicVolume();
199 void SetSpeechVolume(int32 v);
200 void SetSfxVolume(int32 v);
201 void SetMusicVolume(int32 v);
205 int32 GetCurrentSoundLevel();
208 void UpdateRemoraScannerSound();
211 void UpdateHearableSounds();
214 void UpdateSounds10Hz();
218 void UnpauseSounds();
227 int32 GetAssignedSounds();
231 void RegisterSoundOffset(uint32 obj,
const char *offsetName,
const char *sfxName, uint32 sfxHash,
const char *sndID, PXreal xo, PXreal yo, PXreal zo, int32 isNico, int32 time,
233 void RegisterSound(uint32 obj,
const char *sfxName, uint32 sfxHash,
const char *sndID, int8 volume_offset);
234 void RegisterSoundAbsolute(uint32 obj,
const char *sfxName, uint32 sfxHash,
const char *sndID, PXreal x, PXreal y, PXreal z, int8 volume_offset);
235 void RegisterSoundTime(uint32 obj,
const char *sfxName, uint32 sfxHash,
const char *sndID, int32 time, int8 volume_offset);
236 void RegisterSoundSpecial(
const char *sfxName, uint32 sfxHash,
const char *sndID, int32 volume, int32 pan, int8 volume_offset);
239 void RegisterMenuSound(
const char *sfxName, uint32 sfxHash, int32 volume, int32 pan, int8 volume_offset);
243 inline 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);
247 inline void RegisterSound(uint32 obj,
const char *sfxName,
const char *sndID) { RegisterSound(obj, sfxName, NULL_HASH, sndID, (int8)127); }
249 inline 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);
253 inline void RegisterSoundTime(uint32 obj,
const char *sfxName,
const char *sndID, int32 time) { RegisterSoundTime(obj, sfxName, NULL_HASH, sndID, time, (int8)127); }
255 inline void RegisterSoundSpecial(
const char *sfxName,
const char *sndID, int32 volume, int32 pan) { RegisterSoundSpecial(sfxName, NULL_HASH, sndID, volume, pan, (int8)127); }
257 inline void RegisterMenuSound(
const char *sfxName, int32 volume, int32 pan) { RegisterMenuSound(sfxName, NULL_HASH, volume, pan, (int8)127); }
261 void RemoveRegisteredSound(uint32 obj,
const char *sndID);
263 void RemoveAllSoundsWithID(uint32 obj);
265 void StopAllSoundsNow();
Definition: px_sfx_description.h:59