1 /*---------------------------------------------------------------------------* 2 Project: NintendoWare 3 File: snd_PlayerHeapDataManager.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: $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NW_SND_PLAYER_HEAP_DATA_MANAGER_H_ 17 #define NW_SND_PLAYER_HEAP_DATA_MANAGER_H_ 18 19 #include <nw/snd/snd_DisposeCallback.h> 20 #include <nw/snd/snd_SoundArchiveLoader.h> 21 #include <nw/snd/snd_SoundArchive.h> 22 23 namespace nw { 24 namespace snd { 25 namespace internal { 26 27 class PlayerHeapDataManager : public internal::driver::DisposeCallback, 28 public internal::SoundArchiveLoader 29 { 30 public: 31 PlayerHeapDataManager(); 32 virtual ~PlayerHeapDataManager(); 33 34 void Initialize( const SoundArchive* arc ); 35 void Finalize(); 36 37 const void* SetFileAddress( SoundArchive::FileId fileId, const void* address ); 38 const void* GetFileAddress( SoundArchive::FileId ) const; 39 40 static const int FILE_ADDRESS_COUNT = 1 + 4 + 4; 41 42 protected: 43 virtual void InvalidateData( const void* start, const void* end ); 44 virtual const void* SetFileAddressToTable( 45 SoundArchive::FileId, const void* address ); 46 virtual const void* GetFileAddressFromTable( SoundArchive::FileId fileId ) const; 47 virtual const void* GetFileAddressImpl( SoundArchive::FileId fileId ) const; 48 49 private: 50 struct FileAddress 51 { 52 SoundArchive::FileId fileId; 53 const void* address; 54 }; 55 56 FileAddress m_FileAddress[FILE_ADDRESS_COUNT]; 57 // NW4C-1.3.0 現在、ひとつのサウンドを鳴らすのに必要なファイルは、最大9個 58 // (== bcseq + 4 * bcbnk + 4 * bcwar)。 59 bool m_IsInitialized; 60 bool m_IsFinalized; 61 }; 62 63 } // namespace nw::snd::internal 64 } // namespace nw::snd 65 } // namespace nw 66 67 68 #endif /* NW_SND_PLAYER_HEAP_DATA_MANAGER_H_ */ 69 70