blob: 3e434b2a75843d86452dd228d793ae8d595f5195 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#ifndef NW4R_SND_VOICE_MANAGER_H
#define NW4R_SND_VOICE_MANAGER_H
/*******************************************************************************
* headers
*/
#include "common.h" // u32
#include "nw4r/snd/snd_Voice.h"
/*******************************************************************************
* classes and functions
*/
namespace nw4r { namespace snd { namespace detail
{
// [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x2ffb36
class VoiceManager
{
public:
static const int VOICE_MAX = AX_VOICE_MAX;
static const int WORK_SIZE_MAX = VOICE_MAX * sizeof(Voice);
// methods
public:
// instance accessors
static VoiceManager &GetInstance();
// methods
void Setup(void *mem, u32 memSize);
void Shutdown();
Voice::LinkList const &GetVoiceList() const { return mPrioVoiceList; }
u32 GetRequiredMemSize(int voiceCount);
Voice *AllocVoice(int voiceChannelCount, int voiceOutCount,
int priority, Voice::Callback *callback,
void *callbackData);
void FreeVoice(Voice *voice);
void StopAllVoices();
void ChangeVoicePriority(Voice *voice);
void UpdateAllVoices();
void UpdateAllVoicesSync(u32 syncFlag);
void NotifyVoiceUpdate();
private:
// cdtors
VoiceManager();
// methods
void AppendVoiceList(Voice *voice);
void RemoveVoiceList(Voice *voice);
void UpdateEachVoicePriority(Voice::LinkList::Iterator const &beginItr,
Voice::LinkList::Iterator const &endItr);
int DropLowestPriorityVoice(int priority);
// members
private:
bool mInitialized; // size 0x01, offset 0x00
/* 3 bytes padding */
Voice::LinkList mPrioVoiceList; // size 0x0c, offset 0x04
Voice::LinkList mFreeVoiceList; // size 0x0c, offset 0x10
}; // size 0x1c
}}} // namespace nw4r::snd::detail
#endif // NW4R_SND_VOICE_MANAGER_H
|