//------------------------------------------------------------------------------
// Lamp : Open source game middleware
// Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//------------------------------------------------------------------------------

/** @file
 * 静的3Dサウンドヘッダ
 * @author Junpee
 */

#ifndef STATIC_SOUND_3D_H_
#define STATIC_SOUND_3D_H_

#include <Sound/3D/Sound3D.h>

namespace Lamp{

//------------------------------------------------------------------------------
/**
 * 静的3Dサウンド
 */
class StaticSound3D : public Sound3D{
friend class SoundManager;
public:
	/**
	 * 複製
	 * @return 複製されたサウンド。失敗したらNULLを返す
	 */
	virtual Sound* clone();

	//--------------------------------------------------------------------------
	// RTTI
	//--------------------------------------------------------------------------
	/**
	 * 静的3Dサウンドかどうか
	 * @return 静的3Dサウンドならtrue
	 */
	virtual bool isStaticSound3D() const{ return true; }

	//--------------------------------------------------------------------------
protected:
	/**
	 * コンストラクタ
	 * @param soundBuffer サウンドバッファ
	 */
	StaticSound3D(DirectSoundBuffer* soundBuffer);

	/**
	 * デストラクタ
	 */
	virtual ~StaticSound3D();

	/**
	 * 再生フラグの取得
	 * @return 再生フラグ
	 */
	virtual u_int getPlayFlag(){
		// プライオリティ、距離による動的ボイス管理
		u_int result =
			(DSBPLAY_TERMINATEBY_PRIORITY | DSBPLAY_TERMINATEBY_DISTANCE);
		// ループ
		if(isLoop()){ result |= DSBPLAY_LOOPING; }
		return result;
	}

private:

};

//------------------------------------------------------------------------------
} // End of namespace Lamp
#endif // End of STATIC_SOUND_3D_H_
//------------------------------------------------------------------------------
