28 #ifndef HPL_SOUNDHANDLER_H 29 #define HPL_SOUNDHANDLER_H 31 #include "common/list.h" 32 #include "hpl1/engine/math/MathTypes.h" 33 #include "hpl1/engine/physics/PhysicsWorld.h" 34 #include "hpl1/engine/system/SystemTypes.h" 44 enum eSoundDest :
unsigned int {
45 eSoundDest_World = eFlagBit_0,
46 eSoundDest_Gui = eFlagBit_1,
47 eSoundDest_All = eFlagBit_All
55 bool HasCollided() {
return mbHasCollided; }
73 cSoundEntry() : mfNormalVolume(1), mfNormalVolumeFadeDest(1),
74 mfNormalVolumeMul(1), mfNormalVolumeFadeSpeed(0), mbStream(
false),
75 mlCount(0), mpSound(
nullptr) {}
77 void Update(
float afTimeStep);
83 float mfNormalVolumeMul;
84 float mfNormalVolumeFadeDest;
85 float mfNormalVolumeFadeSpeed;
92 float mfBlockFadeDest;
93 float mfBlockFadeSpeed;
99 eSoundDest mEffectType;
128 float afMinDist,
float afMaxDist, eSoundDest mType,
bool abRelative,
bool ab3D =
false,
129 int alPriorityModifier = 0, eSoundDest aEffectType = eSoundDest_World);
132 float afMinDist,
float afMaxDist, eSoundDest mType,
bool abRelative,
int alPriorityModifier = 0,
133 eSoundDest aEffectType = eSoundDest_World) {
134 return Play(asName, abLoop, afVolume, avPos, afMinDist, afMaxDist, mType, abRelative,
true,
135 alPriorityModifier, aEffectType);
138 iSoundChannel *PlayStream(
const tString &asFileName,
bool abLoop,
float afVolume,
bool ab3D =
false,
139 eSoundDest aEffectType = eSoundDest_Gui);
142 eSoundDest aEffectType = eSoundDest_Gui);
144 void SetSilent(
bool abX) { mbSilent = abX; }
145 bool GetSilent() {
return mbSilent; }
147 bool Stop(
const tString &asName);
148 bool StopAllExcept(
const tString &asName);
150 void StopAll(tFlag mTypes);
151 void PauseAll(tFlag mTypes);
152 void ResumeAll(tFlag mTypes);
154 bool IsPlaying(
const tString &asName);
159 void Update(
float afTimeStep);
161 void SetSpeed(
float afSpeed,
float afRate, tFlag mTypes);
162 void SetVolume(
float afVolume,
float afRate, tFlag mTypes);
164 float GetVolume() {
return mfVolume; }
166 void SetWorld3D(
cWorld3D *apWorld3D);
172 tSoundEntryList *GetWorldEntryList();
173 tSoundEntryList *GetGuiEntryList();
179 tSoundEntryList mlstGuiSounds;
180 tSoundEntryList mlstWorldSounds;
187 tFlag mAffectedBySpeed;
192 tFlag mAffectedByVolume;
198 tPlayedSoundNumMap m_mapPlayedSound;
201 bool UpdateEntry(
cSoundEntry *apEntry,
float afTimeStep, tFlag aTypes);
202 void UpdateDistanceVolume3D(
cSoundEntry *apEntry,
float afTimeStep,
bool abFade, tFlag aTypes);
210 #endif // HPL_SOUNDHANDLER_H
Definition: PhysicsWorld.h:92
Definition: PhysicsWorld.h:100
Definition: SoundHandler.h:71
typename TreeT::BasicIterator iterator
Definition: stablemap.h:48
Definition: SystemTypes.h:411
Definition: PhysicsBody.h:117
Definition: World3D.h:179
Definition: SoundHandler.h:122
Definition: SoundHandler.h:52
Definition: Resources.h:160
Definition: SoundChannel.h:46
Definition: LowLevelSound.h:45
Definition: list_intern.h:51