/*---------------------------------------------------------------------------* Project: NintendoWare File: snd_HardwareChannelManagerAX.cppi 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: $ *---------------------------------------------------------------------------*/ namespace nw { namespace snd { namespace internal { namespace driver { void HardwareChannelManager::OnInitialize() { // なにもしない } HardwareChannel* HardwareChannelManager::AllocHardwareChannel( u32 priority, HardwareChannel::HardwareChannelCallback callback, void* callbackData ) { HardwareChannel* pChannel = Alloc(); if ( pChannel == NULL ) return NULL; AXVPB* vpb = AX_AcquireVoice( priority, HardwareChannel::ChannelCallback, reinterpret_cast( pChannel ) ); if ( vpb == NULL ) { Free( pChannel ); return NULL; } pChannel->SetParamBlock( vpb ); pChannel->m_Callback = callback; pChannel->m_pCallbackData = callbackData; return pChannel; } void HardwareChannelManager::FreeHardwareChannel( HardwareChannel* pChannel ) { NW_NULL_ASSERT( pChannel ); if ( pChannel->IsAvailable() ) { AX_FreeVoice( pChannel->m_pVpb ); } Free( pChannel ); } } // namespace nw::snd::internal::driver } // namespace nw::snd::internal } // namespace nw::snd } // namespace nw