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 * Lampサウンドヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef LAMP_SOUND_H_ 00026 #define LAMP_SOUND_H_ 00027 00028 namespace Lamp{ 00029 00030 class SoundCapacity; 00031 class SoundManager; 00032 class SoundListener; 00033 00034 //------------------------------------------------------------------------------ 00035 /** 00036 * Lampサウンド 00037 * 00038 * 他のアプリケーションが流している音にも影響を与えてしまうので、プライマリバッファに 00039 * 対してのボリューム操作は行わない。 00040 */ 00041 class LampSound{ 00042 public: 00043 //-------------------------------------------------------------------------- 00044 /** 00045 * 初期化 00046 * @param windowHandle ウィンドウハンドル 00047 * @return 初期化に成功すればtrue 00048 */ 00049 static bool initialize(HWND windowHandle); 00050 00051 /** 00052 * 後始末 00053 */ 00054 static void finalize(); 00055 00056 /** 00057 * プレゼンテーション 00058 * 00059 * 描画ループ毎に呼んでください。 00060 * フェードや3Dサウンドパラメータが適用されます。 00061 */ 00062 static void presentation(); 00063 00064 //-------------------------------------------------------------------------- 00065 /** 00066 * サンプル数の取得 00067 * @return サンプル数 00068 */ 00069 static int getSample(){ Assert(isInitialized_); return sample_; } 00070 00071 /** 00072 * チャンネル数の取得 00073 * @return チャンネル数 00074 */ 00075 static int getChannel(){ Assert(isInitialized_); return channel_; } 00076 00077 /** 00078 * ビット数の取得 00079 * @return ビット数 00080 */ 00081 static int getBit(){ Assert(isInitialized_); return bit_; } 00082 00083 /** 00084 * 文字列への変換 00085 * @return 文字列 00086 */ 00087 static String toString(); 00088 00089 //-------------------------------------------------------------------------- 00090 /** 00091 * サウンド能力の取得 00092 * @return サウンド能力 00093 */ 00094 static SoundCapacity* getCapacity(){ 00095 Assert(isInitialized_); 00096 return soundCapacity_; 00097 } 00098 00099 //-------------------------------------------------------------------------- 00100 /** 00101 * サウンドマネージャの取得 00102 * @return サウンドマネージャ 00103 */ 00104 static SoundManager* getSoundManager(){ 00105 Assert(isInitialized_); 00106 return soundManager_; 00107 } 00108 00109 //-------------------------------------------------------------------------- 00110 /** 00111 * サウンドリスナの取得 00112 * @return サウンドリスナ 00113 */ 00114 static SoundListener* getSoundListener(){ 00115 Assert(isInitialized_); 00116 return soundListener_; 00117 } 00118 00119 private: 00120 //-------------------------------------------------------------------------- 00121 // DirectSound 00122 static DirectSound* directSound_; 00123 // プライマリバッファ 00124 static DirectSoundPrimaryBuffer* primaryBuffer_; 00125 // サウンド能力 00126 static SoundCapacity* soundCapacity_; 00127 // サウンドマネージャ 00128 static SoundManager* soundManager_; 00129 // サウンドリスナ 00130 static SoundListener* soundListener_; 00131 // サンプル数 00132 static int sample_; 00133 // チャンネル数 00134 static int channel_; 00135 // ビット数 00136 static int bit_; 00137 // 初期化フラグ 00138 static bool isInitialized_; 00139 00140 }; 00141 00142 //------------------------------------------------------------------------------ 00143 } // End of namespace Lamp 00144 #endif // End of LAMP_SOUND_H_ 00145 //------------------------------------------------------------------------------