Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# StaticSound.h

Go to the documentation of this file.

    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 STATIC_SOUND_H_
    00026 #define STATIC_SOUND_H_
    00027
    00028 #include <Sound/Stereo/StereoSound.h>
    00029
    00030 namespace Lamp{
    00031
    00032 //------------------------------------------------------------------------------
    00033 /**
    00034  * 静的サウンド
    00035  */
    00036 class StaticSound : public StereoSound{
    00037 friend class SoundManager;
    00038 public:
    00039     /**
    00040      * 複製
    00041      * @return 複製されたサウンド。失敗したらNULLを返す
    00042      */
    00043     virtual Sound* clone();
    00044
    00045     //--------------------------------------------------------------------------
    00046     // RTTI
    00047     //--------------------------------------------------------------------------
    00048     /**
    00049      * 静的サウンドかどうか
    00050      * @return 静的サウンドならtrue
    00051      */
    00052     virtual bool isStaticSound() const{ return true; }
    00053
    00054     //--------------------------------------------------------------------------
    00055 protected:
    00056     /**
    00057      * コンストラクタ
    00058      * @param soundBuffer サウンドバッファ
    00059      */
    00060     StaticSound(DirectSoundBuffer* soundBuffer);
    00061
    00062     /**
    00063      * デストラクタ
    00064      */
    00065     virtual ~StaticSound();
    00066
    00067     /**
    00068      * 再生フラグの取得
    00069      * @return 再生フラグ
    00070      */
    00071     virtual u_int getPlayFlag(){
    00072         // プライオリティ、再生時間による動的ボイス管理
    00073         u_int result =
    00074             (DSBPLAY_TERMINATEBY_PRIORITY | DSBPLAY_TERMINATEBY_TIME);
    00075         // ループ
    00076         if(isLoop()){ result |= DSBPLAY_LOOPING; }
    00077         return result;
    00078     }
    00079
    00080 private:
    00081
    00082 };
    00083
    00084 //------------------------------------------------------------------------------
    00085 } // End of namespace Lamp
    00086 #endif // End of STATIC_SOUND_H_
    00087 //------------------------------------------------------------------------------