//остановка воспроизведения
 private void button2_Click(object sender, EventArgs e)
 {
     BassLike.Stop();
     timer1.Enabled = false;
     slTime.Value   = 0;
     label1.Text    = "00:00:00";
 }
Exemple #2
0
 private void btnStop_Click(object sender, EventArgs e)
 {
     BassLike.Stop();
     timer1.Enabled          = false;
     Vars.play               = false;
     btnPlay.BackgroundImage = Properties.Resources.player_play_1976;
     slTime.Value            = 0;
     label1.Text             = "00:00";
     label3.Text             = "";
     Vars.mixed              = false;
 }
Exemple #3
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            if (Vars.mixed)
            {
                BassLike.Stop();
                playlist.SelectedIndex = Vars.CurrentTrackNumber = 0;
                BassLike.Play(Vars.Files[0], BassLike.Volume);
                btnPlay.BackgroundImage = Properties.Resources.player_pause_5536;
                Vars.play      = true;
                timer1.Enabled = true;
                label1.Text    = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
                label2.Text    = TimeSpan.FromSeconds(BassLike.GetTimeOfStream(BassLike.Stream)).ToString("mm':'ss");
                TagModel TM = new TagModel(Vars.Files[Vars.CurrentTrackNumber]);
                label3.Text = (TM.Artist + " - " + TM.Title + "   ");
                Vars.mixed  = false;
            }
            else
            {
                BassLike.Stop();
                btnPlay.BackgroundImage = Properties.Resources.player_pause_5536;
                Vars.play      = true;
                timer1.Enabled = true;
                if (BassLike.ToNextTrack())
                {
                    playlist.SelectedIndex = Vars.CurrentTrackNumber;
                    label1.Text            = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
                    label2.Text            = TimeSpan.FromSeconds(BassLike.GetTimeOfStream(BassLike.Stream)).ToString("mm':'ss");
                    TagModel TM = new TagModel(Vars.Files[Vars.CurrentTrackNumber]);
                    label3.Text    = (TM.Artist + " - " + TM.Title + "   ");
                    slTime.Maximum = BassLike.GetTimeOfStream(BassLike.Stream);
                    slTime.Value   = BassLike.GetPosOfStream(BassLike.Stream);
                }

                if (BassLike.EndPlayList)
                {
                    btnStop_Click(this, new EventArgs());
                    if (playlist.Items.Count != 0)
                    {
                        playlist.SelectedIndex = Vars.CurrentTrackNumber = 0;
                    }
                    BassLike.EndPlayList = false;
                    label2.Text          = "00:00";
                    label3.Text          = "";
                }
            }
            Vars.startedNew = false;
        }
Exemple #4
0
 private void btnPrev_Click(object sender, EventArgs e)
 {
     if ((Vars.CurrentTrackNumber > 0) && (!Vars.mixed) && (playlist.Items.Count > 0))
     {
         BassLike.Stop();
         btnPlay.BackgroundImage = Properties.Resources.player_pause_5536;
         Vars.play      = true;
         timer1.Enabled = true;
         BassLike.ToPrevTrack();
         playlist.SelectedIndex = Vars.CurrentTrackNumber;
         label1.Text            = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
         label2.Text            = TimeSpan.FromSeconds(BassLike.GetTimeOfStream(BassLike.Stream)).ToString("mm':'ss");
         TagModel TM = new TagModel(Vars.Files[Vars.CurrentTrackNumber]);
         label3.Text     = (TM.Artist + " - " + TM.Title + "   ");
         slTime.Maximum  = BassLike.GetTimeOfStream(BassLike.Stream);
         slTime.Value    = BassLike.GetPosOfStream(BassLike.Stream);
         Vars.startedNew = false;
     }
 }
Exemple #5
0
 private void playlist_DoubleClick(object sender, EventArgs e)
 {
     if (playlist.Items.Count > 0)
     {
         BassLike.Stop();
         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");
         TagModel TM = new TagModel(current);
         label3.Text             = (TM.Artist + " - " + TM.Title + "   ");
         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;
         Vars.mixed = false;
     }
 }