/*---------------------------------------------------------------------------* Project: NintendoWare File: OriginalSoundHeapApp.h Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo and/or its licensed developers and are protected by national and international copyright laws. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. The content herein is highly confidential and should be handled accordingly. $Revision: $ *---------------------------------------------------------------------------*/ #ifndef NW_SND_DEMO_SIMPLE_APP_H_ #define NW_SND_DEMO_SIMPLE_APP_H_ #include "demolib.h" #include /* 頭とおしりから取得できるサウンドヒープ。 実用的にするには、残りサイズを取得できるようにしたり、 小分けに Alloc/Free できるようにする必要がある。 (現在は Alloc と Free (全削除) しかできない) */ class OriginalSoundHeap : public nw::snd::SoundMemoryAllocatable { public: virtual void* Alloc( size_t size ); void Free(); OriginalSoundHeap(); bool Create( void* startAddress, size_t size ); void* Destroy(); void SetAllocDirection( bool isDirectionHead ) { m_IsDirectionHead = isDirectionHead; } private: static const int ALIGNMENT_SIZE = 32; nw::ut::FrameHeap* m_pFrameHeap; void* m_pBufferHead; size_t m_BufferSize; bool m_IsDirectionHead; }; class OriginalSoundHeapApp : public nw::snd::demolib::AppBase { protected: virtual void OnInitialize(); virtual void OnFinalize(); virtual void OnDrawUpLCD( nw::font::TextWriter& ); virtual void OnDrawDownLCD( nw::font::TextWriter& ); virtual void OnUpdatePad( nw::demo::Pad& ); virtual void OnUpdate(); private: void InitializeSoundSystem(); nw::snd::RomSoundArchive m_Archive; nw::snd::SoundArchivePlayer m_ArchivePlayer; nw::snd::SoundDataManager m_DataManager; OriginalSoundHeap m_Heap; nw::snd::SoundHandle m_Handle; void* m_pMemoryForSoundSystem; void* m_pMemoryForInfoBlock; void* m_pMemoryForStringBlock; void* m_pMemoryForSoundDataManager; void* m_pMemoryForSoundArchivePlayer; void* m_pMemoryForSoundHeap; void* m_pMemoryForStreamBuffer; }; #endif /* NW_SND_DEMO_SIMPLE_APP_H_ */