private void btStop_Click(object sender, EventArgs e) { BassAudio.Stop(); timer1.Enabled = false; timeSlider.Value = 0; currentTimeLabel.Text = "00:00:00"; lengthTimeLabel.Text = "00:00:00"; }
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; }
private void btPause_Click(object sender, EventArgs e) => BassAudio.Pause();
private void slVolume_Scroll(object sender, ScrollEventArgs e) => BassAudio.SetVolumeToStream(BassAudio.Stream, volumeSlider.Value);
private void slTime_Scroll(object sender, ScrollEventArgs e) => BassAudio.SetPositionOfScroll(BassAudio.Stream, timeSlider.Value);