37 #ifndef __CU_WAV_DECODER_H__
38 #define __CU_WAV_DECODER_H__
39 #include "CUAudioDecoder.h"
45 #pragma mark WAV Header
69 #pragma mark ADPCM Decoder
87 #pragma mark Constructors
114 #pragma mark Decoding
127 return (_blocksize*bytes)/_wavefmt.blockalign;
153 virtual Sint32
read(SDL_RWops* source, Uint8* buffer) = 0;
158 #pragma mark WAV Decoder
219 #pragma mark Constructors
242 bool init(
const char* file)
override {
243 return init(std::string(file));
255 bool init(
const std::string& file)
override;
265 #pragma mark Static Constructors
276 static std::shared_ptr<AudioDecoder>
alloc(
const char* file) {
277 return alloc(std::string(file));
290 static std::shared_ptr<AudioDecoder>
alloc(
const std::string& file);
293 #pragma mark Decoding
314 virtual Sint32
pagein(
float* buffer)
override;
325 void setPage(Uint64 page)
override;
346 bool bootstrap(
const std::string& file);
Uint32 getBlockSize() const
Definition: CUWAVDecoder.h:137
Uint8 * _chunker
Definition: CUWAVDecoder.h:204
Definition: CUWAVDecoder.h:77
static std::shared_ptr< AudioDecoder > alloc(const char *file)
Definition: CUWAVDecoder.h:276
void setPage(Uint64 page) override
ADPCMDecoder()
Definition: CUWAVDecoder.h:94
Uint64 getFrames(Uint64 bytes) const
Definition: CUWAVDecoder.h:126
Uint32 _sampbits
Definition: CUWAVDecoder.h:209
Type _datatype
Definition: CUWAVDecoder.h:206
std::shared_ptr< ADPCMDecoder > _adpcm
Definition: CUWAVDecoder.h:216
Definition: CUWAVDecoder.h:178
Definition: CUAudioDecoder.h:55
struct cugl::audio::WaveFMT WaveFMT
Type
Definition: CUWAVDecoder.h:185
virtual bool init(WaveFMT *format)
Sint64 _datamark
Definition: CUWAVDecoder.h:213
Uint8 * _blkbuffer
Definition: CUWAVDecoder.h:82
Uint16 channels
Definition: CUWAVDecoder.h:56
Definition: CUWAVDecoder.h:52
Uint16 encoding
Definition: CUWAVDecoder.h:54
Uint16 _blocksize
Definition: CUWAVDecoder.h:84
bool init(const char *file) override
Definition: CUWAVDecoder.h:242
virtual Sint32 pagein(float *buffer) override
Definition: CUAction.h:51
virtual Sint32 read(SDL_RWops *source, Uint8 *buffer)=0
WaveFMT _wavefmt
Definition: CUWAVDecoder.h:80
Uint32 _sampsize
Definition: CUWAVDecoder.h:211
SDL_RWops * _source
Definition: CUWAVDecoder.h:202
Type getType() const
Definition: CUWAVDecoder.h:299