Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
SoundArchiveLoader.h
Go to the documentation of this file.
1#ifndef NW4HBM_SND_SOUND_ARCHIVE_LOADER_H
2#define NW4HBM_SND_SOUND_ARCHIVE_LOADER_H
3
4#include <revolution/os.h>
5#include "../ut/FileStream.h"
6#include "snd_types.h"
7
8
9namespace nw4hbm {
10 namespace snd {
11 class SoundArchive;
12 class SoundMemoryAllocatable;
13
14 namespace detail {
15
17 public:
18 FileStreamHandle(ut::FileStream* pStream) : mStream(pStream) {}
19
21 if (mStream != NULL) {
22 mStream->Close();
23 }
24 }
25
27
29
30 operator bool() const { return mStream; }
31
32 private:
34 };
35
37 public:
38 explicit SoundArchiveLoader(const SoundArchive& soundArchive);
40
41 void* LoadGroup(u32 id, SoundMemoryAllocatable* allocater, void** waveBuffer,
42 u32 blockSize);
43 s32 ReadFile(u32 id, void* dst, s32 size, s32 offset);
44 void* LoadFile(u32 id, SoundMemoryAllocatable* allocater);
45
46 void Cancel();
47
48 private:
49 /* 0x000 */ mutable OSMutex mMutex;
50 /* 0x018 */ const SoundArchive& mArc;
52 /* 0x21C */ ut::FileStream* mStream;
53 };
54
55 } // namespace detail
56 } // namespace snd
57} // namespace nw4hbm
58
59#endif
static s32 offset
Definition WUD.c:1669
Definition SoundArchive.h:23
Definition SoundMemoryAllocatable.h:8
Definition SoundArchiveLoader.h:16
FileStreamHandle(ut::FileStream *pStream)
Definition SoundArchiveLoader.h:18
ut::FileStream * operator->()
Definition SoundArchiveLoader.h:28
~FileStreamHandle()
Definition SoundArchiveLoader.h:20
ut::FileStream * GetFileStream()
Definition SoundArchiveLoader.h:26
ut::FileStream * mStream
Definition SoundArchiveLoader.h:33
Definition SoundArchiveLoader.h:36
void * LoadGroup(u32 id, SoundMemoryAllocatable *allocater, void **waveBuffer, u32 blockSize)
OSMutex mMutex
Definition SoundArchiveLoader.h:49
u8 mStreamArea[STREAM_BUFFER_SIZE]
Definition SoundArchiveLoader.h:51
ut::FileStream * mStream
Definition SoundArchiveLoader.h:52
void * LoadFile(u32 id, SoundMemoryAllocatable *allocater)
const SoundArchive & mArc
Definition SoundArchiveLoader.h:50
SoundArchiveLoader(const SoundArchive &soundArchive)
s32 ReadFile(u32 id, void *dst, s32 size, s32 offset)
Definition FileStream.h:9
virtual void Close()=0
unsigned int size
Definition __os.h:106
unsigned long u32
Definition types.h:12
signed long s32
Definition types.h:11
unsigned char u8
Definition types.h:8
static const int STREAM_BUFFER_SIZE
Definition snd_types.h:46
Definition HBMAnmController.h:6
Definition OSMutex.h:13