NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
snd_StrmSound.h
1#ifndef NW4R_SND_STRM_SOUND_H
2#define NW4R_SND_STRM_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_MoveValue.h"
13#include "nw4r/snd/snd_StrmPlayer.h"
14
15#include "nw4r/ut/ut_LinkList.h"
16
17/*******************************************************************************
18 * types
19 */
20
21// forward declarations
22namespace nw4r { namespace snd { namespace detail { template <class> class SoundInstanceManager; }}}
23namespace nw4r { namespace snd { namespace detail { class StrmBufferPool; }}}
24namespace nw4r { namespace snd { class StrmSoundHandle; }}
25
26namespace nw4r { namespace ut { namespace detail { class RuntimeTypeInfo; }}}
27namespace nw4r { namespace ut { class FileStream; }}
28
29/*******************************************************************************
30 * classes and functions
31 */
32
33namespace nw4r { namespace snd { namespace detail
34{
35 // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x30810
36 class StrmSound : public BasicSound
37 {
38 // typedefs
39 public:
40 /* redeclare with this class instead of BasicSound for
41 * SoundInstanceManager
42 */
43 typedef ut::LinkList<StrmSound, 0xf0> PriorityLinkList;
44
45 // methods
46 public:
47 // cdtors
48 StrmSound(SoundInstanceManager<StrmSound> *manager, int priority,
49 int ambientPriority);
50 /* virtual ~StrmSound() {} */ // virtual function ordering
51
52 // virtual function ordering
53 // vtable BasicSound
54 virtual ut::detail::RuntimeTypeInfo const *GetRuntimeTypeInfo() const
55 {
56 return &typeInfo;
57 }
58 virtual ~StrmSound() {}
59 virtual void Shutdown();
60 virtual bool IsPrepared() const { return mStrmPlayer.IsPrepared(); }
61 virtual bool IsAttachedTempSpecialHandle();
62 virtual void DetachTempSpecialHandle();
63 virtual void InitParam();
64 virtual BasicPlayer &GetBasicPlayer() { return mStrmPlayer; }
65 virtual BasicPlayer const &GetBasicPlayer() const
66 {
67 return mStrmPlayer;
68 }
69 virtual void OnUpdatePlayerPriority();
70 virtual void UpdateMoveValue();
71 virtual void UpdateParam();
72
73 // methods
74 StrmPlayer::SetupResult Setup(StrmBufferPool *bufferPool,
75 int allocChannelCount,
76 u16 allocTrackFlag);
77
78 void *GetFileStreamBuffer() { return mFileStreamBuffer; }
79 s32 GetFileStreamBufferSize() { return sizeof mFileStreamBuffer; }
80
81 bool Prepare(StrmPlayer::StartOffsetType startOffsetType, s32 offset,
82 ut::FileStream *fileStream);
83
84 void SetTrackVolume(ulong trackFlags, f32 volume, int fadeFrames);
85
86 static DebugSoundType GetSoundType()
87 {
88 return DEBUG_SOUND_TYPE_STRMSOUND;
89 }
90
91 // static members
92 public:
93 static int const FILE_STREAM_BUFFER_SIZE = 128;
94
95 static ut::detail::RuntimeTypeInfo const typeInfo;
96
97 // members
98 private:
99 /* base BasicSound */ // size 0x100, offset 0x000
100 StrmPlayer mStrmPlayer; // size 0xd08, offset 0x100
101 StrmSoundHandle *mTempSpecialHandle; // size 0x004, offset 0xe08
102 SoundInstanceManager<StrmSound> *mManager; // size 0x004, offset 0xe0c
103 MoveValue<f32, int> mTrackVolume[8]; // size 0x080, offset 0xe10
104 ut::FileStream *mFileStream; // size 0x004, offset 0xe90
105 int mFileStreamBuffer[FILE_STREAM_BUFFER_SIZE]; // size 0x200, offset 0xe94
106
107 // friends
108 private:
109 friend class snd::StrmSoundHandle;
110 }; // size 0x1094
111}}} // namespace nw4r::snd::detail
112
113#endif // NW4R_SND_STRM_SOUND_H
Debugging library which includes various utilities used by the rest of nw4r.
Definition ut_list.cpp:4