NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
snd_WaveSound.h
1#ifndef NW4R_SND_WAVE_SOUND_H
2#define NW4R_SND_WAVE_SOUND_H
3
4/*******************************************************************************
5 * headers
6 */
7
8#include <types.h>
9
10#include "nw4r/snd/snd_BasicSound.h"
11#include "nw4r/snd/snd_debug.h"
12#include "nw4r/snd/snd_WsdPlayer.h"
13
14#include "nw4r/ut/ut_LinkList.h"
15
16/*******************************************************************************
17 * types
18 */
19
20// forward declarations
21namespace nw4r { namespace snd { namespace detail { template <class> class SoundInstanceManager; }}}
22namespace nw4r { namespace snd { class WaveSoundHandle; }}
23
24namespace nw4r { namespace ut { namespace detail { class RuntimeTypeInfo; }}}
25
26/*******************************************************************************
27 * classes and functions
28 */
29
30namespace nw4r { namespace snd { namespace detail
31{
32 class WaveSound : public BasicSound
33 {
34 // typedefs
35 public:
36 /* redeclare with this class instead of BasicSound for
37 * SoundInstanceManager
38 */
39 typedef ut::LinkList<WaveSound, 0xf0> PriorityLinkList;
40
41 // methods
42 public:
43 // cdtors
44 WaveSound(SoundInstanceManager<WaveSound> *manager, int priority,
45 int ambientPriority);
46 /* virtual ~WaveSound() {} */ // virtual function ordering
47
48 // virtual function ordering
49 // vtable BasicSound
50 virtual ut::detail::RuntimeTypeInfo const *GetRuntimeTypeInfo() const
51 {
52 return &typeInfo;
53 }
54 virtual ~WaveSound() {}
55 virtual void Shutdown();
56 virtual bool IsPrepared() const { return mPreparedFlag; }
57 virtual bool IsAttachedTempSpecialHandle();
58 virtual void DetachTempSpecialHandle();
59 virtual BasicPlayer &GetBasicPlayer() { return mWsdPlayer; }
60 virtual BasicPlayer const &GetBasicPlayer() const { return mWsdPlayer; }
61 virtual void OnUpdatePlayerPriority();
62
63 // methods
64 bool Prepare(void const *waveSoundBase, s32 waveSoundOffset,
65 WsdPlayer::StartOffsetType startOffsetType, s32 offset,
66 WsdPlayer::WsdCallback const *callback,
67 ulong callbackData);
68
69 void SetChannelPriority(int priority);
70 void SetReleasePriorityFix(bool flag);
71
72 static DebugSoundType GetSoundType()
73 {
74 return DEBUG_SOUND_TYPE_WAVESOUND;
75 }
76
77 // static members
78 public:
79 static ut::detail::RuntimeTypeInfo const typeInfo;
80
81 // members
82 private:
83 /* base BasicSound */ // size 0x100, offset 0x000
84 WsdPlayer mWsdPlayer; // size 0x138, offset 0x100
85 WaveSoundHandle *mTempSpecialHandle; // size 0x004, offset 0x238
86 SoundInstanceManager<WaveSound> *mManager; // size 0x004, offset 0x23c
87 bool mPreparedFlag; // size 0x001, offset 0x240
88 /* 3 bytes padding */
89
90 // friends
91 private:
92 friend class snd::WaveSoundHandle;
93 }; // size 0x244
94}}} // namespace nw4r::snd::detail
95
96#endif // NW4R_SND_WAVE_SOUND_H
Debugging library which includes various utilities used by the rest of nw4r.
Definition ut_list.cpp:4