Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
snd_types.h
Go to the documentation of this file.
1#ifndef NW4HBM_SND_TYPES_H
2#define NW4HBM_SND_TYPES_H
3
4#include <revolution/types.h>
5
6#include "../ut/LinkList.h"
7
8namespace nw4hbm {
9 namespace snd {
11 public:
13 };
14 template <typename T, int Ofs>
16 public:
18 void Append(T* obj) { mFreeList.PushBack(obj); }
19 void Remove(T* obj) { mFreeList.Erase(obj); }
20 T* Alloc() {
21 if (mFreeList.IsEmpty()) {
22 return NULL;
23 } else {
24 T& obj = mFreeList.GetFront();
25 mFreeList.PopFront();
26 mActiveList.PushBack(&obj);
27 return &obj;
28 }
29 }
30 void Free(T* obj) {
31 if (!mActiveList.IsEmpty()) {
32 mActiveList.Erase(obj);
33 mFreeList.PushBack(obj);
34 }
35 }
36
37 Iterator GetBeginIter() { return mActiveList.GetBeginIter(); }
38 Iterator GetEndIter() { return mActiveList.GetEndIter(); }
39
40 private:
43 };
44
45 static const int THREAD_STACK_SIZE = 1024;
46 static const int STREAM_BUFFER_SIZE = 512;
47
48 static const int CHANNEL_MAX = 2;
49
50 static const int VOICE_MAX = 4;
51
52 static const int PRIORITY_MAX = 255;
53
54 static const int REMOTE_FILTER_MAX = 127;
55
56 static const f32 VOLUME_MIN_DB = -90.4f;
57 static const f32 VOLUME_MAX_DB = 6.0f;
59 static const int VOLUME_RANGE_MB = static_cast<int>(10 * VOLUME_RANGE_DB);
60
65
72
73 typedef enum AuxBus { AUX_A = 0, AUX_B, AUX_C, AUX_BUS_NUM } AuxBus;
74
81
82 typedef struct SoundParam {
83 /* 0x00 */ f32 volume;
84 /* 0x04 */ f32 pitch;
85 /* 0x08 */ f32 pan;
86 /* 0x0C */ f32 surroundPan;
87 /* 0x10 */ f32 fxSend;
88 /* 0x14 */ f32 lpf;
89 /* 0x18 */ s32 priority;
91
92 namespace detail {
93 typedef struct AdpcmParam {
94 /* 0x00 */ u16 coef[16];
95 /* 0x20 */ u16 gain;
96 /* 0x22 */ u16 pred_scale;
97 /* 0x24 */ u16 yn1;
98 /* 0x26 */ u16 yn2;
100
101 typedef struct AdpcmLoopParam {
103 /* 0x02 */ u16 loop_yn1;
104 /* 0x04 */ u16 loop_yn2;
106
107 typedef struct AdpcmInfo {
108 /* 0x08 */ AdpcmParam adpcm;
110 /* 0x2E */ u16 padding;
112
113 typedef struct VoiceChannelParam {
114 /* 0x00 */ void* waveData;
117 } // namespace detail
118 } // namespace snd
119} // namespace nw4hbm
120
121#endif
Definition snd_types.h:15
Iterator GetEndIter()
Definition snd_types.h:38
ut::LinkList< T, Ofs > mActiveList
Definition snd_types.h:42
void Remove(T *obj)
Definition snd_types.h:19
ut::LinkList< T, Ofs > mFreeList
Definition snd_types.h:41
T * Alloc()
Definition snd_types.h:20
void Free(T *obj)
Definition snd_types.h:30
void Append(T *obj)
Definition snd_types.h:18
ut::LinkList< T, Ofs >::Iterator Iterator
Definition snd_types.h:17
Iterator GetBeginIter()
Definition snd_types.h:37
Definition snd_types.h:10
ut::LinkListNode mInstanceLink
Definition snd_types.h:12
Definition LinkList.h:23
float f32
Definition types.h:25
unsigned short int u16
Definition types.h:10
signed long s32
Definition types.h:11
struct nw4hbm::snd::detail::AdpcmInfo AdpcmInfo
struct nw4hbm::snd::detail::AdpcmLoopParam AdpcmLoopParam
struct nw4hbm::snd::detail::VoiceChannelParam VoiceChannelParam
struct nw4hbm::snd::detail::AdpcmParam AdpcmParam
OutputMode
Definition snd_types.h:66
@ OUTPUT_MODE_STEREO
Definition snd_types.h:67
@ OUTPUT_MODE_SURROUND
Definition snd_types.h:68
@ OUTPUT_MODE_MONO
Definition snd_types.h:70
@ OUTPUT_MODE_DPL2
Definition snd_types.h:69
static const int CHANNEL_MAX
Definition snd_types.h:48
static const int VOICE_MAX
Definition snd_types.h:50
AuxBus
Definition snd_types.h:73
@ AUX_BUS_NUM
Definition snd_types.h:73
@ AUX_B
Definition snd_types.h:73
@ AUX_C
Definition snd_types.h:73
@ AUX_A
Definition snd_types.h:73
SampleFormat
Definition snd_types.h:75
@ SAMPLE_FORMAT_PCM_S8
Definition snd_types.h:78
@ SAMPLE_FORMAT_PCM_S16
Definition snd_types.h:77
@ SAMPLE_FORMAT_DSP_ADPCM
Definition snd_types.h:79
@ SAMPLE_FORMAT_PCM_S32
Definition snd_types.h:76
static const int PRIORITY_MAX
Definition snd_types.h:52
static const f32 VOLUME_MIN_DB
Definition snd_types.h:56
static const int VOLUME_RANGE_MB
Definition snd_types.h:59
static const f32 VOLUME_RANGE_DB
Definition snd_types.h:58
OutputLineFlag
Definition snd_types.h:61
@ OUTPUT_LINE_REMOTE_N
Definition snd_types.h:63
@ OUTPUT_LINE_MAIN
Definition snd_types.h:62
static const f32 VOLUME_MAX_DB
Definition snd_types.h:57
static const int REMOTE_FILTER_MAX
Definition snd_types.h:54
static const int THREAD_STACK_SIZE
Definition snd_types.h:45
static const int STREAM_BUFFER_SIZE
Definition snd_types.h:46
struct nw4hbm::snd::SoundParam SoundParam
Definition HBMAnmController.h:6
Definition snd_types.h:82
f32 surroundPan
Definition snd_types.h:86
f32 fxSend
Definition snd_types.h:87
f32 volume
Definition snd_types.h:83
f32 lpf
Definition snd_types.h:88
f32 pitch
Definition snd_types.h:84
f32 pan
Definition snd_types.h:85
s32 priority
Definition snd_types.h:89
Definition snd_types.h:107
AdpcmLoopParam adpcmloop
Definition snd_types.h:109
u16 padding
Definition snd_types.h:110
AdpcmParam adpcm
Definition snd_types.h:108
Definition snd_types.h:101
u16 loop_yn1
Definition snd_types.h:103
u16 loop_pred_scale
Definition snd_types.h:102
u16 loop_yn2
Definition snd_types.h:104
Definition snd_types.h:93
u16 coef[16]
Definition snd_types.h:94
u16 pred_scale
Definition snd_types.h:96
u16 yn2
Definition snd_types.h:98
u16 yn1
Definition snd_types.h:97
u16 gain
Definition snd_types.h:95
Definition snd_types.h:113
AdpcmInfo adpcmInfo
Definition snd_types.h:115
void * waveData
Definition snd_types.h:114