/// <summary>
 ///     Handles the OnEndFadeIn event of the BassPlayer control.
 /// </summary>
 private void BassPlayer_OnFadeEnded(object sender, EventArgs e)
 {
     if (PlaylistControl.InvokeRequired)
     {
         PlaylistControl.BeginInvoke(new MethodInvoker(delegate { BassPlayer_OnFadeEnded(); }));
     }
     else
     {
         BassPlayer_OnFadeEnded();
     }
 }
        /// <summary>
        ///     Handles the OnEndFadeIn event of the BassPlayer control.
        /// </summary>
        private void BassPlayer_OnFadeEnded()
        {
            if (!AutoGenerateEnabled)
            {
                return;
            }
            var tracksRemaining = PlaylistControl.GetNumberOfTracksRemaining();

            if (tracksRemaining < TracksRemainingThreshold)
            {
                AutoGeneratePlaylist();
            }
        }
Exemple #3
0
        /// <summary>
        ///     Gets the previous track.
        /// </summary>
        /// <returns>The previous track</returns>
        private Track GetPreviousTrack()
        {
            var prevTrack = PlaylistControl.GetPreviousTrack();

            if (prevTrack == null)
            {
                return(null);
            }

            var track = BassPlayer.LoadTrack(prevTrack.Filename);

            BassPlayer.LoadTrackAudioData(track);
            ExtenedAttributesHelper.LoadExtendedAttributes(track);
            return(track);
        }
        public void SetCurrentMixRank(int mixRank)
        {
            if (BassPlayer.CurrentTrack == null)
            {
                return;
            }

            Track currentTrack = null;

            if (BassPlayer.CurrentTrack != null)
            {
                currentTrack = Library.GetTrackByFilename(BassPlayer.CurrentTrack.Filename);
            }

            var prevTrack = PlaylistControl.GetPreviousTrack();

            if (prevTrack == null)
            {
                return;
            }

            MixLibrary.SetMixLevel(prevTrack, currentTrack, mixRank);
        }
        public int GetCurrentMixRank()
        {
            if (BassPlayer.CurrentTrack == null)
            {
                return(1);
            }

            Track currentTrack = null;

            if (BassPlayer.CurrentTrack != null)
            {
                currentTrack = Library.GetTrackByFilename(BassPlayer.CurrentTrack.Filename);
            }

            var prevTrack = PlaylistControl.GetPreviousTrack();

            if (prevTrack == null)
            {
                return(1);
            }

            return(MixLibrary.GetMixLevel(prevTrack, currentTrack));
        }
 private void btnReplayMix_Click(object sender, EventArgs e)
 {
     BeginInvoke(new MethodInvoker(delegate { PlaylistControl.ReplayMix(); }));
 }
 /// <summary>
 ///     Handles the Click event of the btnPrevious control.
 /// </summary>
 private void btnPrevious_Click(object sender, EventArgs e)
 {
     BeginInvoke(new MethodInvoker(delegate { PlaylistControl.PlayPreviousTrack(); }));
 }