NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
snd_SoundSystem.h
1#ifndef NW4R_SND_SOUND_SYSTEM_H
2#define NW4R_SND_SOUND_SYSTEM_H
3
4/*******************************************************************************
5 * headers
6 */
7
8#include <types.h>
9#include "nw4r/snd/snd_AxManager.h"
10#include "nw4r/snd/snd_RemoteSpeaker.h"
11#include "nw4r/snd/snd_RemoteSpeakerManager.h"
12
13/*******************************************************************************
14 * classes and functions
15 */
16
17// forward declarations
18namespace nw4r { namespace snd { namespace detail { class TaskThread; }}}
19
20namespace nw4r { namespace snd
21{
22 // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x4bd66
24 {
25 // nested types
26 public:
27 // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x4bc73
28 struct SoundSystemParam
29 {
30 // methods
31 public:
32 // cdtors
33 SoundSystemParam() :
34 soundThreadPriority (DEFAULT_SOUND_THREAD_PRIORITY),
35 soundThreadStackSize (DEFAULT_SOUND_THREAD_STACK_SIZE),
36 dvdThreadPriority (DEFAULT_DVD_THREAD_PRIORITY),
37 dvdThreadStackSize (DEFAULT_DVD_THREAD_STACK_SIZE)
38 {
39 }
40
41 // members
42 public:
43 s32 soundThreadPriority; // size 0x04, offset 0x00
44 ulong soundThreadStackSize; // size 0x04, offset 0x04
45 s32 dvdThreadPriority; // size 0x04, offset 0x08
46 ulong dvdThreadStackSize; // size 0x04, offset 0x0c
47 }; // size 0x10
48
49 // static members
50 private:
51 static int const DEFAULT_DVD_THREAD_STACK_SIZE = 0x4000;
52 static int const DEFAULT_SOUND_THREAD_STACK_SIZE = 0x4000;
53 static int const DEFAULT_DVD_THREAD_PRIORITY = 3;
54 static int const DEFAULT_SOUND_THREAD_PRIORITY = 4;
55
56 static int sMaxVoices;
57 static detail::TaskThread sTaskThread;
58
59 // methods
60 public:
61 static void InitSoundSystem(s32 sndThreadPriority, s32 dvdThreadPriority);
62 static void InitSoundSystem(SoundSystemParam const &param,
63 void *workMem, ulong workMemSize);
64 static void ShutdownSoundSystem();
65 static void WaitForResetReady();
66
67 static bool IsInitializedSoundSystem();
68
69 static ulong GetRequiredMemSize(SoundSystemParam const &param);
70
71 static void PrepareReset() {
72 detail::AxManager::GetInstance().PrepareReset();
73 }
74
75
76 static void SetOutputMode(OutputMode mode) {
77 detail::AxManager::GetInstance().SetOutputMode(mode);
78 }
79
80
81 static f32 GetMasterVolume() {
82 return detail::AxManager::GetInstance().GetMasterVolume();
83 }
84 static void SetMasterVolume(f32 volume, int frame) {
85 detail::AxManager::GetInstance().SetMasterVolume(volume, frame);
86 }
87
88
89 static RemoteSpeaker &GetRemoteSpeaker(int i) {
90 return detail::RemoteSpeakerManager::GetInstance().GetRemoteSpeaker(i);
91 }
92
93
94 static void AppendEffect(AuxBus bus, FxBase *pFx) {
95 detail::AxManager::GetInstance().AppendEffect(bus, pFx);
96 }
97 static void ClearEffect(AuxBus bus, int frame) {
98 detail::AxManager::GetInstance().ClearEffect(bus, frame);
99 }
100 }; // size 0x01 (0x00 for inheritance)
101}} // namespace nw4r::snd
102
103#endif // NW4R_SND_SOUND_SYSTEM_H