Ejemplo n.º 1
0
        private void NextTrack()
        {
            slTime.Value = 0;
            if (BassLike.NextTrack())
            {
                slTime.Maximum = BassLike.GetTimeOfStream(BassLike.Stream);
                PlayList.Items[Vars.CurrentTrackNumber].Selected = true;
                labTime.Text      = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
                labTimeLen.Text   = TimeSpan.FromSeconds(BassLike.GetTimeOfStream(BassLike.Stream)).ToString("mm':'ss");
                labTrackInfo.Text = PlayList.Items[Vars.CurrentTrackNumber].Text
                                    + "\n" + PlayList.Items[Vars.CurrentTrackNumber].SubItems[1].Text;
                btnPause.BringToFront();
            }

            if (PlayList.Items.Count != 0)
            {
                if (BassLike.EndPlayList)
                {
                    btnStop_Click(this, new EventArgs());
                    Vars.CurrentTrackNumber    = 0;
                    PlayList.Items[0].Selected = true;
                    BassLike.EndPlayList       = false;
                    btnPlay.BringToFront();
                    if (btnRepeat.ImageIndex == 1)
                    {
                        btnPlay_Click(this, null);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            labTime.Text = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
            slTime.Value = BassLike.GetPosOfStream(BassLike.Stream);

            if (BassLike.ToNextTrack())
            {
                PlayList.Items[Vars.CurrentTrackNumber].Selected = true;

                labTime.Text    = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
                labTimeLen.Text = TimeSpan.FromSeconds(BassLike.GetTimeOfStream(BassLike.Stream)).ToString("mm':'ss");
                slTime.Maximum  = BassLike.GetTimeOfStream(BassLike.Stream);
                slTime.Value    = BassLike.GetPosOfStream(BassLike.Stream);
            }
            if (BassLike.EndPlayList)
            {
                Vars.CurrentTrackNumber    = 0;
                PlayList.Items[0].Selected = true;
                if (btnRepeat.ImageIndex == 1)
                {
                    btnPlay_Click(this, null);
                }
                else
                {
                    btnStop_Click(this, new EventArgs());
                    btnPlay.BringToFront();
                }
                BassLike.EndPlayList = false;
            }
        }
Ejemplo n.º 3
0
 private void PreviousTrack()
 {
     if (PlayList.Items.Count != 0)
     {
         slTime.Value = 0;
         BassLike.PreviousTrack();
         PlayList.Items[Vars.CurrentTrackNumber].Selected = true;
         btnPause.BringToFront();
         labTime.Text      = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
         labTimeLen.Text   = TimeSpan.FromSeconds(BassLike.GetTimeOfStream(BassLike.Stream)).ToString("mm':'ss");
         slTime.Maximum    = BassLike.GetTimeOfStream(BassLike.Stream);
         labTrackInfo.Text = PlayList.Items[Vars.CurrentTrackNumber].Text +
                             "\n" + PlayList.Items[Vars.CurrentTrackNumber].SubItems[1].Text;
     }
 }
Ejemplo n.º 4
0
 private void timer2_Tick(object sender, EventArgs e)
 {
     try
     {
         slTime.Value += TimeShah;
         BassLike.SetPosOfScroll(BassLike.Stream, slTime.Value);
         labTime.Text = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
     }
     catch (ArgumentOutOfRangeException)
     {
         timer2.Enabled = false;
         if (slTime.Value >= slTime.Maximum)
         {
             NextTrack();
             return;
         }
         if (slTime.Value <= slTime.Minimum)
         {
             btnStop_Click(this, null);
         }
     }
 }
Ejemplo n.º 5
0
 private void btnPlay_Click(object sender, EventArgs e)
 {
     if ((PlayList.Items.Count != 0) && (PlayList.SelectedItems.Count == 1))
     {
         string current = Vars.Files[PlayList.Items.IndexOf(PlayList.SelectedItems[0])];
         Vars.CurrentTrackNumber = PlayList.Items.IndexOf(PlayList.SelectedItems[0]);
         if (BassLike.Play(current, BassLike.Volume))
         {
             labTrackInfo.Text = PlayList.Items[Vars.CurrentTrackNumber].Text
                                 + "\n" + PlayList.Items[Vars.CurrentTrackNumber].SubItems[1].Text;
             labTime.Text    = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
             labTimeLen.Text = TimeSpan.FromSeconds(BassLike.GetTimeOfStream(BassLike.Stream)).ToString("mm':'ss");
             slTime.Maximum  = BassLike.GetTimeOfStream(BassLike.Stream);
             slTime.Value    = BassLike.GetPosOfStream(BassLike.Stream);
             timer1.Enabled  = true;
             if (MusicImageList.Images[Vars.CurrentTrackNumber] != null)
             {
                 pictureBox3.Image = MusicImageList.Images[Vars.CurrentTrackNumber];
             }
             btnPause.BringToFront();
         }
     }
 }
Ejemplo n.º 6
0
 private void slTime_Scroll(object sender, ScrollEventArgs e)//изминение позиции трека
 {
     BassLike.SetPosOfScroll(BassLike.Stream, slTime.Value);
     labTime.Text = TimeSpan.FromSeconds(BassLike.GetPosOfStream(BassLike.Stream)).ToString("mm':'ss");
 }