/*---------------------------------------------------------------------------* Project: NintendoWare File: snd_WaveFile.cpp 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: 31311 $ *---------------------------------------------------------------------------*/ #include "precompiled.h" #include #include #include // ut::AddOffsetToPtr namespace nw { namespace snd { namespace internal { // // WaveFile::FileHeader // const WaveFile::InfoBlock* WaveFile::FileHeader::GetInfoBlock() const { return reinterpret_cast( GetBlock( ElementType_WaveFile_InfoBlock ) ); } const WaveFile::DataBlock* WaveFile::FileHeader::GetDataBlock() const { return reinterpret_cast( GetBlock( ElementType_WaveFile_DataBlock ) ); } // // WaveFile::InfoBlockBody // const WaveFile::ChannelInfo& WaveFile::InfoBlockBody::GetChannelInfo( s32 channelIndex ) const { NW_ASSERT( channelIndex < GetChannelCount() ); return *reinterpret_cast( channelInfoReferenceTable.GetReferedItem( channelIndex ) ); } // // WaveFile::ChannelInfo // const void* WaveFile::ChannelInfo::GetSamplesAddress( const void* dataBlockBodyAddress ) const { return reinterpret_cast( ut::AddOffsetToPtr( dataBlockBodyAddress, referToSamples.offset ) ); } const WaveFile::DspAdpcmInfo& WaveFile::ChannelInfo::GetDspAdpcmInfo() const { return *reinterpret_cast( ut::AddOffsetToPtr( this, referToAdpcmInfo.offset ) ); } } // namespace nw::snd::internal } // namespace nw::snd } // namespace nw