Beispiel #1
0
 public void OnSendSongName(SongNameEventArgs e)
 {
     if (SendSongName != null)
     {
         SendSongName(this, e);
     }
 }
Beispiel #2
0
        public void SendName(String songName) //for automatically playing playlist
        {
            var messageToSend = new SongNameEventArgs(songName, false);

            OnSendSongName(messageToSend);
            _currentActiveSongIndex = songListBox.SelectedIndex = NextSongIndex(_currentActiveSongIndex);
        }
Beispiel #3
0
        //event handlers subscriber
        public void SendSongNameHandler(object sender, SongNameEventArgs e)
        {
            if (song != null)
            {
                StopSong();
            }
            _songName            = e.message;
            song                 = new Song(_songName);
            textBox1.Text        = Path.GetFileName(e.message);
            _tikerIterator       = 0;
            songTrackBar.Value   = 0;
            durationTextBox.Text = TimeSpan.FromSeconds(CountSeconds(GetVideoDuration(e.message))).ToString();
            songTrackBar.Maximum = CountSeconds(GetVideoDuration(e.message));


            if (e.fromChooseButton)//sended from ChooseButton
            {
                song.Stop();
                songTimer.Stop();
                PlayPauseButtonActive();
            }
            else //sended by playing automatically
            {
                PlaySong(_songName);
            }
        }
Beispiel #4
0
        public void SendName(String songName, Boolean fromChooseButton) //for choose button
        {
            songName = songListUrl[songListBox.SelectedIndex];
            var messageToSend = new SongNameEventArgs(songName, fromChooseButton);

            OnSendSongName(messageToSend);
            _currentActiveSongIndex = songListBox.SelectedIndex;
        }