//------------------------------------------------------------------------------
// 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
 * 静的サウンドヘッダ
 * @author Junpee
 */

#ifndef STATIC_SOUND_H_
#define STATIC_SOUND_H_

#include <Sound/Stereo/StereoSound.h>

namespace Lamp{

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

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

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

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

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

private:

};

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