예제 #1
0
 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);
     }
 }
예제 #2
0
 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;
 }