Exemple #1
0
        public virtual IList <SongDescription> ListAllSongs()
        {
            var gameService = this.Factory.Instantiate <IGameSongRepository>();
            SongVersionInformationList list = gameService.ListAllSongVersionsSortedByArtistName("teste", "gu1t@rm0n1c5"); //TODO: user account hardcoded for test (note that doesn't make sense in offline mode)

            var result = new List <SongDescription>();

            foreach (var song in list.SongVersionInformationList1)
            {
                result.Add(new SongDescription()
                {
                    Id     = song.Id,
                    Artist = song.Artist,
                    Album  = song.Album,
                    Song   = song.Song,

                    ConfigFileName = System.Configuration.ConfigurationManager.AppSettings["DataFolder"] + "Songs\\" + song.Id + "\\hard.xml",
                    SyncFileName   = System.Configuration.ConfigurationManager.AppSettings["DataFolder"] + "Songs\\" + song.Id + "\\sync.xml",
                    AudioFileName  = System.Configuration.ConfigurationManager.AppSettings["DataFolder"] + "Songs\\" + song.Id + "\\" + song.Id + ".mp3",

                    TimeSignature = GtTimeSignature.Time4x4,
                });
            }

            return(result);
        }
        public SongVersionInformationList ListAllSongVersionsSortedByArtistName(string pUserName, string pPasswordHash)
        {
            string[] folders = Directory.GetDirectories(SongsFolder);

            var songs = new List <SongVersionInformation>();

            foreach (var folder in folders)
            {
                if (File.Exists(folder + "\\description.txt"))
                {
                    var songVersionInformation = ReadSongVersionInformation(folder + "\\description.txt");

                    songs.Add(songVersionInformation);
                }
            }

            var result = new SongVersionInformationList();

            result.Items = new SongVersionInformation[songs.Count];
            songs.CopyTo(result.Items);

            return(result);
        }