1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     snd_SoundArchiveLoader.h
4 
5   Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Revision: 22506 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NW_SND_SOUND_ARCHIVE_LOADER_H_
17 #define NW_SND_SOUND_ARCHIVE_LOADER_H_
18 
19 #include <nw/io/io_FileStream.h>
20 #include <nw/snd/snd_SoundArchive.h>
21 #include <nw/snd/snd_Util.h>
22 
23 namespace nw {
24 namespace snd {
25 
26 class SoundMemoryAllocatable;
27 
28 namespace internal {
29 
30 /* ========================================================================
31         class difinition
32    ======================================================================== */
33 
34 class SoundArchiveLoader
35 {
36 public:
37     SoundArchiveLoader( const SoundArchive& arc );
38     ~SoundArchiveLoader();
39 
40     void* LoadFile(
41         SoundArchive::FileId fileId,
42         SoundMemoryAllocatable* allocator,
43         size_t loadBlockSize,
44         bool needDeviceMemory
45     );
46     s32 ReadFile(
47             SoundArchive::FileId fileId,
48             void* buffer,
49             size_t size,
50             s32 offset,
51             size_t loadBlockSize );
52 
53 private:
54 	nn::os::CriticalSection m_CriticalSection;
55     const SoundArchive& m_Arc;
56     u32 m_StreamArea[ 128 ];
57 };
58 
59 } // namespace nw::snd::internal
60 } // namespace nw::snd
61 } // namespace nw
62 
63 
64 #endif /* NW_SND_SOUND_ARCHIVE_LOADER_H_ */
65 
66