1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     snd_WaveFileReader.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_WAVE_FILE_READER_H_
19 #define NW_SND_WAVE_FILE_READER_H_
20 
21 #include <nw/snd/snd_WaveFile.h>
22 
23 namespace nw {
24 namespace snd {
25 namespace internal {
26 
27 class WaveFileReader
28 {
29 public:
30     static const u32 SIGNATURE_FILE = NW_UT_MAKE_SIGWORD( 'C', 'W', 'A', 'V' );
31     static SampleFormat GetSampleFormat( u8 encodeMethod );
32 
33     WaveFileReader( const void* waveFile );
34     // WaveFileReader( const WaveFile::InfoBlockBody* infoBlockBody );
35 
36     bool ReadWaveInfo( WaveInfo* info, const void* waveDataOffsetOrigin = NULL ) const;
37 
38 private:
39     const void* GetWaveDataAddress(
40             const WaveFile::ChannelInfo* info,
41             const void* waveDataOffsetOrigin ) const;
42 
43     const WaveFile::InfoBlockBody*  m_pInfoBlockBody;
44     const void*                     m_pDataBlockBody;
45 };
46 
47 } // namespace nw::snd::internal
48 } // namespace nw::snd
49 } // namespace nw
50 
51 
52 #endif /* NW_SND_WAVE_FILE_READER_H_ */
53 
54