Ejemplo n.º 1
0
        //save the last played playlist??
        public void SetLastPlaylistTrack()
        {
            string   lp = Properties.Settings.Default.LastPlaylist;
            Playlist p  = fileLoader.GetPlaylist(lp, true);

            p.UpdatePaths();
            if (p == null)
            {
                tool.show();
            }
            string t     = Properties.Settings.Default.LastTrack;
            int    index = Properties.Settings.Default.LastTrackIndex;

            UpdateMusicPlayer(p, index);
        }
Ejemplo n.º 2
0
        public VNode LoadDirectoryToNode(string dir, string fileExtention)
        {
            if (!Directory.Exists(dir))
            {
                tool.debug("Error in tool.LoadDirectory: ", dir, " Does not exist");
                return(new VNode("No Directory: " + dir));
            }
            else
            {
                string[] files = Directory.GetFiles(dir, fileExtention);
                string[] dirs  = Directory.GetDirectories(dir);
                PlaylistFiles.Clear();
                VNode rn = new VNode(Path.GetFileName(dir));
                rn.name = dir;
                foreach (string s in dirs)
                {
                    VNode tn = LoadDirectoryToNode(s, fileExtention);
                    tn.name = s;
                    if (tn.Nodes.Count > 0)
                    {
                        rn.Nodes.Add(tn);
                    }
                }

                foreach (string f in files)
                {
                    VNode tn = new VNode();
                    tn.Text = Path.GetFileName(f);
                    tn.name = f;
                    rn.Nodes.Add(tn);
                    Playlist p = fileLoader.GetPlaylist(f, true);
                    PlaylistFiles.Add(f, p.name);
                }
                return(rn);
            }
        }