Example #1
0
        private void UpdateCurrentTrackRating(int RatingValue)
        {
            if (RatingValue < 0 || RatingValue > 5)
            {
                RatingValue = -1;
            }

            CurrentTrackTag.Rating = RatingValue;
            GUIPropertyManager.SetProperty("#Play.Current.Rating",
                                           (Convert.ToDecimal(2 * CurrentTrackTag.Rating + 1)).ToString());

            MusicDatabase dbs     = MusicDatabase.Instance;
            string        strFile = g_Player.CurrentFile;

            dbs.SetRating(strFile, RatingValue);
            Log.Info("GUIMusicPlayingNow: Set rating for song {0} to {1}", Path.GetFileName(g_Player.CurrentFile),
                     Convert.ToString(RatingValue));
        }