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