예제 #1
0
        private static void ReadAudioMetaFields(StreamBuffer sb, MusicMatchTag tag)
        {
            if (sb == null)
                throw new ArgumentNullException("sb");

            // Single-line text fields
            tag.SongTitle = ReadTextField(sb);
            tag.AlbumTitle = ReadTextField(sb);
            tag.ArtistName = ReadTextField(sb);
            tag.Genre = ReadTextField(sb);
            tag.Tempo = ReadTextField(sb);
            tag.Mood = ReadTextField(sb);
            tag.Situation = ReadTextField(sb);
            tag.Preference = ReadTextField(sb);

            // Non-text fields
            tag.SongDuration = ReadTextField(sb);
            tag.CreationDate = DateTime.FromOADate(sb.ReadDouble());
            tag.PlayCounter = sb.ReadInt32();
            tag.OriginalFilename = ReadTextField(sb);
            tag.SerialNumber = ReadTextField(sb);
            tag.TrackNumber = sb.ReadInt16();

            // Multi-line text fields
            tag.Notes = ReadTextField(sb);
            tag.ArtistBio = ReadTextField(sb);
            tag.Lyrics = ReadTextField(sb);

            // Internet addresses
            tag.ArtistUrl = ReadTextField(sb);
            tag.BuyCdUrl = ReadTextField(sb);
            tag.ArtistEmail = ReadTextField(sb);
        }
예제 #2
0
 public void ReadDoubleTest()
 {
     const double Value = 1.7976931348623157E+256;
     const double Expected = 1.7976931348623157E+256;
     StreamBuffer target = new StreamBuffer(BitConverter.GetBytes(Value)) { Position = 0 };
     double actual = target.ReadDouble();
     Assert.AreEqual(Expected, actual);
 }