Pulsar  3d3a057
bfsar_sound.h
Go to the documentation of this file.
1 /**
2  * @file
3  * @brief Sound archive sound table access
4  */
5 #pragma once
6 
7 #include <pulsar/bfsar/bfsar.h>
9 
10 /// Sound types
11 typedef enum {
12  PLSR_BFSARSoundType_Stream = _PLSR_BFSAR_INFO_IDENTIFIER_STREAM_ENTRY,
13  PLSR_BFSARSoundType_Wave = _PLSR_BFSAR_INFO_IDENTIFIER_WAVE_ENTRY,
14  PLSR_BFSARSoundType_Sequence = _PLSR_BFSAR_INFO_IDENTIFIER_SEQUENCE_ENTRY,
16 
17 /// Sound wave information
18 typedef struct {
19  u32 index; ///< Wave index in wave archive
20  u32 trackCount;
22 
23 /// Sound information
24 typedef struct {
25  u32 fileIndex; ///< Related file index (wave type = WSD file, see plsrBFSARFileGet())
26  PLSR_BFSARItemId playerItemId;
27  u8 initialVolume;
28  u8 remoteFilter;
30 
31  PLSR_BFSARSoundWaveInfo wave; ///< Populated if type is `PLSR_BFSARSoundType_Wave`
32 
33  bool hasStringIndex;
34  u32 stringIndex; ///< Name index in the string table, populated if `hasStringIndex` is `true` (see plsrBFSARStringGet())
36 
37 /// Fetch sound information from the specified index in the sound table
38 PLSR_RC plsrBFSARSoundGet(const PLSR_BFSAR* bfsar, u32 index, PLSR_BFSARSoundInfo* out);
39 
40 NX_INLINE u32 plsrBFSARSoundCount(const PLSR_BFSAR* bfsar) {
41  return bfsar->soundTable.info.count;
42 }
Sound wave information.
Definition: bfsar_sound.h:18
u32 fileIndex
Related file index (wave type = WSD file, see plsrBFSARFileGet())
Definition: bfsar_sound.h:25
PLSR_BFSARSoundWaveInfo wave
Populated if type is PLSR_BFSARSoundType_Wave
Definition: bfsar_sound.h:31
Sound archive file.
Definition: bfsar.h:34
PLSR_BFSARSoundType
Sound types.
Definition: bfsar_sound.h:11
u32 count
Table entry/block count.
Definition: archive.h:41
u32 stringIndex
Name index in the string table, populated if hasStringIndex is true (see plsrBFSARStringGet()) ...
Definition: bfsar_sound.h:34
Sound information.
Definition: bfsar_sound.h:24
Sound archive init.
Sound archive item id types.
PLSR_ArchiveTableInfo info
Cached table information.
Definition: archive.h:47
PLSR_RC plsrBFSARSoundGet(const PLSR_BFSAR *bfsar, u32 index, PLSR_BFSARSoundInfo *out)
Fetch sound information from the specified index in the sound table.
Id for one item/resource contained in the sound archive.
Definition: bfsar_item.h:34
u32 PLSR_RC
Result code returned by Pulsar functions.
Definition: types.h:73
u32 index
Wave index in wave archive.
Definition: bfsar_sound.h:19