private void Read(ReadStyle propertiesStyle) { long flacDataBegin; long flacDataEnd; // Look for an ID3v2 tag long id3v2Location = FindId3v2(); if (id3v2Location >= 0) { id3v2_tag = new Id3v2Tag(this, id3v2Location); flacDataBegin = id3v2Location + id3v2_tag.Header.CompleteTagSize; } else { flacDataBegin = 0; } // Look for an ID3v1 tag long id3v1_location = FindId3v1(); if (id3v1_location >= 0) { id3v1_tag = new Id3v1Tag(this, id3v1_location); flacDataEnd = id3v1_location; } else { flacDataEnd = Length; } // Look for FLAC metadata, including vorbis comments xiph_comment_data = Scan(flacDataBegin, flacDataEnd); if (!IsValid) { return; } if (XiphCommentData.Count > 0) { comment = new OggXiphComment(XiphCommentData); } tag.SetTags(comment, id3v2_tag, id3v1_tag); FindFlacTag(TagTypes.Xiph, true); if (propertiesStyle != ReadStyle.None) { properties = new FlacProperties(stream_info_data, stream_length, propertiesStyle); } }
private void Read(ReadStyle propertiesStyle) { long flacDataBegin; long flacDataEnd; // Look for an ID3v2 tag long id3v2Location = FindId3v2(); if (id3v2Location >= 0) { id3v2_tag = new Id3v2Tag(this, id3v2Location); flacDataBegin = id3v2Location + id3v2_tag.Header.CompleteTagSize; } else flacDataBegin = 0; // Look for an ID3v1 tag long id3v1_location = FindId3v1(); if (id3v1_location >= 0) { id3v1_tag = new Id3v1Tag(this, id3v1_location); flacDataEnd = id3v1_location; } else flacDataEnd = Length; // Look for FLAC metadata, including vorbis comments xiph_comment_data = Scan(flacDataBegin, flacDataEnd); if (!IsValid) return; if (XiphCommentData.Count > 0) comment = new OggXiphComment(XiphCommentData); tag.SetTags(comment, id3v2_tag, id3v1_tag); FindFlacTag(TagTypes.Xiph, true); if (propertiesStyle != ReadStyle.None) properties = new FlacProperties(stream_info_data, stream_length, propertiesStyle); }