public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (string.IsNullOrEmpty(Value)) { return(new byte[0]); } if (LanguageCode == null || LanguageCode.Length != 3) { LanguageCode = "eng"; } byte[] descriptionData; byte[] valueData; do { descriptionData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, Description, true); valueData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, Value, false); } while ( this.RequiresFix(tagVersion, Description, descriptionData) || this.RequiresFix(tagVersion, Value, valueData) ); using (MemoryStream frameData = new MemoryStream()) { frameData.WriteByte((byte)TextEncoding); frameData.Write(ByteUtils.ISO88591GetBytes(LanguageCode)); frameData.Write(descriptionData); frameData.Write(valueData); return(_frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion))); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (string.IsNullOrEmpty(_value)) { return(new byte[0]); } byte[] descriptionData; byte[] valueData; do { descriptionData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, Description, true); valueData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, Value, false); } while ( this.RequiresFix(tagVersion, Description, descriptionData) || this.RequiresFix(tagVersion, Value, valueData) ); using (MemoryStream stream = new MemoryStream()) { stream.WriteByte((byte)TextEncoding); stream.Write(descriptionData); stream.Write(valueData); return(_frameHeader.GetBytes(stream, tagVersion, GetFrameID(tagVersion))); } }
internal List <IFrame> GetAllFrames(ID3v2TagVersion tagVersion) { Dictionary <string, IBindingList> multipleOccurrenceFrames = GetMultipleOccurrenceFrames(tagVersion); Dictionary <string, IFrame> singleOccurenceFrames = GetSingleOccurrenceFrames(tagVersion); List <IFrame> allFrames = new List <IFrame>(); allFrames.AddRange(singleOccurenceFrames.Select(p => p.Value)); foreach (KeyValuePair <string, IBindingList> kvp in multipleOccurrenceFrames) { IBindingList bindingList = kvp.Value; allFrames.AddRange(bindingList.Cast <IFrame>()); // Special handling for iTunes comment frames if (kvp.Key == "COMM" || kvp.Key == "COM") { allFrames.AddRange(m_iTunesCommentsList); } } allFrames.AddRange(_unknownFrames); foreach (IFrame frame in new List <IFrame>(allFrames)) { if (frame.GetBytes(tagVersion).Length == 0) { allFrames.Remove(frame); } } return(allFrames); }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (_encapsulatedObject == null || _encapsulatedObject.Length == 0) { return(new byte[0]); } using (MemoryStream frameData = new MemoryStream()) { byte[] fileNameData; byte[] descriptionData; do { fileNameData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, FileName, true); descriptionData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, Description, true); } while ( this.RequiresFix(tagVersion, FileName, fileNameData) || this.RequiresFix(tagVersion, Description, descriptionData) ); frameData.WriteByte((byte)TextEncoding); frameData.Write(ID3v2Utils.GetStringBytes(tagVersion, EncodingType.ISO88591, MimeType, true)); frameData.Write(fileNameData); frameData.Write(descriptionData); frameData.Write(_encapsulatedObject); return(_frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion))); } }
internal List <IFrame> GetAllFrames(ID3v2TagVersion tagVersion, IEnumerable <string> frameIDs) { if (frameIDs == null) { throw new ArgumentNullException("frameIDs"); } List <IFrame> allFrames = GetAllFrames(tagVersion); foreach (IFrame frame in new List <IFrame>(allFrames)) { bool found = false; foreach (string frameID in frameIDs) { if (frame.GetFrameID(ID3v2TagVersion.ID3v22) == frameID || frame.GetFrameID(ID3v2TagVersion.ID3v23) == frameID || frame.GetFrameID(ID3v2TagVersion.ID3v24) == frameID) { found = true; break; } } if (!found) { allFrames.Remove(frame); } } return(allFrames); }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (_encapsulatedObject == null || _encapsulatedObject.Length == 0) return new byte[0]; using (MemoryStream frameData = new MemoryStream()) { byte[] fileNameData; byte[] descriptionData; do { fileNameData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, FileName, true); descriptionData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, Description, true); } while ( this.RequiresFix(tagVersion, FileName, fileNameData) || this.RequiresFix(tagVersion, Description, descriptionData) ); frameData.WriteByte((byte)TextEncoding); frameData.Write(ID3v2Utils.GetStringBytes(tagVersion, EncodingType.ISO88591, MimeType, true)); frameData.Write(fileNameData); frameData.Write(descriptionData); frameData.Write(_encapsulatedObject); return _frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion)); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (_audioData == null || _audioData.Length == 0) { return(new byte[0]); } string frameID = GetFrameID(tagVersion); if (frameID == null) { return(new byte[0]); } using (MemoryStream frameData = new MemoryStream()) { byte[] mimeType = ID3v2Utils.GetStringBytes(tagVersion, EncodingType.ISO88591, MimeType, true); byte[] equivText; do { equivText = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, EquivalentText, true); } while (this.RequiresFix(tagVersion, EquivalentText, equivText)); frameData.WriteByte((byte)TextEncoding); frameData.Write(mimeType, 0, mimeType.Length); frameData.WriteByte((byte)(_isMpegOrAac ? 0 : 1)); frameData.Write(equivText, 0, equivText.Length); frameData.Write(_audioData, 0, _audioData.Length); return(_frameHeader.GetBytes(frameData, tagVersion, frameID)); } }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if ((this.m_AdditionalData == null) && (this.m_AdditionalData.Length == 0)) { return new byte[0]; } if (tagVersion == ID3v2TagVersion.ID3v22) { if ((this.m_FrameIdentifier == null) || (this.m_FrameIdentifier.Length != 3)) { return new byte[0]; } } else if ((this.m_FrameIdentifier == null) || (this.m_FrameIdentifier.Length != 4)) { return new byte[0]; } using (MemoryStream stream1 = new MemoryStream()) { Utils.Write(stream1, Utils.ISO88591GetBytes(this.m_FrameIdentifier)); Utils.Write(stream1, Utils.GetStringBytes(tagVersion, EncodingType.ISO88591, this.m_Url, true)); Utils.Write(stream1, this.m_AdditionalData); return this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion)); } }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (this.Items.Count == 0) { return new byte[0]; } using (MemoryStream stream1 = new MemoryStream()) { stream1.WriteByte((byte) this.m_TextEncoding); bool flag1 = false; using (IEnumerator<IInvolvedPerson> enumerator1 = this.Items.GetEnumerator()) { while (enumerator1.MoveNext()) { IInvolvedPerson person1 = enumerator1.Current; if (!string.IsNullOrEmpty(person1.Involvement) || !string.IsNullOrEmpty(person1.Name)) { Utils.Write(stream1, Utils.GetStringBytes(tagVersion, this.m_TextEncoding, person1.Involvement, true)); Utils.Write(stream1, Utils.GetStringBytes(tagVersion, this.m_TextEncoding, person1.Name, true)); flag1 = true; } } } if (!flag1) { return new byte[0]; } return this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion)); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (Items.Count == 0) { return(new byte[0]); } // Set TextEncoding to Unicode/UTF8 if required if (TextEncoding == EncodingType.ISO88591) { foreach (ILanguageItem languageItem in Items) { byte[] languageCodeData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, languageItem.LanguageCode, true); this.RequiresFix(tagVersion, languageItem.LanguageCode, languageCodeData); } } using (MemoryStream frameData = new MemoryStream()) { frameData.WriteByte((byte)TextEncoding); bool isTerminated = true; //(tagVersion == TagVersion.ID3v24); for (int i = 0; i < Items.Count; i++) { ILanguageItem languageItem = Items[i]; if (i == Items.Count - 1) { isTerminated = false; } frameData.Write(ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, languageItem.LanguageCode, isTerminated)); } return(_frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion))); } }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if ((this.m_PictureData == null) || (this.m_PictureData.Length == 0)) { return(new byte[0]); } this.TextEncoding = EncodingType.ISO88591; using (MemoryStream stream1 = new MemoryStream()) { stream1.WriteByte((byte)this.m_TextEncoding); if (tagVersion == ID3v2TagVersion.ID3v22) { string text1 = this.PictureExtension; if (string.IsNullOrEmpty(text1) || (text1.Length < 3)) { text1 = " "; } else if (text1.Length > 3) { text1 = text1.Substring(0, 3); } Utils.Write(stream1, Encoding.ASCII.GetBytes(text1)); } else { this.SetMimeType(); Utils.Write(stream1, Utils.ISO88591GetBytes(this.m_MimeType)); stream1.WriteByte(0); } stream1.WriteByte((byte)this.m_PictureType); Utils.Write(stream1, Utils.GetStringBytes(tagVersion, this.m_TextEncoding, this.m_Description, true)); Utils.Write(stream1, this.m_PictureData); return(this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion))); } }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if ((this.m_AdditionalData == null) && (this.m_AdditionalData.Length == 0)) { return(new byte[0]); } if (tagVersion == ID3v2TagVersion.ID3v22) { if ((this.m_FrameIdentifier == null) || (this.m_FrameIdentifier.Length != 3)) { return(new byte[0]); } } else if ((this.m_FrameIdentifier == null) || (this.m_FrameIdentifier.Length != 4)) { return(new byte[0]); } using (MemoryStream stream1 = new MemoryStream()) { Utils.Write(stream1, Utils.ISO88591GetBytes(this.m_FrameIdentifier)); Utils.Write(stream1, Utils.GetStringBytes(tagVersion, EncodingType.ISO88591, this.m_Url, true)); Utils.Write(stream1, this.m_AdditionalData); return(this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion))); } }
internal List<IFrame> GetAllFrames(ID3v2TagVersion tagVersion, IEnumerable<string> frameIDs) { if (frameIDs == null) throw new ArgumentNullException("frameIDs"); List<IFrame> allFrames = GetAllFrames(tagVersion); foreach (IFrame frame in new List<IFrame>(allFrames)) { bool found = false; foreach (string frameID in frameIDs) { if (frame.GetFrameID(ID3v2TagVersion.ID3v22) == frameID || frame.GetFrameID(ID3v2TagVersion.ID3v23) == frameID || frame.GetFrameID(ID3v2TagVersion.ID3v24) == frameID) { found = true; break; } } if (!found) allFrames.Remove(frame); } return allFrames; }
public void ReadFrom(TagReadingInfo tagReadingInfo, Stream stream) { int num1 = Utils.ReadInt32(stream); ID3v2TagVersion version1 = tagReadingInfo.TagVersion; if (num1 >= 0x41000000) { string text1 = string.Format("FrameID found when expected extended header at position {0}", stream.Position - 4); Trace.WriteLine(text1); stream.Seek((long)(-4), SeekOrigin.Current); this.m_IsCRCDataPresent = false; this.m_PaddingSize = 0; this.m_TotalFrameCRC = 0; } else { byte num2 = Utils.ReadByte(stream); Utils.ReadByte(stream); this.m_IsCRCDataPresent = (num2 & 0x80) == 0x80; this.m_PaddingSize = Utils.ReadInt32(stream); if (this.m_IsCRCDataPresent) { this.m_TotalFrameCRC = Utils.ReadInt32(stream); } else { this.m_TotalFrameCRC = 0; } } }
internal List<IFrame> GetAllFrames(ID3v2TagVersion tagVersion) { Dictionary<string, IBindingList> multipleOccurrenceFrames = GetMultipleOccurrenceFrames(tagVersion); Dictionary<string, IFrame> singleOccurenceFrames = GetSingleOccurrenceFrames(tagVersion); List<IFrame> allFrames = new List<IFrame>(); allFrames.AddRange(singleOccurenceFrames.Select(p => p.Value)); foreach (KeyValuePair<string, IBindingList> kvp in multipleOccurrenceFrames) { IBindingList bindingList = kvp.Value; allFrames.AddRange(bindingList.Cast<IFrame>()); // Special handling for iTunes comment frames if (kvp.Key == "COMM" || kvp.Key == "COM") { allFrames.AddRange(m_iTunesCommentsList); } } allFrames.AddRange(_unknownFrames); foreach (IFrame frame in new List<IFrame>(allFrames)) { if (frame.GetBytes(tagVersion).Length == 0) allFrames.Remove(frame); } return allFrames; }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (this.Items.Count == 0) { return(new byte[0]); } using (MemoryStream stream1 = new MemoryStream()) { stream1.WriteByte((byte)this.m_TextEncoding); bool flag1 = false; using (IEnumerator <IInvolvedPerson> enumerator1 = this.Items.GetEnumerator()) { while (enumerator1.MoveNext()) { IInvolvedPerson person1 = enumerator1.Current; if (!string.IsNullOrEmpty(person1.Involvement) || !string.IsNullOrEmpty(person1.Name)) { Utils.Write(stream1, Utils.GetStringBytes(tagVersion, this.m_TextEncoding, person1.Involvement, true)); Utils.Write(stream1, Utils.GetStringBytes(tagVersion, this.m_TextEncoding, person1.Name, true)); flag1 = true; } } } if (!flag1) { return(new byte[0]); } return(this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion))); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (Position == 0) return new byte[0]; throw new NotImplementedException(); }
public static void Commercial(ID3v2TagVersion tagVersion, bool useLogo) { if (tagVersion == ID3v2TagVersion.ID3v22) throw new NotSupportedException(); IID3v2Tag id3 = new ID3v2Tag(); ICommercial aud = id3.CommercialInfoList.AddNew(); using (MemoryStream ms = new MemoryStream()) { ms.WriteByte(0); // text encoding Write(ms, Encoding.ASCII.GetBytes("usd10.00/cad15.00")); ms.WriteByte(0); // terminate Write(ms, Encoding.ASCII.GetBytes("20070610")); Write(ms, Encoding.ASCII.GetBytes("www.google.com")); ms.WriteByte(0); // terminate ms.WriteByte((byte)ReceivedAs.FileOverTheInternet); Write(ms, Encoding.ASCII.GetBytes("name of seller")); ms.WriteByte(0); // terminate Write(ms, Encoding.ASCII.GetBytes("description")); ms.WriteByte(0); // terminate if (useLogo) { Write(ms, Encoding.ASCII.GetBytes("image/jpeg")); ms.WriteByte(0); // terminate Write(ms, new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04 }); } TestFrame(aud, tagVersion, ms.ToArray()); } }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if ((this.m_PictureData == null) || (this.m_PictureData.Length == 0)) { return new byte[0]; } this.TextEncoding = EncodingType.ISO88591; using (MemoryStream stream1 = new MemoryStream()) { stream1.WriteByte((byte) this.m_TextEncoding); if (tagVersion == ID3v2TagVersion.ID3v22) { string text1 = this.PictureExtension; if (string.IsNullOrEmpty(text1) || (text1.Length < 3)) { text1 = " "; } else if (text1.Length > 3) { text1 = text1.Substring(0, 3); } Utils.Write(stream1, Encoding.ASCII.GetBytes(text1)); } else { this.SetMimeType(); Utils.Write(stream1, Utils.ISO88591GetBytes(this.m_MimeType)); stream1.WriteByte(0); } stream1.WriteByte((byte) this.m_PictureType); Utils.Write(stream1, Utils.GetStringBytes(tagVersion, this.m_TextEncoding, this.m_Description, true)); Utils.Write(stream1, this.m_PictureData); return this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion)); } }
public static void Commercial(ID3v2TagVersion tagVersion, bool useLogo) { if (tagVersion == ID3v2TagVersion.ID3v22) { throw new NotSupportedException(); } IID3v2Tag id3 = new ID3v2Tag(); ICommercial aud = id3.CommercialInfoList.AddNew(); using (MemoryStream ms = new MemoryStream()) { ms.WriteByte(0); // text encoding Write(ms, Encoding.ASCII.GetBytes("usd10.00/cad15.00")); ms.WriteByte(0); // terminate Write(ms, Encoding.ASCII.GetBytes("20070610")); Write(ms, Encoding.ASCII.GetBytes("www.google.com")); ms.WriteByte(0); // terminate ms.WriteByte((byte)ReceivedAs.FileOverTheInternet); Write(ms, Encoding.ASCII.GetBytes("name of seller")); ms.WriteByte(0); // terminate Write(ms, Encoding.ASCII.GetBytes("description")); ms.WriteByte(0); // terminate if (useLogo) { Write(ms, Encoding.ASCII.GetBytes("image/jpeg")); ms.WriteByte(0); // terminate Write(ms, new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04 }); } TestFrame(aud, tagVersion, ms.ToArray()); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (_minimumOffsetToNextTag == 0) return new byte[0]; throw new NotImplementedException(); }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { // TODO: Test if (string.IsNullOrEmpty(Text)) { return(new byte[0]); } byte[] contentDescriptorData; byte[] textData; do { contentDescriptorData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, ContentDescriptor, true); textData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, Text, false); } while ( this.RequiresFix(tagVersion, ContentDescriptor, contentDescriptorData) || this.RequiresFix(tagVersion, Text, textData) ); using (MemoryStream frameData = new MemoryStream()) { frameData.WriteByte((byte)TextEncoding); frameData.Write(ByteUtils.ISO88591GetBytes(LanguageCode)); frameData.Write(contentDescriptorData); frameData.Write(textData); return(_frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion))); } }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { byte[] buf = new byte[_isCRCDataPresent ? 14 : 10]; // Size (excluding these 4 bytes) buf[0] = 0; buf[1] = 0; buf[2] = 0; buf[3] = (byte)(_isCRCDataPresent ? 10 : 6); // Flags buf[4] = (Byte)(_isCRCDataPresent ? 0x80 : 0); buf[5] = 0; // Padding size buf[6] = (Byte)((_paddingSize >> 24) & 0xFF); buf[7] = (Byte)((_paddingSize >> 16) & 0xFF); buf[8] = (Byte)((_paddingSize >> 8) & 0xFF); buf[9] = (Byte)(_paddingSize & 0xFF); if (_isCRCDataPresent) { // Total Frame CRC buf[10] = (Byte)((_totalFrameCRC >> 24) & 0xFF); buf[11] = (Byte)((_totalFrameCRC >> 16) & 0xFF); buf[12] = (Byte)((_totalFrameCRC >> 8) & 0xFF); buf[13] = (Byte)(_totalFrameCRC & 0xFF); } return(buf); }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (_additionalData == null || _additionalData.Length == 0) return new byte[0]; if (tagVersion == ID3v2TagVersion.ID3v22) { if (_frameIdentifier == null || _frameIdentifier.Length != 3) return new byte[0]; } else { if (_frameIdentifier == null || _frameIdentifier.Length != 4) return new byte[0]; } using (MemoryStream frameData = new MemoryStream()) { frameData.Write(ByteUtils.ISO88591GetBytes(_frameIdentifier)); frameData.Write(ID3v2Utils.GetStringBytes(tagVersion, EncodingType.ISO88591, _url, true)); frameData.Write(_additionalData); return _frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion)); } }
internal List<IFrame> GetAllFrames(ID3v2TagVersion tagVersion, string frameID) { if (string.IsNullOrEmpty(frameID)) throw new ArgumentNullException("frameID"); return GetAllFrames(tagVersion, new List<string> { frameID }); }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { // TODO: Test if (string.IsNullOrEmpty(Text)) return new byte[0]; byte[] contentDescriptorData; byte[] textData; do { contentDescriptorData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, ContentDescriptor, true); textData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, Text, false); } while ( this.RequiresFix(tagVersion, ContentDescriptor, contentDescriptorData) || this.RequiresFix(tagVersion, Text, textData) ); using (MemoryStream frameData = new MemoryStream()) { frameData.WriteByte((byte)TextEncoding); frameData.Write(ByteUtils.ISO88591GetBytes(LanguageCode)); frameData.Write(contentDescriptorData); frameData.Write(textData); return _frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion)); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (Items.Count == 0) return new byte[0]; // Set TextEncoding to Unicode/UTF8 if required if (TextEncoding == EncodingType.ISO88591) { foreach (ILanguageItem languageItem in Items) { byte[] languageCodeData = ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, languageItem.LanguageCode, true); this.RequiresFix(tagVersion, languageItem.LanguageCode, languageCodeData); } } using (MemoryStream frameData = new MemoryStream()) { frameData.WriteByte((byte)TextEncoding); bool isTerminated = true; //(tagVersion == TagVersion.ID3v24); for (int i = 0; i < Items.Count; i++) { ILanguageItem languageItem = Items[i]; if (i == Items.Count - 1) isTerminated = false; frameData.Write(ID3v2Utils.GetStringBytes(tagVersion, TextEncoding, languageItem.LanguageCode, isTerminated)); } return _frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion)); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (_additionalData == null || _additionalData.Length == 0) { return(new byte[0]); } if (tagVersion == ID3v2TagVersion.ID3v22) { if (_frameIdentifier == null || _frameIdentifier.Length != 3) { return(new byte[0]); } } else { if (_frameIdentifier == null || _frameIdentifier.Length != 4) { return(new byte[0]); } } using (MemoryStream frameData = new MemoryStream()) { frameData.Write(ByteUtils.ISO88591GetBytes(_frameIdentifier)); frameData.Write(ID3v2Utils.GetStringBytes(tagVersion, EncodingType.ISO88591, _url, true)); frameData.Write(_additionalData); return(_frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion))); } }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (((this.PricePaid != 0) || !string.IsNullOrEmpty(this.CurrencyCode)) || ((this.DateOfPurchase != DateTime.MinValue) || !string.IsNullOrEmpty(this.Seller))) { throw new NotImplementedException(); } return new byte[0]; }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (((this.IndexedDataLength != 0) && (this.BitsPerIndexPoint != 0)) && (this.FractionAtIndex.Count != 0)) { throw new NotImplementedException(); } return(new byte[0]); }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (this.Items.Count != 0) { throw new NotImplementedException(); } return new byte[0]; }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (((this.IndexedDataLength != 0) && (this.BitsPerIndexPoint != 0)) && (this.FractionAtIndex.Count != 0)) { throw new NotImplementedException(); } return new byte[0]; }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if ((this.ReverbLeftMilliseconds != 0) || (this.ReverbRightMilliseconds != 0)) { throw new NotImplementedException(); } return new byte[0]; }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (this.BufferSize != 0) { throw new NotImplementedException(); } return(new byte[0]); }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (this.m_MinimumOffsetToNextTag != 0) { throw new NotImplementedException(); } return new byte[0]; }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if ((this.ReverbLeftMilliseconds != 0) || (this.ReverbRightMilliseconds != 0)) { throw new NotImplementedException(); } return(new byte[0]); }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (((this.PricePaid != 0) || !string.IsNullOrEmpty(this.CurrencyCode)) || ((this.DateOfPurchase != DateTime.MinValue) || !string.IsNullOrEmpty(this.Seller))) { throw new NotImplementedException(); } return(new byte[0]); }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (this.BufferSize != 0) { throw new NotImplementedException(); } return new byte[0]; }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (this.m_MinimumOffsetToNextTag != 0) { throw new NotImplementedException(); } return(new byte[0]); }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (((this.FramesBetweenReference != 0) && (this.BytesBetweenReference != 0)) && ((this.MillisecondsBetweenReference != 0) && (this.Items.Count != 0))) { throw new NotImplementedException(); } return(new byte[0]); }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (((this.FramesBetweenReference != 0) && (this.BytesBetweenReference != 0)) && ((this.MillisecondsBetweenReference != 0) && (this.Items.Count != 0))) { throw new NotImplementedException(); } return new byte[0]; }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (this.Items.Count != 0) { throw new NotImplementedException(); } return(new byte[0]); }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (Items.Count == 0) { return(new byte[0]); } throw new NotImplementedException(); }
private void Clear() { _tagVersion = ID3v2TagVersion.ID3v23; _tagVersionRevision = 0; _tagSize = 0; _usesUnsynchronization = false; _hasExtendedHeader = false; _isExperimental = false; }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (_minimumOffsetToNextTag == 0) { return(new byte[0]); } throw new NotImplementedException(); }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (Items.Count == 0) { return(new byte[0]); } // Sets appropriate TextEncoding if ISO-8859-1 is insufficient if (TextEncoding == EncodingType.ISO88591) { foreach (IInvolvedPerson involvedPerson in Items) { if (string.IsNullOrEmpty(involvedPerson.Involvement) && string.IsNullOrEmpty(involvedPerson.Name)) { continue; } byte[] involvementData = ID3v2Utils.GetStringBytes(tagVersion, _textEncoding, involvedPerson.Involvement, true); byte[] nameData = ID3v2Utils.GetStringBytes(tagVersion, _textEncoding, involvedPerson.Name, true); if (this.RequiresFix(tagVersion, involvedPerson.Involvement, involvementData)) { break; } if (this.RequiresFix(tagVersion, involvedPerson.Name, nameData)) { break; } } } using (MemoryStream frameData = new MemoryStream()) { frameData.WriteByte((byte)_textEncoding); bool foundItem = false; foreach (IInvolvedPerson involvedPerson in Items) { if (string.IsNullOrEmpty(involvedPerson.Involvement) && string.IsNullOrEmpty(involvedPerson.Name)) { continue; } frameData.Write(ID3v2Utils.GetStringBytes(tagVersion, _textEncoding, involvedPerson.Involvement, true)); frameData.Write(ID3v2Utils.GetStringBytes(tagVersion, _textEncoding, involvedPerson.Name, true)); foundItem = true; } if (!foundItem) { return(new byte[0]); } return(_frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion))); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (ReverbLeftMilliseconds == 0 && ReverbRightMilliseconds == 0) { return(new byte[0]); } throw new NotImplementedException(); }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (_frameData == null || _frameData.Length == 0) return new byte[0]; using (MemoryStream frameData = new MemoryStream(_frameData)) { return _frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion)); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (IndexedDataLength == 0 || BitsPerIndexPoint == 0 || FractionAtIndex.Count == 0) { return(new byte[0]); } throw new NotImplementedException(); }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { using (MemoryStream frameData = new MemoryStream()) { frameData.Write(ID3v2Utils.GetStringBytes(tagVersion, EncodingType.ISO88591, _ownerIdentifier, true)); frameData.WriteByte(_groupSymbol); if (_groupDependentData != null) frameData.Write(_groupDependentData); return _frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion)); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (TOC == null || TOC.Length == 0) return new byte[0]; using (MemoryStream frameData = new MemoryStream()) { frameData.Write(TOC, 0, TOC.Length); return _frameHeader.GetBytes(frameData, tagVersion, GetFrameID(tagVersion)); } }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if ((this.m_FrameData == null) || (this.m_FrameData.Length == 0)) { return(new byte[0]); } using (MemoryStream stream1 = new MemoryStream(this.m_FrameData)) { return(this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion))); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (IndexedDataLength == 0 || BitsPerIndexPoint == 0 || FractionAtIndex.Count == 0) { return new byte[0]; } throw new NotImplementedException(); }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (string.IsNullOrEmpty(_value)) return new byte[0]; using (MemoryStream stream = new MemoryStream()) { stream.Write(ByteUtils.ISO88591GetBytes(_value)); return _frameHeader.GetBytes(stream, tagVersion, GetFrameID(tagVersion)); } }
internal List <IFrame> GetAllFrames(ID3v2TagVersion tagVersion, string frameID) { if (string.IsNullOrEmpty(frameID)) { throw new ArgumentNullException("frameID"); } return(GetAllFrames(tagVersion, new List <string> { frameID })); }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if ((this.m_FrameData == null) || (this.m_FrameData.Length == 0)) { return new byte[0]; } using (MemoryStream stream1 = new MemoryStream(this.m_FrameData)) { return this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion)); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { using (MemoryStream stream = new MemoryStream()) { stream.Write(ID3v2Utils.GetStringBytes(tagVersion, EncodingType.ISO88591, OwnerIdentifier, true)); stream.Write(ByteUtils.Get2Bytes(PreviewStart)); stream.Write(ByteUtils.Get2Bytes(PreviewLength)); if (_encryptionInfo != null) stream.Write(_encryptionInfo); return _frameHeader.GetBytes(stream, tagVersion, GetFrameID(tagVersion)); } }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if ((this.TOC == null) || (this.TOC.Length == 0)) { return new byte[0]; } using (MemoryStream stream1 = new MemoryStream()) { stream1.Write(this.TOC, 0, this.TOC.Length); return this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion)); } }
public override byte[] GetBytes(ID3v2TagVersion tagVersion) { if (PricePaid == 0 && string.IsNullOrEmpty(CurrencyCode) && DateOfPurchase == DateTime.MinValue && string.IsNullOrEmpty(Seller)) { return new byte[0]; } throw new NotImplementedException(); }
public byte[] GetBytes(ID3v2TagVersion tagVersion) { if (string.IsNullOrEmpty(this.m_Value)) { return new byte[0]; } using (MemoryStream stream1 = new MemoryStream()) { Utils.Write(stream1, Utils.ISO88591GetBytes(this.m_Value)); return this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion)); } }