コード例 #1
0
 public AudioTrack convertSongToAudioTrack(Song song)
 {
     return new AudioTrack(song.audio_url,
         song.title,
         song.artist,
         song.album,
         song.image_url);
 }
コード例 #2
0
 public List<AudioTrack> convertSongsToAudioTracks(Song[] songs)
 {
     if (songs == null)
     {
         return null;
     }
     return songs.Select(song => new AudioTrack(song.audio_url,
         song.title,
         song.artist,
         song.album,
         song.image_url)).ToList();
 }
コード例 #3
0
ファイル: MainPage.xaml.cs プロジェクト: lonkly/StereomoodWP7
        private void loadFinished(int METHOD, Song[] songs, Dictionary<string, string> returnedParams)
        {
            unblockUI();

            switch (METHOD)
            {
                case Constants.METHOD_RESET:
                    {
                        break;
                    }
                case Constants.METHOD_QUITAPP:
                    {
                        break;
                    }
                case Constants.METHOD_SEARCH:
                    {

                        if (songs != null && songs.Length > 0)
                        {
                            if (returnedParams.ContainsKey("VALUE"))
                            {
                                searchResult = new SearchResult
                                                   {
                                                       trackList = songs,
                                                       tracksTotal = songs.Length
                                                   };
                                itemCollections.currentMood = new Tag
                                                                  {
                                                                      type = returnedParams["TYPE"],
                                                                      value = returnedParams["VALUE"]
                                                                  };
                            }

                            if (itemCollections.currentMood != null &&
                                !itemCollections.getSongsForTagDictionary().ContainsKey(itemCollections.currentMood.value))
                            {
                                itemCollections.getSongsForTagDictionary().Add(itemCollections.currentMood.value, songs);
                            }
                            itemCollections.songs = songs;
                            itemCollections.SaveApplicationState();
                            Uri songDetailsUri =
                                new Uri("/SongDetailsPage.xaml",
                                        UriKind.Relative);
                            NavigationService.Navigate(songDetailsUri);
                        }
                        break;
                    }
            }

        }