Exemplo n.º 1
0
        public void SongChosen(Song song)
        {
            // Track song play with analytics
            ServiceLocator.Analytics.SetCustomVariable(1, "File System", song.FileSystem.FriendlyName, Substructio.Logging.CustomVariableScope.ApplicationView);
            ServiceLocator.Analytics.TrackEvent("Song", "Play", song.FileSystem.FriendlyName);

            // Remove the currently selected song if it already exists in the recent songs list
            // so that we can insert it again at the head, retaining the list order
            _recentSongs.Remove(song.SongBase);

            // Remove the oldest song if we are over the maximum recent song count
            if (_recentSongs.Count >= (int)SceneManager.GameSettings["MaxRecentSongCount"])
            {
                _recentSongs.RemoveAt(_recentSongs.Count - 1);
            }

            // Insert the new song at the head of the list
            _recentSongs.Insert(0, song.SongBase);

            // Save recent songs file
            SaveRecentSongs();

            // Refresh recent songs filesystem
            _directoryBrowser.RefreshRecentSongFilesystem();

            //SceneManager.RemoveScene(this);
            this.Visible = false;
            SceneManager.AddScene(
                new LoadingScene(
                    (float)SceneManager.GameSettings["AudioCorrection"],
                    (float)SceneManager.GameSettings["MaxAudioVolume"], _centerPolygon, _player, _shaderProgram, song), this);
        }