public void Interrupt(Songs p_song) { this.audio.Stop(); this.audio = new Audio(Utility.FindMediaFile(@"\Music\" + p_song.ToString() + ".mp3")); this.audio.Volume = -500; this.interupted = true; }
public void PlayMusic(Songs song, bool loop) { if (this.enableMusic) { if (this.currentSong != null) { if (song == this.currentSong.Song) { return; } this.currentSong.Stop(); this.currentSong.Dispose(); } if (song == Songs.None) { this.currentSong = null; } else if (loop) { double num = 0.0; double num2 = 0.0; string[] strArray = ReadTextFileLine("Info.musicinfo.txt", song.ToString(), true).Split(new char[] { ',' }); NumberFormatInfo provider = new NumberFormatInfo { NumberDecimalSeparator = "." }; num = double.Parse(strArray[1], provider); num2 = double.Parse(strArray[0], provider); this.currentSong = new Music(song, num2, num); } else { this.currentSong = new Music(song, 0.0, 0.0); } } }