Pulsar  3d3a057
bfstm.h
Go to the documentation of this file.
1 /**
2  * @file
3  * @brief Stream file init
4  */
5 #pragma once
6 
8 #include <pulsar/bfstm/bfstm_internal.h>
9 
10 /// Stream file method categories
11 typedef enum {
12  PLSR_BFSTMCategoryType_Init = 0,
13  PLSR_BFSTMCategoryType_Info,
14  PLSR_BFSTMCategoryType_Channel,
16 
17 /// Stream file sample formats
18 typedef enum {
19  /// 8-bit PCM encoded samples
20  PLSR_BFSTMFormat_PCM_8 = _PLSR_BFSTM_FORMAT_PCM_8,
21 
22  /// 16-bit PCM encoded samples
23  PLSR_BFSTMFormat_PCM_16 = _PLSR_BFSTM_FORMAT_PCM_16,
24 
25  /// DSP ADPCM encoded samples (Wave channel info should contain the needed adpcm context to decode samples, see plsrBFWAVReadChannelInfo())
26  PLSR_BFSTMFormat_DSP_ADPCM = _PLSR_BFSTM_FORMAT_DSP_ADPCM,
28 
29 /// Stream file
30 typedef struct {
31  PLSR_Archive ar;
32 
33  PLSR_ArchiveHeaderInfo headerInfo;
34 
35  PLSR_ArchiveSection infoSection;
36  PLSR_ArchiveSection dataSection;
37 
38  u32 streamInfoOffset;
39  PLSR_ArchiveTable channelTable;
40 } PLSR_BFSTM;
41 
42 /// @copydoc plsrArchiveOpen
43 PLSR_RC plsrBFSTMOpen(const char* path, PLSR_BFSTM* out);
44 
45 /// @copydoc plsrArchiveOpenInside
46 PLSR_RC plsrBFSTMOpenInside(const PLSR_Archive* ar, u32 offset, PLSR_BFSTM* out);
47 
48 /// @copydoc plsrArchiveClose
49 void plsrBFSTMClose(PLSR_BFSTM* bfstm);
Archive section.
Definition: archive.h:34
Common archive header information.
Definition: archive.h:22
void plsrBFSTMClose(PLSR_BFSTM *bfstm)
Close archive, releasing resources if applicable.
Archive container interface.
16-bit PCM encoded samples
Definition: bfstm.h:23
DSP ADPCM encoded samples (Wave channel info should contain the needed adpcm context to decode sample...
Definition: bfstm.h:26
Stream file.
Definition: bfstm.h:30
PLSR_BFSTMFormat
Stream file sample formats.
Definition: bfstm.h:18
Archive file.
Definition: archive.h:75
PLSR_BFSTMCategoryType
Stream file method categories.
Definition: bfstm.h:11
8-bit PCM encoded samples
Definition: bfstm.h:20
PLSR_RC plsrBFSTMOpen(const char *path, PLSR_BFSTM *out)
Open from a file at specified path.
PLSR_RC plsrBFSTMOpenInside(const PLSR_Archive *ar, u32 offset, PLSR_BFSTM *out)
Open from inside another archive at specified offset.
u32 PLSR_RC
Result code returned by Pulsar functions.
Definition: types.h:73
Archive table (entry list)
Definition: archive.h:45