コード例 #1
0
        public listMusicItem(string path, string bg, string outpath)
        {
            this.path = path;
            updatePaths(bg, outpath);

            // get ze id3 dataz!
            // http://www.codeproject.com/KB/cs/Do_Anything_With_ID3.aspx
            ID3Info f   = new ID3Info(path, true);
            ID3v2   id3 = f.ID3v2Info;

            this.title  = id3.GetTextFrame("TIT2");
            this.artist = id3.GetTextFrame("TPE1");
            this.album  = id3.GetTextFrame("TALB");

            Console.WriteLine("------ File ID3 data :: " + Path.GetFileName(path));
            Console.WriteLine("Title: " + title);
            Console.WriteLine("Artist: " + artist);
            Console.WriteLine("Album: " + album);

            // try to get any images if possible
            images = new Image[id3.AttachedPictureFrames.Count];
            for (int i = 0; i < id3.AttachedPictureFrames.Count; i++)
            {
                AttachedPictureFrame ap = id3.AttachedPictureFrames.Items[i];

                // Empty catch!? :o SHOCK! HORROR! no seriously, who cares what goes wrong here...
                try { images[i] = Image.FromStream(ap.Data); } catch { }
            }

            Console.WriteLine("Images Found: " + images.Length.ToString());
        }
コード例 #2
0
        public void GetTextFrameTest()
        {
            string filePath = string.Empty;                  // TODO: Initialize to an appropriate value
            bool   LoadData = false;                         // TODO: Initialize to an appropriate value
            ID3v2  target   = new ID3v2(filePath, LoadData); // TODO: Initialize to an appropriate value
            string FrameID  = string.Empty;                  // TODO: Initialize to an appropriate value
            string expected = string.Empty;                  // TODO: Initialize to an appropriate value
            string actual;

            actual = target.GetTextFrame(FrameID);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }