1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     snd_SequenceSoundFileReader.h
4 
5   Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain proprietary
8   information of Nintendo and/or its licensed developers and are protected by
9   national and international copyright laws. They may not be disclosed to third
10   parties or copied or duplicated in any form, in whole or in part, without the
11   prior written consent of Nintendo.
12 
13   The content herein is highly confidential and should be handled accordingly.
14 
15   $Revision: 31311 $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef NW_SND_SEQUENCE_SOUND_FILE_READER_H_
19 #define NW_SND_SEQUENCE_SOUND_FILE_READER_H_
20 
21 #include <nw/snd/snd_SequenceSoundFile.h>
22 
23 namespace nw {
24 namespace snd {
25 namespace internal {
26 
27 class SequenceSoundFileReader
28 {
29 public:
30     static const u32 SIGNATURE_FILE = NW_UT_MAKE_SIGWORD( 'C', 'S', 'E', 'Q' );
31 
32     SequenceSoundFileReader( const void* sequenceFile );
IsAvailable()33     bool IsAvailable() const { return m_pHeader != NULL; }
34 
35     const void* GetSequenceData() const;
36     bool GetOffsetByLabel( const char* label, u32* offsetPtr ) const;
37     const char* GetLabelByOffset( u32 offset ) const;   // 使われない?
38 
39     // デバッグ用
GetLabelCount()40     inline int GetLabelCount() const
41     {
42         return m_pLabelBlockBody->GetLabelCount();
43     }
GetLabel(int index)44     inline const char* GetLabel( int index ) const
45     {
46         return m_pLabelBlockBody->GetLabel( index );
47     }
48 
49 private:
50     const SequenceSoundFile::FileHeader* m_pHeader;
51     const SequenceSoundFile::DataBlockBody* m_pDataBlockBody;
52     const SequenceSoundFile::LabelBlockBody* m_pLabelBlockBody;
53 };
54 
55 } // namespace nw::snd::internal
56 } // namespace nw::snd
57 } // namespace nw
58 
59 
60 #endif /* NW_SND_SEQUENCE_SOUND_FILE_READER_H_ */
61 
62