Browse Subversion Repository
Contents of /sound/SoundEffectManager.h
Parent Directory
| Revision Log
Revision 364 -
( show annotations)
( download)
( as text)
Tue Apr 22 21:18:06 2008 UTC
(15 years, 11 months ago)
by satofumi
File MIME type: text/x-chdr
File size: 1463 byte(s)
what() を追加
| 1 |
#ifndef SOUND_EFFECT_MANAGER_H |
| 2 |
#define SOUND_EFFECT_MANAGER_H |
| 3 |
|
| 4 |
/*! |
| 5 |
\file |
| 6 |
\brief 効果音の管理 |
| 7 |
|
| 8 |
\author Satofumi KAMIMURA |
| 9 |
|
| 10 |
$Id$ |
| 11 |
*/ |
| 12 |
|
| 13 |
#include <memory> |
| 14 |
|
| 15 |
|
| 16 |
namespace beego { |
| 17 |
/*! |
| 18 |
\brief 効果音の管理クラス |
| 19 |
*/ |
| 20 |
class SoundEffectManager { |
| 21 |
SoundEffectManager(const SoundEffectManager& rhs); |
| 22 |
SoundEffectManager& operator = (const SoundEffectManager& rhs); |
| 23 |
|
| 24 |
struct pImpl; |
| 25 |
//const std::auto_ptr<pImpl> pimpl; |
| 26 |
pImpl* pimpl; |
| 27 |
|
| 28 |
public: |
| 29 |
enum { |
| 30 |
AllChannel = -1, |
| 31 |
InvalidId = 0, |
| 32 |
DefaultFadeOut = 100, |
| 33 |
}; |
| 34 |
SoundEffectManager(void); |
| 35 |
~SoundEffectManager(void); |
| 36 |
const char* what(void); |
| 37 |
|
| 38 |
bool isInitialized(void); |
| 39 |
bool registerEffect(int effect_id, const char* file_path); |
| 40 |
void unregisterEffect(int effect_id); |
| 41 |
|
| 42 |
// 音量の割合を設定 |
| 43 |
void updateVolume(size_t percent, int channel_id = AllChannel); |
| 44 |
|
| 45 |
// 再生開始, 管理用の再生 ID を返す, 音量も指定可能, フェードイン指定 |
| 46 |
int play(int effect_id, size_t fade_in_msec = 0, int volume_percent = 100); |
| 47 |
|
| 48 |
// ID 指定による停止、フェードアウト指定、終了を待つのも可 |
| 49 |
void stop(int serial_id = AllChannel, |
| 50 |
size_t fade_out_msec = DefaultFadeOut); |
| 51 |
|
| 52 |
bool nowPlaying(int serial_id = AllChannel); |
| 53 |
|
| 54 |
// !!! 解放まわりのメソッド、そのうち |
| 55 |
|
| 56 |
// !!! 資源毎にボリュームを設定するメソッドとかか? |
| 57 |
void setEachVolume(size_t effect_id, size_t percent); |
| 58 |
|
| 59 |
//void terminate(void); |
| 60 |
}; |
| 61 |
}; |
| 62 |
|
| 63 |
#endif /* !SOUND_EFFECT_MANAGER_H */ |
| |