Exemple #1
0
 public void Play(string name, bool looping)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     try
     {
         byte[]     data  = Core.Archives[Core.Archives.Find(name)].Read();
         MusicTrack track = new MusicTrack(data);
         Stop();
         this.track   = track;
         this.looping = looping;
         position     = 0;
         duration     = 0;
     }
     catch (LumpNotFoundException)
     {
         Core.Console.LogError("The music track '{0}' could not be found.", name);
     }
     catch (ApplicationException)
     {
         Core.Console.LogError("An error occurred while trying to play the music track '{0}'.", name);
     }
 }
Exemple #2
0
 public void Play(string name,bool looping)
 {
     if (name == null)
         throw new ArgumentNullException("name");
     try
     {
         byte[] data = Core.Archives[Core.Archives.Find(name)].Read();
         MusicTrack track = new MusicTrack(data);
         Stop();
         this.track = track;
         this.looping = looping;
         position = 0;
         duration = 0;
     }
     catch (LumpNotFoundException)
     {
         Core.Console.LogError("The music track '{0}' could not be found.",name);
     }
     catch (ApplicationException)
     {
         Core.Console.LogError("An error occurred while trying to play the music track '{0}'.",name);
     }
 }
Exemple #3
0
 public void Stop()
 {
     track = null;
     system.Reset();
 }
Exemple #4
0
 public MusicPlayer()
 {
     this.system = new NullMusicSystem();
     this.track  = null;
 }
Exemple #5
0
 public void Stop()
 {
     track = null;
     system.Reset();
 }
Exemple #6
0
 public MusicPlayer()
 {
     this.system = new NullMusicSystem();
     this.track = null;
 }