private void timer1_Tick(object sender, EventArgs e) { label1.Text = TimeSpan.FromSeconds(Bass1.GetPosOfStream(Bass1.Stream)).ToString(); slTime.Value = Bass1.GetPosOfStream(Bass1.Stream); if (temp == 1 && rand_temp == 0) { if (Bass1.PlauAgainTrack()) { playlist.SelectedIndex = main.CurrentTrackNumber; label1.Text = TimeSpan.FromSeconds(Bass1.GetPosOfStream(Bass1.Stream)).ToString(); label2.Text = TimeSpan.FromSeconds(Bass1.GetTimeOfStream(Bass1.Stream)).ToString(); slTime.Maximum = Bass1.GetTimeOfStream(Bass1.Stream); slTime.Value = Bass1.GetPosOfStream(Bass1.Stream); } } else { if (temp == 0 && rand_temp == 1) { if (Bass1.PlauRandomTrack()) { playlist.SelectedIndex = main.CurrentTrackNumber; label1.Text = TimeSpan.FromSeconds(Bass1.GetPosOfStream(Bass1.Stream)).ToString(); label2.Text = TimeSpan.FromSeconds(Bass1.GetTimeOfStream(Bass1.Stream)).ToString(); slTime.Maximum = Bass1.GetTimeOfStream(Bass1.Stream); slTime.Value = Bass1.GetPosOfStream(Bass1.Stream); } } else { if (Bass1.ToNextTrack()) { playlist.SelectedIndex = main.CurrentTrackNumber; label1.Text = TimeSpan.FromSeconds(Bass1.GetPosOfStream(Bass1.Stream)).ToString(); label2.Text = TimeSpan.FromSeconds(Bass1.GetTimeOfStream(Bass1.Stream)).ToString(); slTime.Maximum = Bass1.GetTimeOfStream(Bass1.Stream); slTime.Value = Bass1.GetPosOfStream(Bass1.Stream); } if (Bass1.EndPlaylist) { btmSTOP_Click(this, new EventArgs()); playlist.SelectedIndex = main.CurrentTrackNumber = 0; Bass1.EndPlaylist = false; } } } string current = main.Files[playlist.SelectedIndex]; TagModel TM = new TagModel(current); Artist.Text = TM.Artist; Name_file.Text = TM.Title; }
private void btmPLAY_Click(object sender, EventArgs e) { if ((playlist.Items.Count != 0) && (playlist.SelectedIndex != -1)) { string current = main.Files[playlist.SelectedIndex]; main.CurrentTrackNumber = playlist.SelectedIndex; Bass1.Play(current, Bass1.Volume); label1.Text = TimeSpan.FromSeconds(Bass1.GetPosOfStream(Bass1.Stream)).ToString(); label2.Text = TimeSpan.FromSeconds(Bass1.GetTimeOfStream(Bass1.Stream)).ToString(); slTime.Maximum = Bass1.GetTimeOfStream(Bass1.Stream); slTime.Value = Bass1.GetPosOfStream(Bass1.Stream); timer1.Enabled = true; TagModel TM = new TagModel(current); Artist.Text = TM.Artist; Name_file.Text = TM.Title; } }
private void Prev_Click(object sender, EventArgs e) { if (Bass1.ToPreviosTrackClick()) { playlist.SelectedIndex = main.CurrentTrackNumber; label1.Text = TimeSpan.FromSeconds(Bass1.GetPosOfStream(Bass1.Stream)).ToString(); label2.Text = TimeSpan.FromSeconds(Bass1.GetTimeOfStream(Bass1.Stream)).ToString(); slTime.Maximum = Bass1.GetTimeOfStream(Bass1.Stream); slTime.Value = Bass1.GetPosOfStream(Bass1.Stream); } if (Bass1.StartPlaylist) { btmSTOP_Click(this, new EventArgs()); playlist.SelectedIndex = main.CurrentTrackNumber = 0; Bass1.StartPlaylist = false; } string current = main.Files[playlist.SelectedIndex]; TagModel TM = new TagModel(current); Artist.Text = TM.Artist; Name_file.Text = TM.Title; }