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

Lamp::SoundBuffer Class Reference

サウンドバッファ More...

#include <SoundBuffer.h>

Inheritance diagram for Lamp::SoundBuffer:

Lamp::Sound Lamp::Sound3D Lamp::StereoSound Lamp::StaticSound3D Lamp::StreamSound3D Lamp::StaticSound Lamp::StreamSound List of all members.

Public Member Functions

virtual void setName (const String &name)
 名前の設定

virtual const StringgetName () const
 名前の取得

virtual u_int getSize () const
 サイズの取得

virtual int getSample () const
 サンプル数の取得

virtual int getChannel () const
 チャンネル数の取得

virtual int getBit () const
 ビット数の取得

virtual Focus getFocus () const
 フォーカスの取得

virtual u_int getBufferSize () const
 バッファサイズの取得

virtual bool play ()
 再生

virtual void stop ()
 停止

virtual void suspend ()
 再生の一時停止

virtual bool resume ()
 再生再開

virtual State getState () const
 状態の取得

virtual void setCursor (u_int cursor)
 再生位置設定

virtual u_int getCursor () const
 再生位置取得

virtual void setPriority (int priority)
 優先度の設定

virtual int getPriority () const
 優先度の取得

virtual void setLoop (bool loop)
 ループの設定

virtual bool isLoop () const
 ループしているか

virtual void setVolume (float volume)
 ボリュームの設定

virtual float getVolume () const
 ボリュームの取得

virtual void setFrequency (int frequency)
 周波数の設定

virtual int getFrequency () const
 周波数の取得

virtual void setOriginalFrequency ()
 オリジナル周波数の設定

virtual void fadeIn (float millisecond)
 フェードイン

virtual void fadeOut (float millisecond)
 フェードアウト

virtual void fade (float millisecond, float startVolume, float endVolume)
 フェード

virtual bool isFading () const
 フェード中かどうか

virtual void setComment (const String &comment)
 コメントの設定

virtual const StringgetComment () const
 コメントの取得

virtual bool hasOwnership () const
 所有権があるか

virtual Locklock ()
 ロック

virtual Locklock (u_int offset, u_int bytes)
 ロック

virtual void unlock ()
 アンロック

virtual bool isSoundBuffer () const
 サウンドバッファかどうか


Protected Member Functions

 SoundBuffer (DirectSoundBuffer *soundBuffer)
 コンストラクタ

virtual ~SoundBuffer ()
 デストラクタ

virtual void initialize (u_int size, int sample, int channel, int bit, Focus focus)
 初期化

virtual void copySoundBufferData (SoundBuffer *destination)
 サウンドバッファデータのコピー

virtual bool update ()
 アップデート

DirectSoundBuffergetSoundBuffer ()
 サウンドバッファの取得

virtual void setOwnership (bool ownership)
 所有権の設定

virtual bool playBuffer ()
 バッファの再生

virtual void stopBuffer ()
 バッファの停止

virtual u_int getPlayFlag ()=0
 再生フラグの取得

virtual int getBufferFrequency () const
 バッファ周波数の取得


Friends

class StreamPlayer

Detailed Description

サウンドバッファ

Definition at line 37 of file SoundBuffer.h.


Constructor & Destructor Documentation

Lamp::SoundBuffer::SoundBuffer DirectSoundBuffer soundBuffer  )  [protected]
 

コンストラクタ

Parameters:
soundBuffer サウンドバッファ

Definition at line 37 of file SoundBuffer.cpp.

References Lamp::SoundBuffer::Lock::clear(), Lamp::Sound::decibelToVolume(), DirectXFailed, ErrorOut, getBufferFrequency(), Lamp::Sound::priorityDefault, setLoop(), setOwnership(), and setPriority().


Member Function Documentation

void Lamp::SoundBuffer::copySoundBufferData SoundBuffer destination  )  [protected, virtual]
 

サウンドバッファデータのコピー

Parameters:
destination コピー先サウンドバッファ

Definition at line 74 of file SoundBuffer.cpp.

References getBit(), getBufferSize(), getChannel(), getFocus(), getName(), getPriority(), getSample(), initialize(), isLoop(), setLoop(), setName(), and setPriority().

Referenced by Lamp::Sound3D::copySound3DData(), and Lamp::StereoSound::copyStereoSoundData().

void Lamp::SoundBuffer::fade float  millisecond,
float  startVolume,
float  endVolume
[virtual]
 

フェード

Parameters:
millisecond フェードアウトにかかる時間。0を指定するとフェード中止。
startVolume 開始ボリューム
endVolume 終了ボリューム

Implements Lamp::Sound.

Definition at line 235 of file SoundBuffer.cpp.

References Assert, play(), and setVolume().

Referenced by fadeIn(), and fadeOut().

virtual void Lamp::SoundBuffer::fadeIn float  millisecond  )  [inline, virtual]
 

フェードイン

Parameters:
millisecond フェードインにかかる時間。0を指定するとフェード中止。

Implements Lamp::Sound.

Definition at line 217 of file SoundBuffer.h.

References fade().

virtual void Lamp::SoundBuffer::fadeOut float  millisecond  )  [inline, virtual]
 

フェードアウト

Parameters:
millisecond フェードアウトにかかる時間。0を指定するとフェード中止。

Implements Lamp::Sound.

Definition at line 225 of file SoundBuffer.h.

References fade(), and getVolume().

virtual int Lamp::SoundBuffer::getBit  )  const [inline, virtual]
 

ビット数の取得

Returns:
ビット数

Implements Lamp::Sound.

Definition at line 78 of file SoundBuffer.h.

Referenced by copySoundBufferData(), and Lamp::StreamPlayer::writeStream().

int Lamp::SoundBuffer::getBufferFrequency  )  const [protected, virtual]
 

バッファ周波数の取得

Returns:
バッファ周波数

Definition at line 221 of file SoundBuffer.cpp.

References Assert, DirectXFailed, ErrorOut, and u_long.

Referenced by setOriginalFrequency(), and SoundBuffer().

virtual u_int Lamp::SoundBuffer::getBufferSize  )  const [inline, virtual]
 

バッファサイズの取得

Returns:
バッファサイズ

Definition at line 90 of file SoundBuffer.h.

References u_int.

Referenced by copySoundBufferData(), Lamp::StreamPlayer::initialize(), Lamp::StreamSound3D::setSoundReader(), Lamp::StreamSound::setSoundReader(), Lamp::StereoSound::toString(), Lamp::Sound3D::toString(), and Lamp::StreamPlayer::writeStream().

virtual int Lamp::SoundBuffer::getChannel  )  const [inline, virtual]
 

チャンネル数の取得

Returns:
チャンネル数

Implements Lamp::Sound.

Definition at line 72 of file SoundBuffer.h.

Referenced by copySoundBufferData().

virtual const String& Lamp::SoundBuffer::getComment  )  const [inline, virtual]
 

コメントの取得

Returns:
コメント

Implements Lamp::Sound.

Definition at line 256 of file SoundBuffer.h.

u_int Lamp::SoundBuffer::getCursor  )  const [virtual]
 

再生位置取得

Returns:
再生位置のバイト数

Implements Lamp::Sound.

Reimplemented in Lamp::StreamSound3D, and Lamp::StreamSound.

Definition at line 179 of file SoundBuffer.cpp.

References DirectXFailed, ErrorOut, NULL, u_int, and u_long.

virtual Focus Lamp::SoundBuffer::getFocus  )  const [inline, virtual]
 

フォーカスの取得

Returns:
フォーカス

Implements Lamp::Sound.

Definition at line 84 of file SoundBuffer.h.

References Lamp::Sound::Focus.

Referenced by copySoundBufferData().

virtual int Lamp::SoundBuffer::getFrequency  )  const [inline, virtual]
 

周波数の取得

Returns:
周波数

Implements Lamp::Sound.

Definition at line 203 of file SoundBuffer.h.

virtual const String& Lamp::SoundBuffer::getName  )  const [inline, virtual]
 

名前の取得

Returns:
名前

Implements Lamp::Sound.

Definition at line 53 of file SoundBuffer.h.

Referenced by copySoundBufferData().

virtual u_int Lamp::SoundBuffer::getPlayFlag  )  [protected, pure virtual]
 

再生フラグの取得

Returns:
再生フラグ

Implemented in Lamp::StaticSound3D, Lamp::StreamSound3D, Lamp::StaticSound, and Lamp::StreamSound.

Referenced by playBuffer().

virtual int Lamp::SoundBuffer::getPriority  )  const [inline, virtual]
 

優先度の取得

Returns:
32767〜-32768の間の値を持つ優先度

Implements Lamp::Sound.

Definition at line 156 of file SoundBuffer.h.

Referenced by copySoundBufferData(), and playBuffer().

virtual int Lamp::SoundBuffer::getSample  )  const [inline, virtual]
 

サンプル数の取得

Returns:
サンプル数

Implements Lamp::Sound.

Definition at line 66 of file SoundBuffer.h.

Referenced by copySoundBufferData().

virtual u_int Lamp::SoundBuffer::getSize  )  const [inline, virtual]
 

サイズの取得

Returns:
サイズ

Implements Lamp::Sound.

Reimplemented in Lamp::StreamSound3D, and Lamp::StreamSound.

Definition at line 60 of file SoundBuffer.h.

References u_int.

Referenced by setCursor(), and Lamp::StreamPlayer::writeStream().

DirectSoundBuffer* Lamp::SoundBuffer::getSoundBuffer  )  [inline, protected]
 

サウンドバッファの取得

Returns:
サウンドバッファ

Definition at line 403 of file SoundBuffer.h.

References DirectSoundBuffer.

Referenced by Lamp::StreamPlayer::initialize(), and Lamp::StereoSound::setPan().

virtual float Lamp::SoundBuffer::getVolume  )  const [inline, virtual]
 

ボリュームの取得

Returns:
ボリュームを1.fから0.fで返す

Implements Lamp::Sound.

Definition at line 188 of file SoundBuffer.h.

Referenced by fadeOut().

virtual bool Lamp::SoundBuffer::hasOwnership  )  const [inline, virtual]
 

所有権があるか

Returns:
所有権。falseならすでに誰かに所有されている

Implements Lamp::Sound.

Definition at line 265 of file SoundBuffer.h.

void Lamp::SoundBuffer::initialize u_int  size,
int  sample,
int  channel,
int  bit,
Focus  focus
[protected, virtual]
 

初期化

Parameters:
size サイズ
sample サンプル数
channel チャンネル数
bit ビット数
focus フォーカス

Definition at line 56 of file SoundBuffer.cpp.

Referenced by copySoundBufferData(), Lamp::SoundManager::createStaticSound(), Lamp::SoundManager::createStaticSound3D(), Lamp::SoundManager::createStreamSound(), and Lamp::SoundManager::createStreamSound3D().

virtual bool Lamp::SoundBuffer::isFading  )  const [inline, virtual]
 

フェード中かどうか

Returns:
フェード中ならtrue

Implements Lamp::Sound.

Definition at line 241 of file SoundBuffer.h.

Referenced by update().

virtual bool Lamp::SoundBuffer::isLoop  )  const [inline, virtual]
 

ループしているか

Returns:
ループしているならtrue

Implements Lamp::Sound.

Definition at line 173 of file SoundBuffer.h.

Referenced by copySoundBufferData(), Lamp::StaticSound3D::getPlayFlag(), Lamp::StaticSound::getPlayFlag(), and Lamp::StreamPlayer::writeStream().

virtual bool Lamp::SoundBuffer::isSoundBuffer  )  const [inline, virtual]
 

サウンドバッファかどうか

Returns:
サウンドバッファならtrue

Reimplemented from Lamp::Sound.

Definition at line 355 of file SoundBuffer.h.

SoundBuffer::Lock & Lamp::SoundBuffer::lock u_int  offset,
u_int  bytes
[virtual]
 

ロック

失敗した場合、Lock::isValid()がfalseを返します。

Parameters:
offset オフセットをバイト数で指定する
bytes ロックするバイト数
Returns:
ロックデータ

Definition at line 293 of file SoundBuffer.cpp.

References Lamp::SoundBuffer::Lock::address0_, Lamp::SoundBuffer::Lock::address1_, Assert, Lamp::SoundBuffer::Lock::clear(), DirectXFailed, DirectXSucceeded, ErrorOut, Lamp::SoundBuffer::Lock::isValid(), Lamp::SoundBuffer::Lock::size0_, and Lamp::SoundBuffer::Lock::size1_.

SoundBuffer::Lock & Lamp::SoundBuffer::lock  )  [virtual]
 

ロック

バッファ全体をロックします。失敗した場合、Lock::isValid()がfalseを返します。

Returns:
ロックデータ

Definition at line 272 of file SoundBuffer.cpp.

References Lamp::SoundBuffer::Lock::address0_, Assert, Lamp::SoundBuffer::Lock::clear(), DirectXFailed, DirectXSucceeded, ErrorOut, Lamp::SoundBuffer::Lock::isValid(), NULL, and Lamp::SoundBuffer::Lock::size0_.

Referenced by Lamp::StreamPlayer::writeStream().

bool Lamp::SoundBuffer::play  )  [virtual]
 

再生

Returns:
正常に再生されればtrue

Implements Lamp::Sound.

Reimplemented in Lamp::Sound3D, Lamp::StreamSound3D, and Lamp::StreamSound.

Definition at line 85 of file SoundBuffer.cpp.

References playBuffer().

Referenced by fade(), and Lamp::SoundCache::playStereoSound().

bool Lamp::SoundBuffer::playBuffer  )  [protected, virtual]
 

バッファの再生

Returns:
成功すればtrue

Definition at line 140 of file SoundBuffer.cpp.

References Assert, DirectXFailed, DirectXSucceeded, ErrorOut, getPlayFlag(), getPriority(), and u_int.

Referenced by play(), and resume().

bool Lamp::SoundBuffer::resume  )  [virtual]
 

再生再開

Returns:
正常に再生が再開されればtrue

Implements Lamp::Sound.

Definition at line 108 of file SoundBuffer.cpp.

References getState(), playBuffer(), Lamp::Sound::State, and Lamp::Sound::stateStop.

virtual void Lamp::SoundBuffer::setComment const String comment  )  [inline, virtual]
 

コメントの設定

Parameters:
comment コメント

Implements Lamp::Sound.

Definition at line 250 of file SoundBuffer.h.

void Lamp::SoundBuffer::setCursor u_int  cursor  )  [virtual]
 

再生位置設定

Parameters:
cursor 再生位置のバイト数

Implements Lamp::Sound.

Reimplemented in Lamp::StreamSound3D, and Lamp::StreamSound.

Definition at line 171 of file SoundBuffer.cpp.

References Assert, DirectXFailed, ErrorOut, and getSize().

Referenced by stop().

void Lamp::SoundBuffer::setFrequency int  frequency  )  [virtual]
 

周波数の設定

Parameters:
frequency 周波数

Implements Lamp::Sound.

Definition at line 202 of file SoundBuffer.cpp.

References Assert, DirectXFailed, and ErrorOut.

Referenced by Lamp::SoundCache::playSound3D(), and Lamp::SoundCache::playStereoSound().

virtual void Lamp::SoundBuffer::setLoop bool  loop  )  [inline, virtual]
 

ループの設定

ループは次回再生時に適用される

Parameters:
loop ループするならtrue

Implements Lamp::Sound.

Definition at line 167 of file SoundBuffer.h.

Referenced by copySoundBufferData(), Lamp::SoundCache::loadStaticSound(), Lamp::SoundCache::loadStaticSound3D(), and SoundBuffer().

virtual void Lamp::SoundBuffer::setName const String name  )  [inline, virtual]
 

名前の設定

Parameters:
name 名前

Implements Lamp::Sound.

Definition at line 47 of file SoundBuffer.h.

Referenced by copySoundBufferData().

virtual void Lamp::SoundBuffer::setOwnership bool  ownership  )  [inline, protected, virtual]
 

所有権の設定

Parameters:
ownership 所有権。falseなら誰かに所有されている

Implements Lamp::Sound.

Definition at line 410 of file SoundBuffer.h.

Referenced by SoundBuffer().

virtual void Lamp::SoundBuffer::setPriority int  priority  )  [inline, virtual]
 

優先度の設定

優先度は次回再生時に適用される

Parameters:
priority 優先度を32767〜-32768の間で指定

Implements Lamp::Sound.

Definition at line 146 of file SoundBuffer.h.

References Assert, Lamp::Sound::priorityMax, and Lamp::Sound::priorityMin.

Referenced by copySoundBufferData(), Lamp::SoundCache::loadStaticSound(), Lamp::SoundCache::loadStaticSound3D(), and SoundBuffer().

void Lamp::SoundBuffer::setVolume float  volume  )  [virtual]
 

ボリュームの設定

Parameters:
volume ボリュームを1.fから0.fで設定する

Implements Lamp::Sound.

Definition at line 190 of file SoundBuffer.cpp.

References DirectXFailed, ErrorOut, and Lamp::Sound::volumeToDecibel().

Referenced by fade(), Lamp::SoundCache::playSound3D(), Lamp::SoundCache::playStereoSound(), and update().

bool Lamp::SoundBuffer::update  )  [protected, virtual]
 

アップデート

Returns:
アップデートが必要な処理が終了したらtrueを返す

Implements Lamp::Sound.

Definition at line 253 of file SoundBuffer.cpp.

References Assert, isFading(), setVolume(), and stop().


The documentation for this class was generated from the following files:
Generated on Wed Mar 16 10:29:51 2005 for Lamp by doxygen 1.3.2