示例#1
0
文件: Main.cs 项目: Slashpwn/3D_Menu
    void next()
    {
        if(playlistPlay && !shuffle){

                currentSong = currentPlaylist.getNext(count);
                Debug.Log (currentSong.toString());
            count++;
        }
    }
示例#2
0
    public void searchForFiles(string baseDirectory)
    {
        DirectoryInfo dir = new DirectoryInfo(baseDirectory);
        DirectoryInfo[] directories = dir.GetDirectories();
        foreach (DirectoryInfo d in directories) {
            searchForFiles (d.FullName);

        }

        string fn = dir.FullName;
        string[] musicFiles = Directory.GetFiles (@fn,"*.mp3");
        foreach (string musicFile in musicFiles) {
            //using (var mp3 = new Mp3File(musicFile)) {
                Mp3ID3 tag = new Mp3ID3(musicFile);

                //Id3Tag tag = mp3.GetTag (Id3TagFamily.FileStartTag);

                if(tag != null){

                    /*
                    Debug.Log ("Title: " + tag.Title.Value);
                    Debug.Log ("Artist: " + tag.Artists.Value);
                    Debug.Log ("Album: " + tag.Album.Value);
                    Debug.Log("Genre: " + tag.Genre.Value);
        */

                    PlaylistItem newest = new PlaylistItem(musicFile,tag.Genre, tag.Artist, tag.Album, tag.Title);
                    Debug.Log (newest.toString());
                    songpool.Add(newest);
                    Stream stream = new FileStream("songpool/"+songpool.Count+".bin", FileMode.Create, FileAccess.Write, FileShare.None);
                    formatter.Serialize(stream, newest);
                    stream.Close();
                }

        //}

        }
    }