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

SoundCapacity.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 SOUND_CAPACITY_H_
00026 #define SOUND_CAPACITY_H_
00027 
00028 namespace Lamp{
00029 
00030 //------------------------------------------------------------------------------
00031 /**
00032  * サウンド能力
00033  */
00034 class SoundCapacity{
00035 friend class LampSound;
00036 public:
00037     //--------------------------------------------------------------------------
00038     /**
00039      * 更新
00040      * @return 成功すればtrue
00041      */
00042     virtual bool refresh();
00043 
00044     //--------------------------------------------------------------------------
00045     /**
00046      * Microsoft認定ドライバか
00047      * @return Microsoft認定ドライバならtrue
00048      */
00049     virtual bool isCertifiedDriver() const{
00050         return ((capacity_.dwFlags & DSCAPS_CERTIFIED) != 0);
00051     }
00052 
00053     /**
00054      * 連続的な周波数設定をサポートしているか
00055      * @return 連続的な周波数設定をサポートしているならtrue
00056      */
00057     virtual bool isSupportedContinuousRate() const{
00058         return ((capacity_.dwFlags & DSCAPS_CONTINUOUSRATE) != 0);
00059     }
00060 
00061     /**
00062      * エミュレートドライバか
00063      * @return エミュレートドライバならtrue
00064      */
00065     virtual bool isEmulatedDriver() const{
00066         return ((capacity_.dwFlags & DSCAPS_EMULDRIVER) != 0);
00067     }
00068 
00069     //--------------------------------------------------------------------------
00070     /**
00071      * 16bitプライマリバッファをサポートするか
00072      * @return 16bitプライマリバッファをサポートするならtrue
00073      */
00074     virtual bool isSupported16bitPrimaryBuffer() const{
00075         return ((capacity_.dwFlags & DSCAPS_PRIMARY16BIT) != 0);
00076     }
00077 
00078     /**
00079      * 8bitプライマリバッファをサポートするか
00080      * @return 8bitプライマリバッファをサポートするならtrue
00081      */
00082     virtual bool isSupported8bitPrimaryBuffer() const{
00083         return ((capacity_.dwFlags & DSCAPS_PRIMARY8BIT) != 0);
00084     }
00085 
00086     /**
00087      * モノラルプライマリバッファをサポートするか
00088      * @return モノラルプライマリバッファをサポートするならtrue
00089      */
00090     virtual bool isSupportedMonauralPrimaryBuffer() const{
00091         return ((capacity_.dwFlags & DSCAPS_PRIMARYMONO) != 0);
00092     }
00093 
00094     /**
00095      * ステレオプライマリバッファをサポートするか
00096      * @return ステレオプライマリバッファをサポートするならtrue
00097      */
00098     virtual bool isSupportedStereoPrimaryBuffer() const{
00099         return ((capacity_.dwFlags & DSCAPS_PRIMARYSTEREO) != 0);
00100     }
00101 
00102     //--------------------------------------------------------------------------
00103     /**
00104      * 16bitセカンダリバッファをサポートするか
00105      * @return 16bitセカンダリバッファをサポートするならtrue
00106      */
00107     virtual bool isSupported16bitSecondaryBuffer() const{
00108         return ((capacity_.dwFlags & DSCAPS_SECONDARY16BIT) != 0);
00109     }
00110 
00111     /**
00112      * 8bitセカンダリバッファをサポートするか
00113      * @return 8bitセカンダリバッファをサポートするならtrue
00114      */
00115     virtual bool isSupported8bitSecondaryBuffer() const{
00116         return ((capacity_.dwFlags & DSCAPS_SECONDARY8BIT) != 0);
00117     }
00118 
00119     /**
00120      * モノラルセカンダリバッファをサポートするか
00121      * @return モノラルセカンダリバッファをサポートするならtrue
00122      */
00123     virtual bool isSupportedMonauralSecondaryBuffer() const{
00124         return ((capacity_.dwFlags & DSCAPS_SECONDARYMONO) != 0);
00125     }
00126 
00127     /**
00128      * ステレオセカンダリバッファをサポートするか
00129      * @return ステレオセカンダリバッファをサポートするならtrue
00130      */
00131     virtual bool isSupportedStereoSecondaryBuffer() const{
00132         return ((capacity_.dwFlags & DSCAPS_SECONDARYSTEREO) != 0);
00133     }
00134 
00135     //--------------------------------------------------------------------------
00136     /**
00137      * セカンダリの最大サンプリングレート取得
00138      * @return セカンダリの最大サンプリングレート
00139      */
00140     virtual u_int getMaxSecondarySampleRate() const{
00141         return capacity_.dwMaxSecondarySampleRate;
00142     }
00143 
00144     /**
00145      * セカンダリの最小サンプリングレート取得
00146      * @return セカンダリの最小サンプリングレート
00147      */
00148     virtual u_int getMinSecondarySampleRate() const{
00149         return capacity_.dwMinSecondarySampleRate;
00150     }
00151 
00152     //--------------------------------------------------------------------------
00153     /**
00154      * 文字列への変換
00155      * @return 文字列
00156      */
00157     virtual String toString() const;
00158 
00159 private:
00160     //--------------------------------------------------------------------------
00161     /**
00162      * コンストラクタ
00163      */
00164     SoundCapacity();
00165 
00166     /**
00167      * デストラクタ
00168      */
00169     virtual ~SoundCapacity();
00170 
00171     /**
00172      * 初期化
00173      * @param directSound DirectSound
00174      * @return 成功すればtrue
00175      */
00176     virtual bool initialize(DirectSound* directSound);
00177 
00178     /**
00179      * 能力チェック
00180      * @return 能力があればtrue
00181      */
00182     virtual bool checkCapacity();
00183 
00184     // bool文字列取得
00185     String getBoolString(bool flag) const{
00186         if(flag){ return "○"; }
00187         else{ return "×"; }
00188     }
00189 
00190     //--------------------------------------------------------------------------
00191     // コピーコンストラクタの隠蔽
00192     SoundCapacity(const SoundCapacity& copy);
00193 
00194     // 代入コピーの隠蔽
00195     void operator =(const SoundCapacity& copy);
00196 
00197     //--------------------------------------------------------------------------
00198     // DirectSound
00199     DirectSound* directSound_;
00200     // 能力
00201     DSCAPS capacity_;
00202 
00203 };
00204 
00205 //------------------------------------------------------------------------------
00206 } // End of namespace Lamp
00207 #endif // End of SOUND_CAPACITY_H_
00208 //------------------------------------------------------------------------------

Generated on Wed Mar 16 10:29:36 2005 for Lamp by doxygen 1.3.2