/** <summary> Stops the song. </summary> */ public void Stop() { if (soundInstance != null) { soundInstance.Stop(); soundInstance = null; } }
/** <summary> Constructs the default song. </summary> */ public Song(SoundEffect song, string filePath, string name, float volume = 1.0f, float pitch = 0.0f, float pan = 0.0f) { // Containment this.soundEffect = song; this.soundInstance = null; this.name = name; this.filePath = filePath; // Settings this.volume = volume; this.pitch = pitch; this.pan = pan; }
//========= CONSTRUCTORS ========= #region Constructors /** <summary> Constructs the default song. </summary> */ public Song(SoundEffect song, string filePath, string name, float volume = 1.0f, float pitch = 0.0f, float pan = 0.0f) { // Containment this.soundEffect = song; this.soundInstance = null; this.name = name; this.filePath = filePath; // Settings this.volume = volume; this.pitch = pitch; this.pan = pan; }
/** <summary> Stops the song. </summary> */ public void Stop() { if (soundInstance != null) { soundInstance.Stop(); soundInstance = null; } }
/** <summary> Plays the song. </summary> */ public SongInstance Play(bool looped, float volume, float pitch = 0.0f, float pan = 0.0f) { soundInstance = new SongInstance(soundEffect.CreateInstance(), this, looped, volume, pitch, pan); soundInstance.Play(); return soundInstance; }
/** <summary> Plays the song. </summary> */ public SongInstance Play(bool looped = false) { soundInstance = new SongInstance(soundEffect.CreateInstance(), this, looped); soundInstance.Play(); return soundInstance; }
/** <summary> Plays the song. </summary> */ public SongInstance Play(bool looped, float volume, float pitch = 0.0f, float pan = 0.0f) { soundInstance = new SongInstance(soundEffect.CreateInstance(), this, looped, volume, pitch, pan); soundInstance.Play(); return(soundInstance); }
/** <summary> Plays the song. </summary> */ public SongInstance Play(bool looped = false) { soundInstance = new SongInstance(soundEffect.CreateInstance(), this, looped); soundInstance.Play(); return(soundInstance); }