Exemplo n.º 1
0
 private void btnPlay_Click(object sender, EventArgs e)
 {
     if ((playlist.Items.Count != 0) && (playlist.SelectedIndex != -1))
     {
         if (!Vars.play)
         {
             string current = Vars.Files[playlist.SelectedIndex];
             Vars.CurrentTrackNumber = playlist.SelectedIndex;
             BassLike.Play(current, BassLike.Volume);
             label1.Text = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
             label2.Text = TimeSpan.FromSeconds(BassLike.GetTimeOfStream(BassLike.Stream)).ToString("mm':'ss");
             if ((Vars.startedNew))
             {
                 TagModel TM = new TagModel(current);
                 label3.Text = (TM.Artist + " - " + TM.Title + "   ");
             }
             Vars.startedNew         = false;
             slTime.Maximum          = BassLike.GetTimeOfStream(BassLike.Stream);
             slTime.Value            = BassLike.GetPosOfStream(BassLike.Stream);
             timer1.Enabled          = true;
             btnPlay.BackgroundImage = Properties.Resources.player_pause_5536;
             Vars.play = true;
         }
         else
         {
             BassLike.Pause();
             Vars.play = false;
             btnPlay.BackgroundImage = Properties.Resources.player_play_1976;
         }
     }
 }
 //пауза
 private void btnPause_Click(object sender, EventArgs e)
 {
     BassLike.Pause();
 }