Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
ExternalSoundPlayer.h
Go to the documentation of this file.
1#ifndef NW4HBM_SND_EXTERNAL_SOUND_PLAYER_H
2#define NW4HBM_SND_EXTERNAL_SOUND_PLAYER_H
3
4#include <revolution/types.h>
5
6#include "BasicSound.h"
7
8namespace nw4hbm {
9 namespace snd {
10 namespace detail {
12 public:
15
16 int GetPlayableSoundCount() const { return mPlayableCount; }
17 void SetPlayableSoundCount(int count);
18
19 int GetPlayingSoundCount() const { return mSoundList.GetSize(); }
20
21 f32 detail_GetVolume() const { return mVolume; }
23
26
27 template <typename TForEachFunc>
28 TForEachFunc ForEachSound(TForEachFunc func, bool reverse) {
29 if (reverse) {
31
32 while (it != mSoundList.GetEndReverseIter()) {
34
35 SoundHandle handle;
36 handle.detail_AttachSoundAsTempHandle(&*curr);
37 func(handle);
38
39 if (handle.IsAttachedSound()) {
40 it++;
41 }
42 }
43 } else {
44 for (BasicSoundExtPlayList::Iterator itr = mSoundList.GetBeginIter();
45 itr != mSoundList.GetEndIter();)
46 {
47 BasicSoundExtPlayList::Iterator curr = itr++;
48 SoundHandle handle;
49 handle.detail_AttachSoundAsTempHandle(&*curr);
50 func(handle);
51 }
52 }
53
54 return func;
55 }
56
57 private:
59 /* 0x0C */ u16 mPlayableCount;
60 /* 0x10 */ f32 mVolume;
61 };
62 } // namespace detail
63 } // namespace snd
64} // namespace nw4hbm
65
66#endif
Definition SoundHandle.h:12
void detail_AttachSoundAsTempHandle(detail::BasicSound *sound)
bool IsAttachedSound() const
Definition SoundHandle.h:20
Definition BasicSound.h:30
Definition ExternalSoundPlayer.h:11
void RemoveSoundList(BasicSound *sound)
u16 mPlayableCount
Definition ExternalSoundPlayer.h:59
void InsertSoundList(BasicSound *sound)
int GetPlayableSoundCount() const
Definition ExternalSoundPlayer.h:16
TForEachFunc ForEachSound(TForEachFunc func, bool reverse)
Definition ExternalSoundPlayer.h:28
BasicSoundExtPlayList mSoundList
Definition ExternalSoundPlayer.h:58
f32 detail_GetVolume() const
Definition ExternalSoundPlayer.h:21
int GetPlayingSoundCount() const
Definition ExternalSoundPlayer.h:19
f32 mVolume
Definition ExternalSoundPlayer.h:60
u32 GetSize() const
Definition LinkList.h:127
Definition LinkList.h:155
float f32
Definition types.h:25
unsigned short int u16
Definition types.h:10
Definition HBMAnmController.h:6