/*---------------------------------------------------------------------------* Project: NintendoWare File: snd_ChannelManager.h Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. 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. $Revision: 19566 $ *---------------------------------------------------------------------------*/ #ifndef NW_SND_CHANNEL_MANAGER_H_ #define NW_SND_CHANNEL_MANAGER_H_ #include #include #include namespace nw { namespace snd { namespace internal { namespace driver { class ChannelManager { public: static ChannelManager& GetInstance(); size_t GetRequiredMemSize( int channelCount ); void Initialize( void* mem, unsigned long memSize ); void Finalize(); Channel* Alloc(); void Free( Channel* channel ); void UpdateAllChannel(); private: typedef InstancePool ChannelPool; typedef ut::LinkList< Channel, offsetof(Channel,m_Link)> ChannelList; ChannelManager(); ChannelPool m_Pool; ChannelList m_ChannelList; bool m_IsInitialized; unsigned long m_ChannelCount; void* m_pMem; unsigned long m_MemSize; }; } // namespace nw::snd::driver } // namespace nw::snd::internal } // namespace nw::snd } // namespace nw #endif /* NW_SND_CHANNEL_MANAGER_H_ */