C# 클래스 Project290.Audio.AudioManager

Manages playing of sounds and music.
상속: Microsoft.Xna.Framework.GameComponent
파일 보기 프로젝트 열기: scastle/Solitude 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
PauseMusicVolumeBackup float

공개 메소드들

메소드 설명
AudioManager ( Microsoft.Xna.Framework.Game game ) : System

Creates a new Audio Manager.

FadeSong ( float targetVolume, System.TimeSpan duration ) : void

Smoothly transition between two volumes.

LoadSong ( string songName ) : void

Load a Song

LoadSong ( string songName, string songPath ) : void

Loads a Song

LoadSound ( string soundName, string soundPath ) : void

Loads a SoundEffect

PauseSong ( ) : void

Pauses the currently playing song. This is a no-op if the song is already paused, or if no song is currently playing.

PlaySound ( string soundType ) : void

Plays the sound of the given name

PlaySound ( string soundType, float volume ) : void

Plays the sound of the given name at the given volume

PlaySound ( string soundName, float volume, float pitch, float pan ) : void

Plays the sound of the given name with parameters

ResumeSong ( ) : void

Resumes the currently paused song. This is a no-op if the song is not paused, or if no song is currently playing.

SongPlay ( string songName ) : void

Starts playing the song with the given name. If it is already playing, this method does nothing. If another song is currently playing, it is stopped first.

SongPlay ( string songName, bool loop ) : void

Starts playing the song with the given name. If it is already playing, this method does nothing. If another song is currently playing, it is stopped first.

StopAllSounds ( ) : void

Stops all currently playing sounds.

StopSong ( ) : void

Stops the currently playing song. This is a no-op if no song is currently playing.

Update ( GameTime gameTime ) : void

Called per loop unless Enabled is set to false.

보호된 메소드들

메소드 설명
OnEnabledChanged ( object sender, EventArgs args ) : void

비공개 메소드들

메소드 설명
GetAvailableSoundIndex ( ) : int

메소드 상세

AudioManager() 공개 메소드

Creates a new Audio Manager.
public AudioManager ( Microsoft.Xna.Framework.Game game ) : System
game Microsoft.Xna.Framework.Game The Game
리턴 System

FadeSong() 공개 메소드

Smoothly transition between two volumes.
public FadeSong ( float targetVolume, System.TimeSpan duration ) : void
targetVolume float Target volume, 0.0f to 1.0f
duration System.TimeSpan Length of volume transition
리턴 void

LoadSong() 공개 메소드

Load a Song
public LoadSong ( string songName ) : void
songName string Name of the song to load
리턴 void

LoadSong() 공개 메소드

Loads a Song
public LoadSong ( string songName, string songPath ) : void
songName string Name of the song
songPath string Path to the song
리턴 void

LoadSound() 공개 메소드

Loads a SoundEffect
public LoadSound ( string soundName, string soundPath ) : void
soundName string Name of the sound to load
soundPath string Path to the song asset file
리턴 void

OnEnabledChanged() 보호된 메소드

protected OnEnabledChanged ( object sender, EventArgs args ) : void
sender object
args System.EventArgs
리턴 void

PauseSong() 공개 메소드

Pauses the currently playing song. This is a no-op if the song is already paused, or if no song is currently playing.
public PauseSong ( ) : void
리턴 void

PlaySound() 공개 메소드

Plays the sound of the given name
public PlaySound ( string soundType ) : void
soundType string
리턴 void

PlaySound() 공개 메소드

Plays the sound of the given name at the given volume
public PlaySound ( string soundType, float volume ) : void
soundType string
volume float Volume, 0.0f to 1.0f
리턴 void

PlaySound() 공개 메소드

Plays the sound of the given name with parameters
public PlaySound ( string soundName, float volume, float pitch, float pan ) : void
soundName string Name of the sound
volume float Volume, 0.0f to 1.0f
pitch float Pitch, -1.0f (down one octave) to 1.0f (up one octave)
pan float Pan, -1.0f (full left) to 1.0f (full right)
리턴 void

ResumeSong() 공개 메소드

Resumes the currently paused song. This is a no-op if the song is not paused, or if no song is currently playing.
public ResumeSong ( ) : void
리턴 void

SongPlay() 공개 메소드

Starts playing the song with the given name. If it is already playing, this method does nothing. If another song is currently playing, it is stopped first.
public SongPlay ( string songName ) : void
songName string Name of the song to play
리턴 void

SongPlay() 공개 메소드

Starts playing the song with the given name. If it is already playing, this method does nothing. If another song is currently playing, it is stopped first.
public SongPlay ( string songName, bool loop ) : void
songName string Name of the song to play
loop bool True if song should loop, false otherwise
리턴 void

StopAllSounds() 공개 메소드

Stops all currently playing sounds.
public StopAllSounds ( ) : void
리턴 void

StopSong() 공개 메소드

Stops the currently playing song. This is a no-op if no song is currently playing.
public StopSong ( ) : void
리턴 void

Update() 공개 메소드

Called per loop unless Enabled is set to false.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Time elapsed since last frame
리턴 void

프로퍼티 상세

PauseMusicVolumeBackup 공개적으로 프로퍼티

public float PauseMusicVolumeBackup
리턴 float