Beispiel #1
0
 private void Play_Click(object sender, RoutedEventArgs e)
 {
     //
     if (!MediaPlayer.IsPlaying && BassTrackVM.TracksList.Count != 0 && MediaPlayer.ActiveStreamHandle == 0)
     {
         MediaPlayer.OpenFile((BassTrackVM.TracksList[TrackListView.currentTrackIndex]).TrackPath);
         MediaPlayer.Play();
         return;
     }
     //
     MediaPlayer.Play();
 }
        /// <summary>
        ///     Handles the Click event of the btnPlay control.
        /// </summary>
        private void btnPlay_Click(object sender, EventArgs e)
        {
            BeginInvoke(BassPlayer.PlayState == PlayState.Playing
                ? delegate { BassPlayer.Pause(); }
                : new MethodInvoker(delegate { BassPlayer.Play(); }));

            btnPause.Visible = BassPlayer.PlayState == PlayState.Playing;
            btnPlay.Visible  = BassPlayer.PlayState != PlayState.Playing;
        }
        /// <summary>
        ///     Handles the CellContentDoubleClick event of the grdPlaylist control.
        /// </summary>
        public void ReplayMix()
        {
            var previousTrack = GetPreviousTrack();

            if (previousTrack == null)
            {
                return;
            }

            var index = GetCurrentTrackIndex() - 1;

            SetCurrentTrack(index);

            _doNotBind = true;
            BassPlayer.ForcePlay(previousTrack.Filename);
            BassPlayer.SkipToFadeOut();
            BassPlayer.Play();

            _doNotBind = false;

            //BindData();
            grdPlaylist.InvalidateDisplayedRows();
        }