示例#1
0
 private void MusicStatusTimer_Tick(object sender, EventArgs e)
 {
     sound.Pozisyon();
     if (trackBar1.Value == sound._sn_ToplamSure)
     {
         MusicStatusTimer.Stop();
         trackBar1.Value   = 0;
         Start_BTN.Visible = true;
         Stop_BTN.Visible  = false;
         sound.Stop();
         Go_BTN_Click(sender, e);
         Start_BTN_Click(sender, e);
     }
     else
     {
         trackBar1.Value      = sound._sn_Pozisyon;
         full_time_label.Text = sound._st_ToplamSure.ToString();
         this_time_label.Text = sound._st_Pozisyon;
     }
 }
示例#2
0
        private void MusicListTimer_Tick(object sender, EventArgs e)
        {
            if (MusicListForm.exit)
            {
                // timeri ise salaq gorek nolur
                if (MusicListForm.userslc)
                {
                    int rowindex = MusicListForm.rowindex;
                    if (rowindex >= 0)
                    {
                        MusicListTimer.Stop();
                        Start_BTN.Cursor = Cursors.Hand;
                        sound.Close();
                        if (Sound.musiclist.Count > 0)
                        {
                            sound.Open(Sound.musiclist[rowindex]);
                            sound.Play();
                            music_name_label.Text    = sound.NameParse(Sound.musiclist[rowindex]);
                            music_name_panel.Visible = true;
                            Start_BTN_Click(sender, e);

                            //Stop_BTN.Visible = true;
                            //Start_BTN.Visible = false;
                            Sound.musicCount            = rowindex;
                            SoundAnimationTimer.Enabled = true;
                            if (sound.mp3_Durum() == "")
                            {
                                MessageBox.Show("File zədələnib və ya adında düzgün simvollar yoxdur !", "Diqqət !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                Go_BTN_Click(sender, e);
                            }
                        }
                        else
                        {
                            trackBar1.Value          = 0;
                            this_time_label.Text     = "00:00";
                            full_time_label.Text     = "00:00";
                            music_name_panel.Visible = false;
                            Sound.musicCount         = 0;
                            sound.Stop();
                            Stop_BTN_Click(sender, e);
                            Start_BTN.Cursor = Cursors.No;
                            MusicStatusTimer.Stop();
                        }
                    }
                    return;
                }
                MusicListTimer.Stop();
                Stop_BTN.Visible  = false;
                Start_BTN.Visible = true;
                Start_BTN.Cursor  = Cursors.Hand;
                sound.Close();
                // musicname = Sound.musiclist[Sound.musicCount];
                if (Sound.musiclist.Count > 0)
                {
                    sound.Open(Sound.musiclist[0]);
                    music_name_label.Text       = sound.NameParse(Sound.musiclist[0]);
                    music_name_panel.Visible    = true;
                    SoundAnimationTimer.Enabled = true;
                }
                else
                {
                    this_time_label.Text = "00:00";
                    full_time_label.Text = "00:00";
                    MusicStatusTimer.Stop();
                    music_name_panel.Visible = false;
                    trackBar1.Value          = 0;
                    trackBar1.Enabled        = false;
                    Start_BTN.Cursor         = Cursors.No;
                }
            }
        }