Beispiel #1
0
        /// <summary>
        ///     Sets the SortStrings of the songpointers to the actual category names
        /// </summary>
        private static void _AdjustCategoryNames()
        {
            ESongSorting sorting = CSongs.Sorter.SongSorting;

            switch (sorting)
            {
            case ESongSorting.TR_CONFIG_DECADE:
                foreach (CSongPointer songPointer in CSongs.Sorter.SortedSongs)
                {
                    string year = songPointer.SortString;
                    if (year != "")
                    {
                        year = year.Substring(0, 3);
                        songPointer.SortString = year + "0 - " + year + "9";
                    }
                }
                break;

            case ESongSorting.TR_CONFIG_TITLE_LETTER:
            case ESongSorting.TR_CONFIG_ARTIST_LETTER:
                foreach (CSongPointer songPointer in CSongs.Sorter.SortedSongs)
                {
                    songPointer.SortString = (songPointer.SortString.Length == 0 || !Char.IsLetter(songPointer.SortString, 0)) ? "#" : songPointer.SortString[0].ToString();
                }
                break;

            case ESongSorting.TR_CONFIG_DATEADDED:
                foreach (CSongPointer songPointer in CSongs.Sorter.SortedSongs)
                {
                    songPointer.SortString = CSongs.GetSong(songPointer.SongID).DateAdded.ToString("dd/MM/yyyy");
                }
                break;
            }
        }
Beispiel #2
0
 public static void StopPreview()
 {
     if (!IsPlayingPreview)
     {
         return;
     }
     Stop();
     _CurPlayer = _BGPlayer;
     if (_MusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC)
     {
         _CurPlayer.Load(CSongs.GetSong(_PreviewPlayer.SongID));
         _CurPlayer.Position = _PreviewPlayer.Position;
     }
     CSound.SetGlobalVolume(CConfig.BackgroundMusicVolume);
 }
Beispiel #3
0
 public CSong GetSongByID(int songID)
 {
     return(CSongs.GetSong(songID));
 }