00001 //------------------------------------------------------------------------------ 00002 // Lamp : Open source game middleware 00003 // Copyright (C) 2004 Junpei Ohtani ( Email : junpee@users.sourceforge.jp ) 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 //------------------------------------------------------------------------------ 00019 00020 /** @file 00021 * ステレオサウンドヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef STEREO_SOUND_H_ 00026 #define STEREO_SOUND_H_ 00027 00028 #include <Sound/System/SoundBuffer.h> 00029 00030 namespace Lamp{ 00031 00032 //------------------------------------------------------------------------------ 00033 /** 00034 * ステレオサウンド 00035 */ 00036 class StereoSound : public SoundBuffer{ 00037 friend class SoundManager; 00038 public: 00039 //-------------------------------------------------------------------------- 00040 /** 00041 * パンの設定 00042 * @param pan パンを-1.f(左)から1.f(右)の間で指定する 00043 */ 00044 virtual void setPan(float pan); 00045 00046 /** 00047 * パンの取得 00048 * @return パン 00049 */ 00050 virtual float getPan() const{ return pan_; } 00051 00052 //-------------------------------------------------------------------------- 00053 /** 00054 * リセット 00055 * @param flags リセットフラグ 00056 */ 00057 virtual void reset(Reset flags); 00058 00059 //-------------------------------------------------------------------------- 00060 /** 00061 * 文字列への変換 00062 * @return 文字列 00063 */ 00064 virtual String toString() const; 00065 00066 //-------------------------------------------------------------------------- 00067 // RTTI 00068 //-------------------------------------------------------------------------- 00069 /** 00070 * ステレオサウンドかどうか 00071 * @return ステレオサウンドならtrue 00072 */ 00073 virtual bool isStereoSound() const{ return true; } 00074 00075 protected: 00076 //-------------------------------------------------------------------------- 00077 /** 00078 * コンストラクタ 00079 * @param soundBuffer サウンドバッファ 00080 */ 00081 StereoSound(DirectSoundBuffer* soundBuffer); 00082 00083 /** 00084 * デストラクタ 00085 */ 00086 virtual ~StereoSound(); 00087 00088 /** 00089 * ステレオサウンドデータのコピー 00090 * @param destination コピー先ステレオサウンド 00091 */ 00092 virtual void copyStereoSoundData(StereoSound* destination); 00093 00094 private: 00095 // パン 00096 float pan_; 00097 00098 }; 00099 00100 //------------------------------------------------------------------------------ 00101 } // End of namespace Lamp 00102 #endif // End of STEREO_SOUND_H_ 00103 //------------------------------------------------------------------------------