public MusicUtility(Music p_song) { this.song = p_song; this.InitializeComponent(); this.txtLoop.Text = this.song.LoopPosition.ToString(); this.txtEnd.Text = this.song.EndPosition.ToString(); }
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); } } }