/*---------------------------------------------------------------------------* Project: NintendoWare File: snd_WaveSound.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: 28274 $ *---------------------------------------------------------------------------*/ #ifndef NW_SND_WAVE_SOUND_H_ #define NW_SND_WAVE_SOUND_H_ #include #include #include #include namespace nw { namespace snd { /* ======================================================================== type declarataion ======================================================================== */ class WaveSoundHandle; /* ======================================================================== class definition ======================================================================== */ namespace internal { class WaveSound; typedef SoundInstanceManager WaveSoundInstanceManager; class WaveSound : public BasicSound { friend class WaveSoundHandle; public: NW_UT_RUNTIME_TYPEINFO; // ダウンキャスト用の実行時型情報を埋め込みます /* ------------------------------------------------------------------------ class member ------------------------------------------------------------------------ */ public: WaveSound( WaveSoundInstanceManager& manager ); void Prepare( const void* waveSoundBase, s32 waveSoundOffset, driver::WaveSoundPlayer::StartOffsetType startOffsetType, s32 offset, const driver::WaveSoundPlayer::WaveSoundCallback* callback, u32 callbackData ); virtual void Initialize(); virtual void Finalize(); virtual bool IsPrepared() const { return m_PreparedFlag; } // パラメータ設定 void SetChannelPriority( int priority ); void SetReleasePriorityFix( bool fix ); // パラメータ取得 bool ReadWaveSoundDataInfo( WaveSoundDataInfo* info ) const; long GetPlaySamplePosition() const; // デバッグ関数 DebugSoundType GetSoundType() const { return DEBUG_SOUND_TYPE_WAVESOUND; } protected: virtual bool IsAttachedTempSpecialHandle(); virtual void DetachTempSpecialHandle(); virtual driver::BasicSoundPlayer* GetBasicSoundPlayerHandle() { return &m_WaveSoundPlayerInstance; } virtual void OnUpdatePlayerPriority(); private: driver::WaveSoundPlayer m_WaveSoundPlayerInstance; WaveSoundHandle* m_pTempSpecialHandle; WaveSoundInstanceManager& m_pManager; bool m_PreparedFlag; bool m_InitializeFlag; }; } // namespace nw::snd::internal } // namespace nw::snd } // namespace nw #endif /* NW_SND_WAVE_SOUND_H_ */