Example #1
0
 /** <summary> Stops the song. </summary> */
 public void Stop()
 {
     if (soundInstance != null)
     {
         soundInstance.Stop();
         soundInstance = null;
     }
 }
Example #2
0
        /** <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;
        }
Example #3
0
        //========= 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;
        }
Example #4
0
 /** <summary> Stops the song. </summary> */
 public void Stop()
 {
     if (soundInstance != null) {
     soundInstance.Stop();
     soundInstance = null;
     }
 }
Example #5
0
 /** <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;
 }
Example #6
0
 /** <summary> Plays the song. </summary> */
 public SongInstance Play(bool looped = false)
 {
     soundInstance = new SongInstance(soundEffect.CreateInstance(), this, looped);
     soundInstance.Play();
     return soundInstance;
 }
Example #7
0
 /** <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);
 }
Example #8
0
 /** <summary> Plays the song. </summary> */
 public SongInstance Play(bool looped = false)
 {
     soundInstance = new SongInstance(soundEffect.CreateInstance(), this, looped);
     soundInstance.Play();
     return(soundInstance);
 }