Pulsar  3d3a057
bfwsd_sound_data.h
Go to the documentation of this file.
1 /**
2  * @file
3  * @brief Wave sound data access
4  */
5 #pragma once
6 
7 #include <pulsar/bfwsd/bfwsd.h>
8 
9 /// Wave sound data note information table
11 
12 /// Wave sound data ADSHR curve
13 typedef struct {
14  u8 attack;
15  u8 decay;
16  u8 sustain;
17  u8 hold;
18  u8 release;
20 
21 /// Wave sound data send values
22 typedef struct {
23  u8 main;
24  u8 auxCount;
25  u8 aux[3];
27 
28 /// Wave sound data note information
29 typedef struct {
30  u32 waveIdIndex; ///< Related index in the wave id table
32 
33 /// Wave sound data information
34 typedef struct {
35  PLSR_BFWSDNoteInfoTable noteInfoTable;
36 
37  bool hasPan;
38  u8 pan; ///< Populated if `hasPan` is `true`
39  u8 surroundPan; ///< Populated if `hasPan` is `true`
40 
41  bool hasPitch;
42  float pitch; ///< Populated if `hasPitch` is `true`
43 
44  bool hasSend;
45  PLSR_BFWSDSendValues send; ///< Populated if `hasSend` is `true`
46 
47  bool hasAdshr;
48  PLSR_BFWSDAdshrCurve adshr; ///< Populated if `hasAdshr` is `true`
50 
51 /// Fetch wave sound data information from the specified index in the table
53 
54 /// Fetch note information from the specified index in the wave sound data note table
56 
57 NX_INLINE u32 plsrBFWSDSoundDataCount(const PLSR_BFWSD* bfwsd) {
58  return bfwsd->soundDataTable.info.count;
59 }
float pitch
Populated if hasPitch is true
Definition: bfwsd_sound_data.h:42
Wave sound data archive.
Definition: bfwsd.h:18
Wave sound data information.
Definition: bfwsd_sound_data.h:34
PLSR_BFWSDSendValues send
Populated if hasSend is true
Definition: bfwsd_sound_data.h:45
PLSR_ArchiveTable PLSR_BFWSDNoteInfoTable
Wave sound data note information table.
Definition: bfwsd_sound_data.h:10
u32 waveIdIndex
Related index in the wave id table.
Definition: bfwsd_sound_data.h:30
Wave sound data ADSHR curve.
Definition: bfwsd_sound_data.h:13
PLSR_BFWSDAdshrCurve adshr
Populated if hasAdshr is true
Definition: bfwsd_sound_data.h:48
PLSR_RC plsrBFWSDSoundDataNoteGet(const PLSR_BFWSD *bfwsd, const PLSR_BFWSDNoteInfoTable *table, u32 index, PLSR_BFWSDNoteInfo *out)
Fetch note information from the specified index in the wave sound data note table.
u32 count
Table entry/block count.
Definition: archive.h:41
Wave sound data send values.
Definition: bfwsd_sound_data.h:22
u8 pan
Populated if hasPan is true
Definition: bfwsd_sound_data.h:38
Wave sound data archive init.
PLSR_RC plsrBFWSDSoundDataGet(const PLSR_BFWSD *bfwsd, u32 index, PLSR_BFWSDSoundDataInfo *out)
Fetch wave sound data information from the specified index in the table.
PLSR_ArchiveTableInfo info
Cached table information.
Definition: archive.h:47
u8 surroundPan
Populated if hasPan is true
Definition: bfwsd_sound_data.h:39
Wave sound data note information.
Definition: bfwsd_sound_data.h:29
u32 PLSR_RC
Result code returned by Pulsar functions.
Definition: types.h:73
Archive table (entry list)
Definition: archive.h:45