示例#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);
     }
 }
示例#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);
     }
 }
示例#3
0
 public void Stop()
 {
     track = null;
     system.Reset();
 }
示例#4
0
 public MusicPlayer()
 {
     this.system = new NullMusicSystem();
     this.track  = null;
 }
示例#5
0
 public void Stop()
 {
     track = null;
     system.Reset();
 }
示例#6
0
 public MusicPlayer()
 {
     this.system = new NullMusicSystem();
     this.track = null;
 }