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

Lamp::Sound Class Reference

サウンド More...

#include <Sound.h>

Inheritance diagram for Lamp::Sound:

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

Public Types

enum  State { statePlay, stateSuspend, stateStop, stateLost }
 ステート More...

enum  Focus { focusNormal = 0, focusSticky, focusGlobal }
 フォーカス More...

enum  Reset {
  resetName = (1), resetCursor = (resetName << 1), resetPriority = (resetCursor << 1), resetLoop = (resetPriority << 1),
  resetLoopCursor = (resetLoop << 1), resetVolume = (resetLoopCursor << 1), resetFrequency = (resetVolume << 1), resetFade = (resetFrequency << 1),
  resetPan = (resetFade << 1), resetPosition = (resetPan << 1), resetVelocity = (resetPosition << 1), resetDistance = (resetVelocity << 1),
  resetConeDirection = (resetDistance << 1), resetConeAngle = (resetConeDirection << 1), resetConeOutsideVolume = (resetConeAngle << 1), reset3DEnabled = (resetConeOutsideVolume << 1),
  resetNone = (0), resetAll = (0xffffffff), resetRuntime
}
 リセットフラグ


Public Member Functions

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

virtual const StringgetName () const=0
 名前の取得

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

virtual float getTimeLength () const
 時間の長さの取得

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

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

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

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

virtual u_int getOneSampleBytes () const
 1サンプルのバイト数取得

virtual u_int getOneSecondBytes () const
 1秒のバイト数取得

virtual float byteToTime (u_int byte) const
 バイト数から時間への変換

virtual u_int timeToByte (float time) const
 時間からバイト数への変換

virtual bool play ()=0
 再生

virtual void stop ()=0
 停止

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

virtual bool resume ()=0
 再生再開

virtual void reset (Reset flags)
 リセット

virtual State getState () const=0
 状態の取得

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

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

virtual void setCurrentTime (float timeCursor)
 再生時間設定

virtual float getCurrentTime () const
 現在の再生時間取得

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

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

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

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

virtual void setLoopCursor (u_int loopCursor)
 ループ位置の設定

virtual u_int getLoopCursor () const
 ループ位置の取得

virtual void setLoopTime (float loopTimeCursor)
 ループ時間の設定

virtual float getLoopTime () const
 ループ時間の取得

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

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

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

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

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

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

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

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

virtual void stopFade ()
 フェードの中止

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

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

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

virtual void applyCommentOption ()
 コメントオプションの適用

virtual Soundclone ()
 複製 ストリームは複製できない。

virtual bool hasOwnership () const=0
 所有権の取得

virtual String toString () const
 文字列への変換

virtual bool useStream () const
 ストリームを使用しているか

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

virtual SoundBuffercastSoundBuffer () const
 サウンドバッファへのキャスト

virtual bool isStereoSound () const
 ステレオサウンドかどうか

virtual StereoSoundcastStereoSound () const
 ステレオサウンドへのキャスト

virtual bool isSound3D () const
 3Dサウンドかどうか

virtual Sound3DcastSound3D () const
 3Dサウンドへのキャスト

virtual bool isStaticSound () const
 静的サウンドかどうか

virtual StaticSoundcastStaticSound () const
 静的サウンドへのキャスト

virtual bool isStreamSound () const
 ストリームサウンドかどうか

virtual StreamSoundcastStreamSound () const
 ストリームサウンドへのキャスト

virtual bool isStaticSound3D () const
 静的3Dサウンドかどうか

virtual StaticSound3DcastStaticSound3D () const
 静的3Dサウンドへのキャスト

virtual bool isStreamSound3D () const
 ストリーム3Dサウンドかどうか

virtual StreamSound3DcastStreamSound3D () const
 ストリーム3Dサウンドへのキャスト


Static Public Member Functions

int volumeToDecibel (float volume)
 ボリュームデシベル変換

float decibelToVolume (int decibel)
 デシベルボリューム変換


Static Public Attributes

const int priorityDefault = 0
 デフォルト優先度

const int priorityMax = Limit::shortMax
 最高優先度

const int priorityMin = Limit::shortMin
 最低優先度


Protected Member Functions

 Sound ()
 コンストラクタ

virtual ~Sound ()
 デストラクタ

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

virtual bool update ()=0
 アップデート


Friends

class SoundManager
class SoundCache

Detailed Description

サウンド

状態の移り変わり。
play()
statePlay  そのまま再生
stateStop  先頭に戻って再生
stateSuspend 一時停止した場所から再生
stateLost  そのまま再生を試みる
stop()
statePlay  停止
stateStop  そのまま停止
stateSuspend 停止
stateLost  停止
suspend()
statePlay  一時停止
stateStop  そのまま停止
stateSuspend そのまま一時停止
stateLost  一時停止を試みる
resume()
statePlay  そのまま再生を試みる
stateStop  そのまま停止
stateSuspend 再生再開
stateLost  再生再開を試みる

Definition at line 64 of file Sound.h.


Member Enumeration Documentation

enum Lamp::Sound::Focus
 

フォーカス

Enumeration values:
focusNormal  通常フォーカス
focusSticky  スティっキーフォーカス
focusGlobal  グローバルフォーカス

Definition at line 99 of file Sound.h.

Referenced by Lamp::SoundBuffer::getFocus(), and toString().

enum Lamp::Sound::State
 

ステート

Enumeration values:
statePlay  再生中
stateSuspend  一時停止中
stateStop  停止中
stateLost  ロスト中

Definition at line 84 of file Sound.h.

Referenced by Lamp::SoundBuffer::resume(), Lamp::SoundBuffer::suspend(), and toString().


Member Function Documentation

virtual float Lamp::Sound::byteToTime u_int  byte  )  const [inline, virtual]
 

バイト数から時間への変換

Parameters:
byte バイト数
Returns:
秒単位の時間

Definition at line 214 of file Sound.h.

References Assert, getOneSecondBytes(), and getSize().

Referenced by getCurrentTime(), getLoopTime(), and getTimeLength().

virtual Sound3D* Lamp::Sound::castSound3D  )  const [inline, virtual]
 

3Dサウンドへのキャスト

Returns:
3Dサウンド。型が違えばNULLを返す。

Definition at line 524 of file Sound.h.

References isSound3D(), and NULL.

Referenced by Lamp::SoundCache::getSound3D(), Lamp::SoundCache::playSound3D(), and Lamp::SoundCache::SoundArray::toString().

virtual SoundBuffer* Lamp::Sound::castSoundBuffer  )  const [inline, virtual]
 

サウンドバッファへのキャスト

Returns:
サウンドバッファ。型が違えばNULLを返す。

Definition at line 492 of file Sound.h.

References isSoundBuffer(), and NULL.

virtual StaticSound* Lamp::Sound::castStaticSound  )  const [inline, virtual]
 

静的サウンドへのキャスト

Returns:
静的サウンド。型が違えばNULLを返す。

Definition at line 540 of file Sound.h.

References isStaticSound(), and NULL.

virtual StaticSound3D* Lamp::Sound::castStaticSound3D  )  const [inline, virtual]
 

静的3Dサウンドへのキャスト

Returns:
静的3Dサウンド。型が違えばNULLを返す。

Definition at line 572 of file Sound.h.

References isStaticSound3D(), and NULL.

virtual StereoSound* Lamp::Sound::castStereoSound  )  const [inline, virtual]
 

ステレオサウンドへのキャスト

Returns:
ステレオサウンド。型が違えばNULLを返す。

Definition at line 508 of file Sound.h.

References isStereoSound(), and NULL.

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

virtual StreamSound* Lamp::Sound::castStreamSound  )  const [inline, virtual]
 

ストリームサウンドへのキャスト

Returns:
ストリームサウンド。型が違えばNULLを返す。

Definition at line 556 of file Sound.h.

References isStreamSound(), and NULL.

virtual StreamSound3D* Lamp::Sound::castStreamSound3D  )  const [inline, virtual]
 

ストリーム3Dサウンドへのキャスト

Returns:
ストリーム3Dサウンド。型が違えばNULLを返す。

Definition at line 588 of file Sound.h.

References isStreamSound3D(), and NULL.

virtual Sound* Lamp::Sound::clone  )  [inline, virtual]
 

複製 ストリームは複製できない。

Returns:
複製されたサウンド。失敗したらNULLを返す

Reimplemented in Lamp::StaticSound3D, and Lamp::StaticSound.

Definition at line 458 of file Sound.h.

References NULL.

Referenced by Lamp::SoundCache::SoundArray::getFreeSound().

float Lamp::Sound::decibelToVolume int  decibel  )  [static]
 

デシベルボリューム変換

Parameters:
decibel デシベル
Returns:
ボリューム

Definition at line 136 of file Sound.cpp.

References Assert.

Referenced by Lamp::Sound3D::Sound3D(), Lamp::SoundBuffer::SoundBuffer(), and Lamp::StereoSound::StereoSound().

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

フェード

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

Implemented in Lamp::SoundBuffer.

Referenced by stopFade().

virtual void Lamp::Sound::fadeIn float  millisecond  )  [pure virtual]
 

フェードイン

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

Implemented in Lamp::SoundBuffer.

virtual void Lamp::Sound::fadeOut float  millisecond  )  [pure virtual]
 

フェードアウト

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

Implemented in Lamp::SoundBuffer.

virtual int Lamp::Sound::getBit  )  const [pure virtual]
 

ビット数の取得

Returns:
ビット数

Implemented in Lamp::SoundBuffer.

Referenced by getOneSampleBytes(), and toString().

virtual int Lamp::Sound::getChannel  )  const [pure virtual]
 

チャンネル数の取得

Returns:
チャンネル数

Implemented in Lamp::SoundBuffer.

Referenced by getOneSampleBytes(), and toString().

virtual const String& Lamp::Sound::getComment  )  const [pure virtual]
 

コメントの取得

Returns:
コメント

Implemented in Lamp::SoundBuffer.

Referenced by applyCommentOption(), and toString().

virtual float Lamp::Sound::getCurrentTime  )  const [inline, virtual]
 

現在の再生時間取得

Returns:
現在の再生時間の秒数

Definition at line 293 of file Sound.h.

References byteToTime(), and getCursor().

Referenced by toString().

virtual u_int Lamp::Sound::getCursor  )  const [pure virtual]
 

再生位置取得

Returns:
再生位置のバイト数

Implemented in Lamp::StreamSound3D, Lamp::StreamSound, and Lamp::SoundBuffer.

Referenced by getCurrentTime(), and Lamp::SoundCache::SoundArray::getFreeSound().

virtual Focus Lamp::Sound::getFocus  )  const [pure virtual]
 

フォーカスの取得

Returns:
フォーカス

Implemented in Lamp::SoundBuffer.

Referenced by toString().

virtual int Lamp::Sound::getFrequency  )  const [pure virtual]
 

周波数の取得

Returns:
周波数

Implemented in Lamp::SoundBuffer.

Referenced by toString().

virtual u_int Lamp::Sound::getLoopCursor  )  const [inline, virtual]
 

ループ位置の取得

Returns:
ループ位置のバイト数

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

Definition at line 343 of file Sound.h.

References u_int.

Referenced by getLoopTime().

virtual float Lamp::Sound::getLoopTime  )  const [inline, virtual]
 

ループ時間の取得

Returns:
ループ時間の秒数

Definition at line 358 of file Sound.h.

References byteToTime(), and getLoopCursor().

Referenced by toString().

virtual const String& Lamp::Sound::getName  )  const [pure virtual]
 

名前の取得

Returns:
名前

Implemented in Lamp::SoundBuffer.

Referenced by Lamp::SoundCache::SoundArray::toString(), and toString().

virtual u_int Lamp::Sound::getOneSampleBytes  )  const [inline, virtual]
 

1サンプルのバイト数取得

Returns:
1サンプルのバイト数

Definition at line 197 of file Sound.h.

References getBit(), getChannel(), and u_int.

Referenced by applyCommentOption(), getOneSecondBytes(), Lamp::StreamPlayer::setCursor(), and Lamp::StreamPlayer::setLoopCursor().

virtual u_int Lamp::Sound::getOneSecondBytes  )  const [inline, virtual]
 

1秒のバイト数取得

Returns:
1秒のバイト数

Definition at line 205 of file Sound.h.

References getOneSampleBytes(), getSample(), and u_int.

Referenced by byteToTime(), and timeToByte().

virtual int Lamp::Sound::getPriority  )  const [pure virtual]
 

優先度の取得

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

Implemented in Lamp::SoundBuffer.

Referenced by Lamp::SoundCache::SoundArray::toString(), and toString().

virtual int Lamp::Sound::getSample  )  const [pure virtual]
 

サンプル数の取得

Returns:
サンプル数

Implemented in Lamp::SoundBuffer.

Referenced by getOneSecondBytes(), and toString().

virtual u_int Lamp::Sound::getSize  )  const [pure virtual]
 

サイズの取得

Returns:
サイズ

Implemented in Lamp::StreamSound3D, Lamp::StreamSound, and Lamp::SoundBuffer.

Referenced by byteToTime(), getTimeLength(), and toString().

virtual float Lamp::Sound::getTimeLength  )  const [inline, virtual]
 

時間の長さの取得

Returns:
秒単位の時間の長さ

Definition at line 167 of file Sound.h.

References byteToTime(), and getSize().

Referenced by timeToByte(), and toString().

virtual float Lamp::Sound::getVolume  )  const [pure virtual]
 

ボリュームの取得

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

Implemented in Lamp::SoundBuffer.

Referenced by toString().

virtual bool Lamp::Sound::hasOwnership  )  const [pure virtual]
 

所有権の取得

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

Implemented in Lamp::SoundBuffer.

Referenced by Lamp::SoundCache::SoundArray::getFreeSound(), Lamp::SoundCache::getSound(), and Lamp::SoundCache::releaseSound().

virtual bool Lamp::Sound::isFading  )  const [pure virtual]
 

フェード中かどうか

Returns:
フェード中ならtrue

Implemented in Lamp::SoundBuffer.

virtual bool Lamp::Sound::isLoop  )  const [pure virtual]
 

ループしているか

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

Implemented in Lamp::SoundBuffer.

Referenced by Lamp::SoundCache::SoundArray::toString(), and toString().

virtual bool Lamp::Sound::isSound3D  )  const [inline, virtual]
 

3Dサウンドかどうか

Returns:
3Dサウンドならtrue

Reimplemented in Lamp::Sound3D.

Definition at line 518 of file Sound.h.

Referenced by castSound3D().

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

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

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

Reimplemented in Lamp::SoundBuffer.

Definition at line 486 of file Sound.h.

Referenced by castSoundBuffer().

virtual bool Lamp::Sound::isStaticSound  )  const [inline, virtual]
 

静的サウンドかどうか

Returns:
静的サウンドならtrue

Reimplemented in Lamp::StaticSound.

Definition at line 534 of file Sound.h.

Referenced by castStaticSound().

virtual bool Lamp::Sound::isStaticSound3D  )  const [inline, virtual]
 

静的3Dサウンドかどうか

Returns:
静的3Dサウンドならtrue

Reimplemented in Lamp::StaticSound3D.

Definition at line 566 of file Sound.h.

Referenced by castStaticSound3D().

virtual bool Lamp::Sound::isStereoSound  )  const [inline, virtual]
 

ステレオサウンドかどうか

Returns:
ステレオサウンドならtrue

Reimplemented in Lamp::StereoSound.

Definition at line 502 of file Sound.h.

Referenced by castStereoSound(), and Lamp::SoundCache::SoundArray::toString().

virtual bool Lamp::Sound::isStreamSound  )  const [inline, virtual]
 

ストリームサウンドかどうか

Returns:
ストリームサウンドならtrue

Reimplemented in Lamp::StreamSound.

Definition at line 550 of file Sound.h.

Referenced by castStreamSound().

virtual bool Lamp::Sound::isStreamSound3D  )  const [inline, virtual]
 

ストリーム3Dサウンドかどうか

Returns:
ストリーム3Dサウンドならtrue

Reimplemented in Lamp::StreamSound3D.

Definition at line 582 of file Sound.h.

Referenced by castStreamSound3D().

virtual bool Lamp::Sound::play  )  [pure virtual]
 

再生

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

Implemented in Lamp::Sound3D, Lamp::StreamSound3D, Lamp::StreamSound, and Lamp::SoundBuffer.

Referenced by Lamp::SoundCache::playSound().

void Lamp::Sound::reset Reset  flags  )  [virtual]
 

リセット

Parameters:
flags リセットフラグ

Reimplemented in Lamp::Sound3D, and Lamp::StereoSound.

Definition at line 43 of file Sound.cpp.

References priorityDefault, setLoop(), setLoopCursor(), setName(), setOriginalFrequency(), setPriority(), setVolume(), stop(), and stopFade().

Referenced by Lamp::SoundCache::getSound(), and Lamp::SoundCache::playSound().

virtual bool Lamp::Sound::resume  )  [pure virtual]
 

再生再開

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

Implemented in Lamp::SoundBuffer.

Referenced by Lamp::SoundCache::resumeAll().

virtual void Lamp::Sound::setComment const String comment  )  [pure virtual]
 

コメントの設定

Parameters:
comment コメント

Implemented in Lamp::SoundBuffer.

virtual void Lamp::Sound::setCurrentTime float  timeCursor  )  [inline, virtual]
 

再生時間設定

Parameters:
timeCursor 再生時間の秒数

Definition at line 285 of file Sound.h.

References setCursor(), and timeToByte().

virtual void Lamp::Sound::setCursor u_int  cursor  )  [pure virtual]
 

再生位置設定

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

Implemented in Lamp::StreamSound3D, Lamp::StreamSound, and Lamp::SoundBuffer.

Referenced by setCurrentTime().

virtual void Lamp::Sound::setFrequency int  frequency  )  [pure virtual]
 

周波数の設定

Parameters:
frequency 周波数

Implemented in Lamp::SoundBuffer.

Referenced by Lamp::SoundCache::playSound().

virtual void Lamp::Sound::setLoop bool  loop  )  [pure virtual]
 

ループの設定

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

Parameters:
loop ループするならtrue

Implemented in Lamp::SoundBuffer.

Referenced by applyCommentOption(), and reset().

virtual void Lamp::Sound::setLoopCursor u_int  loopCursor  )  [inline, virtual]
 

ループ位置の設定

Parameters:
loopCursor ループ位置をバイト数で指定

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

Definition at line 334 of file Sound.h.

References Assert.

Referenced by applyCommentOption(), reset(), and setLoopTime().

virtual void Lamp::Sound::setLoopTime float  loopTimeCursor  )  [inline, virtual]
 

ループ時間の設定

Parameters:
loopTimeCursor ループ時間を秒数で指定

Definition at line 350 of file Sound.h.

References setLoopCursor(), and timeToByte().

Referenced by applyCommentOption().

virtual void Lamp::Sound::setName const String name  )  [pure virtual]
 

名前の設定

Parameters:
name 名前

Implemented in Lamp::SoundBuffer.

Referenced by reset().

virtual void Lamp::Sound::setOwnership bool  ownership  )  [protected, pure virtual]
 

所有権の設定

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

Implemented in Lamp::SoundBuffer.

Referenced by Lamp::SoundCache::getSound(), and Lamp::SoundCache::releaseSound().

virtual void Lamp::Sound::setPriority int  priority  )  [pure virtual]
 

優先度の設定

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

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

Implemented in Lamp::SoundBuffer.

Referenced by reset().

virtual void Lamp::Sound::setVolume float  volume  )  [pure virtual]
 

ボリュームの設定

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

Implemented in Lamp::SoundBuffer.

Referenced by Lamp::SoundCache::playSound(), and reset().

virtual u_int Lamp::Sound::timeToByte float  time  )  const [inline, virtual]
 

時間からバイト数への変換

Returns:
time 秒単位の時間

バイト数

Definition at line 224 of file Sound.h.

References Assert, getOneSecondBytes(), getTimeLength(), and u_int.

Referenced by setCurrentTime(), and setLoopTime().

String Lamp::Sound::toString  )  const [virtual]
 

文字列への変換

Returns:
文字列

Reimplemented in Lamp::Sound3D, and Lamp::StereoSound.

Definition at line 78 of file Sound.cpp.

References Focus, focusGlobal, focusNormal, focusSticky, Lamp::String::format(), getBit(), getChannel(), getComment(), getCurrentTime(), getFocus(), getFrequency(), getLoopTime(), getName(), getPriority(), getSample(), getSize(), getState(), getTimeLength(), getVolume(), Lamp::String::isEmpty(), isLoop(), State, stateLost, statePlay, stateStop, and stateSuspend.

virtual bool Lamp::Sound::update  )  [protected, pure virtual]
 

アップデート

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

Implemented in Lamp::SoundBuffer.

virtual bool Lamp::Sound::useStream  )  const [inline, virtual]
 

ストリームを使用しているか

Returns:
ストリームを使用しているtrue

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

Definition at line 479 of file Sound.h.

int Lamp::Sound::volumeToDecibel float  volume  )  [static]
 

ボリュームデシベル変換

Parameters:
volume ボリューム
Returns:
デシベル

Definition at line 121 of file Sound.cpp.

References Assert.

Referenced by Lamp::Sound3D::setConeOutsideVolume(), Lamp::StereoSound::setPan(), and Lamp::SoundBuffer::setVolume().


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