1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     snd_SequenceSoundFileReader.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: 13145 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NW_SND_SEQUENCE_SOUND_FILE_READER_H_
17 #define NW_SND_SEQUENCE_SOUND_FILE_READER_H_
18 
19 #include <nw/snd/snd_SequenceSoundFile.h>
20 
21 namespace nw {
22 namespace snd {
23 namespace internal {
24 
25 class SequenceSoundFileReader
26 {
27 public:
28     static const u32 SIGNATURE_FILE = NW_UT_MAKE_SIGWORD( 'C', 'S', 'E', 'Q' );
29 
30     SequenceSoundFileReader( const void* sequenceFile );
IsAvailable()31     bool IsAvailable() const { return m_pHeader != NULL; }
32 
33     const void* GetSequenceData() const;
34     bool GetOffsetByLabel( const char* label, u32* offsetPtr ) const;
35     const char* GetLabelByOffset( u32 offset ) const;   // 使われない?
36 
37     // デバッグ用
GetLabelCount()38     inline int GetLabelCount() const
39     {
40         return m_pLabelBlockBody->GetLabelCount();
41     }
GetLabel(int index)42     inline const char* GetLabel( int index ) const
43     {
44         return m_pLabelBlockBody->GetLabel( index );
45     }
46 
47 private:
48     const SequenceSoundFile::FileHeader* m_pHeader;
49     const SequenceSoundFile::DataBlockBody* m_pDataBlockBody;
50     const SequenceSoundFile::LabelBlockBody* m_pLabelBlockBody;
51 };
52 
53 } // namespace nw::snd::internal
54 } // namespace nw::snd
55 } // namespace nw
56 
57 
58 #endif /* NW_SND_SEQUENCE_SOUND_FILE_READER_H_ */
59 
60