Example #1
0
 public PlaylistsManager(Context Context, string CurrentPlaylist)
 {
     this.Context         = Context;
     this.CurrentPlaylist = CurrentPlaylist;
     Playlist_Manager.PlaylistManager Pmanager = new Playlist_Manager.PlaylistManager(CurrentPlaylist);
     Tracks = Pmanager.FetchTracksFromPlaylist();
 }
Example #2
0
        private void InitList()
        {
            ISharedPreferences p = this.GetSharedPreferences(Startup.Prefs, FileCreationMode.Private);

            if (p.GetBoolean(Startup.REMEMBER, true))
            {
                ServiceSharedPref prefs    = new ServiceSharedPref(this);
                string            pullfrom = prefs.PullDataFrom();
                if (pullfrom == ServiceSharedPref.PULLDATAFROM_ALLTRACKS)
                {
                    using (IXmlParsable parser = new JsonPlaylistParser(InternalStorageHelper.InternalPlaylistAllLocation, "All.json"))
                    {
                        tracks = (List <Paths>)parser.FetchItems();
                    }
                }
                else if (pullfrom == ServiceSharedPref.PULLDATAFROM_FOLDER)
                {
                    string folderName = prefs.PullDataPath();
                    tracks = Track_Finder.TrackFinder.GetSongsFromFolder(folderName);
                }
                else
                {
                    string playlistName = prefs.PullDataPath();
                    Playlist_Manager.PlaylistManager manager = new Playlist_Manager.PlaylistManager(playlistName);
                    tracks = Track_Finder.TrackFinder.ConvertToPaths(manager.FetchTracksFromPlaylist());
                }
                song = prefs.PullLastSong();
            }
            else
            {
                if (p.GetString(Startup.VIEWMETHOD, Startup.ALLTRACKS) == Startup.PLAYLIST)
                {
                    string playlistName = p.GetString(Startup.PLAYLISTNAME, string.Empty);
                    Playlist_Manager.PlaylistManager manager = new Playlist_Manager.PlaylistManager(playlistName);
                    tracks = Track_Finder.TrackFinder.ConvertToPaths(manager.FetchTracksFromPlaylist());
                }
                else
                {
                    using (IXmlParsable parser = new JsonPlaylistParser(InternalStorageHelper.InternalPlaylistAllLocation, "All.json"))
                    {
                        tracks = (List <Paths>)parser.FetchItems();
                    }
                }
            }
        }