1/*---------------------------------------------------------------------------* 2 Project: NintendoWare 3 File: snd_HardwareChannelManagerAX.cppi 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: $ 16 *---------------------------------------------------------------------------*/ 17 18namespace nw { 19namespace snd { 20namespace internal { 21namespace driver { 22 23void HardwareChannelManager::OnInitialize() 24{ 25 // なにもしない 26} 27 28HardwareChannel* HardwareChannelManager::AllocHardwareChannel( 29 u32 priority, 30 HardwareChannel::HardwareChannelCallback callback, 31 void* callbackData 32) 33{ 34 HardwareChannel* pChannel = Alloc(); 35 if ( pChannel == NULL ) return NULL; 36 37 AXVPB* vpb = AX_AcquireVoice( 38 priority, 39 HardwareChannel::ChannelCallback, 40 reinterpret_cast<u32>( pChannel ) 41 ); 42 if ( vpb == NULL ) 43 { 44 Free( pChannel ); 45 return NULL; 46 } 47 48 pChannel->SetParamBlock( vpb ); 49 pChannel->m_Callback = callback; 50 pChannel->m_pCallbackData = callbackData; 51 52 return pChannel; 53} 54 55void HardwareChannelManager::FreeHardwareChannel( HardwareChannel* pChannel ) 56{ 57 NW_NULL_ASSERT( pChannel ); 58 59 if ( pChannel->IsAvailable() ) 60 { 61 AX_FreeVoice( pChannel->m_pVpb ); 62 } 63 Free( pChannel ); 64} 65 66} // namespace nw::snd::internal::driver 67} // namespace nw::snd::internal 68} // namespace nw::snd 69} // namespace nw 70