private void timer1_Tick(object sender, EventArgs e) { currentTimeLabel.Text = TimeSpan.FromSeconds(BassAudio.GetPositionOfStream(BassAudio.Stream)).ToString(); timeSlider.Value = BassAudio.GetPositionOfStream(BassAudio.Stream); if (currentTimeLabel.Text == lengthTimeLabel.Text) { btNext_Click(sender, e); } }
private void btPlay_Click(object sender, EventArgs e) { if (playlistListBox.Items.Count == 0 || playlistListBox.SelectedIndex == -1) { return; } current = Variables.Files[playlistListBox.SelectedIndex]; BassAudio.Play(current, BassAudio.Volume); currentTimeLabel.Text = TimeSpan.FromSeconds(BassAudio.GetPositionOfStream(BassAudio.Stream)).ToString(); lengthTimeLabel.Text = TimeSpan.FromSeconds(BassAudio.GetTimeOfStream(BassAudio.Stream)).ToString(); timeSlider.Maximum = BassAudio.GetTimeOfStream(BassAudio.Stream); timeSlider.Value = BassAudio.GetPositionOfStream(BassAudio.Stream); BassAudio.SetVolumeToStream(BassAudio.Stream, volumeSlider.Value); timer1.Enabled = true; }