NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
snd_RemoteSpeakerManager.h
1#ifndef NW4R_SND_REMOTE_SPEAKER_MANAGER_H
2#define NW4R_SND_REMOTE_SPEAKER_MANAGER_H
3#include "nw4r/snd/snd_RemoteSpeaker.h"
4#include <revolution/OS.h> // IWYU pragma: export
5#include <revolution/WPAD.h> // IWYU pragma: export
6
7
8namespace nw4r {
9namespace snd {
10namespace detail {
11
12class RemoteSpeakerManager {
13public:
14 static RemoteSpeakerManager &GetInstance();
15
16 RemoteSpeaker &GetRemoteSpeaker(int i);
17
18 void Setup();
19 void Shutdown();
20
21private:
22 static const int SPEAKER_ALARM_HZ = 150;
23
24 // commented out since it causes compiler warnings
25 // static const int SPEAKER_ALARM_PERIOD_NSEC = static_cast<int>(1.0f / SPEAKER_ALARM_HZ * 1000 * 1000 * 1000);
26 static const int SPEAKER_ALARM_PERIOD_NSEC = 6666667;
27private:
28 RemoteSpeakerManager();
29
30 static void RemoteSpeakerAlarmProc(OSAlarm *pAlarm, OSContext *pCtx);
31
32private:
33 bool mInitialized; // at 0x0
34 OSAlarm mRemoteSpeakerAlarm; // at 0x8
35 RemoteSpeaker mSpeaker[WPAD_MAX_CONTROLLERS]; // at 0x38
36};
37
38} // namespace detail
39} // namespace snd
40} // namespace nw4r
41
42#endif