mokit.media
クラス SoundPlayer

java.lang.Object
  拡張mokit.media.SoundPlayer
すべての実装インタフェース:
com.nttdocomo.util.EventListener, com.nttdocomo.ui.MediaListener

public class SoundPlayer
extends java.lang.Object
implements com.nttdocomo.ui.MediaListener

サウンドデータを再生するための機能を提供します。

作成者:
Takuto Nishioka

フィールドの概要
static int BGM
          BGMサウンド
static int SE
          SEサウンド
 
メソッドの概要
static SoundPlayer getInstance()
          サウンドプレイヤーを取得します。
 void mediaAction(com.nttdocomo.ui.MediaPresenter source, int type, int param)
          サウンド関連イベントが発生した際に実行されます。
 void pause(int type)
          一時停止します。
 void play(int type)
          再生します。
 void restart(int type)
          一時停止から再開します。
 void setBGM(SoundData sound)
          BGMサウンドをセットします。
 void setSE(SoundData sound)
          SEサウンドをセットします。
 void stop(int type)
          停止します。
 
クラス java.lang.Object から継承したメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

BGM

public static final int BGM
BGMサウンド

関連項目:
定数フィールド値

SE

public static final int SE
SEサウンド

関連項目:
定数フィールド値
メソッドの詳細

getInstance

public static SoundPlayer getInstance()
サウンドプレイヤーを取得します。

戻り値:
サウンドプレイヤーインスタンスを返します。

setBGM

public void setBGM(SoundData sound)
            throws MktMediaException
BGMサウンドをセットします。

パラメータ:
sound - サウンドデータ
例外:
MktMediaException - サウンドデータが初期化されていない場合などに発生します。

setSE

public void setSE(SoundData sound)
           throws MktMediaException
SEサウンドをセットします。

パラメータ:
sound - サウンドデータ
例外:
MktMediaException - サウンドデータが初期化されていない場合などに発生します。

play

public void play(int type)
再生します。


pause

public void pause(int type)
一時停止します。


restart

public void restart(int type)
一時停止から再開します。


stop

public void stop(int type)
停止します。


mediaAction

public void mediaAction(com.nttdocomo.ui.MediaPresenter source,
                        int type,
                        int param)
サウンド関連イベントが発生した際に実行されます。

定義:
インタフェース com.nttdocomo.ui.MediaListener 内の mediaAction
パラメータ:
source - 通知の発生元であるメディアプレゼンタ
type - イベントの種類
param - イベントのパラメータ