public Frames_PersonListTextFrameTest() { ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); byteArray00 = new byte[] { 0x01, 0xFF, 0xFE, 0x70, 0x00, 0x72, 0x00, 0x6F, 0x00, 0x64, 0x00, 0x75, 0x00, 0x63, 0x00, 0x65, 0x00, 0x72, 0x00 }; byteArray01 = new byte[] { 0x01, 0xFF, 0xFE, 0x70, 0x00, 0x72, 0x00, 0x6F, 0x00, 0x64, 0x00, 0x75, 0x00, 0x63, 0x00, 0x65, 0x00, 0x72, 0x00, 0x4E, 0x00, 0x61, 0x00, 0x6D, 0x00, 0x65, 0x00 }; byteArray02 = new byte[] { 0x01, 0xFF, 0xFE, 0x6D, 0x00, 0x61, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x67, 0x00 }; byteArray03 = new byte[] { 0x01, 0xFF, 0xFE, 0x6D, 0x00, 0x61, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x67, 0x00, 0x4E, 0x00, 0x61, 0x00, 0x6D, 0x00, 0x65, 0x00 }; }
public Abstract_UserDefinedFrameTest() { testArray = new byte[] { 0x00, 0x6D, 0x61, 0x6A, 0x6F, 0x72, 0x5F, 0x62, 0x72, 0x61, 0x6E, 0x64, 0x00, 0x4D, 0x34, 0x41, 0x20 }; FrameFlagSet ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); test = new UserDefinedFrame_TestClass(ffs, testArray); }
/// <summary> /// Main inheritable constructor for <see cref="elp87.TagReader.id3v2.Abstract.TextFrame"/> class. /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public TextFrame(FrameFlagSet flags, byte[] frameData) { this._flags = flags; this.SetEncoding(frameData[0]); this._frameData = new byte[frameData.Length - 1]; Array.Copy(frameData, 1, this._frameData, 0, frameData.Length - 1); }
public Abstract_PositionFrameTest() { ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); byte01_15_slash = new byte[] { 0x00, 0x30, 0x31, 0x2F, 0x31, 0x35 }; byte1_07_dot = new byte[] { 0x00, 0x31, 0x2E, 0x30, 0x37 }; byte01 = new byte[] { 0x00, 0x30, 0x31 }; }
/// <summary> /// Main inheritable constructor for <see cref="elp87.TagReader.id3v2.Abstract.SlashNumericStringFrame"/> class. /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public SlashNumericStringFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { this._number = -1; this._totalNumber = -1; this._numericString = this.GetString(this._frameData); this.ParseNumericString(this._numericString); }
public Abstract_FrameTest() { ffs_00_00 = new FrameFlagSet(new byte[] { 0x00, 0x00 }); frame_00_00 = new Frame_TestClass(ffs_00_00, new byte[] { 0x00 }); ffs_70_4F = new FrameFlagSet(new byte[] { 0x70, 0x4F }); frame_70_4F = new Frame_TestClass(ffs_70_4F, new byte[] { 0x00 }); }
/// <summary> /// Initializes a new instance of <see cref="elp87.TagReader.id3v2.Frames.ContentTypeFrame"/> and read frame data /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public ContentTypeFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { this.InitGenreDictionary(); for (int i = 0; i < _values.Length; i++) { _values[i] = ParseGenre(_values[i]); } }
public Abstract_TextInfoFrameTest() { FrameFlagSet ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); frames = new TextInfoFrame[] { new TextInfoFrame(ffs, new byte[] { 0x00, 0x5A, 0x61, 0x7A }), new TextInfoFrame(ffs, new byte[] { 0x03, 0x73, 0x54, 0x6F, 0x61 }), new TextInfoFrame(ffs, new byte[] { 0x03, 0xD0, 0x98, 0xD0, 0xBD, 0xD1, 0x82, 0xD1, 0x80, 0xD0, 0xBE }) }; }
public void TestGetLang() { string expLanguage = "eng"; byte[] testArray = new byte[] { 0x00, 0x65, 0x6E, 0x67, 0x00 }; FrameFlagSet ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); LanguageTextFrame_TestClass test = new LanguageTextFrame_TestClass(ffs, testArray); Assert.AreEqual(expLanguage, test.Language); }
public void TestYYYYMMDD() { FrameFlagSet ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); byte[] data = new byte[] { 0x00, 0x32, 0x30, 0x31, 0x30, 0x2D, 0x30, 0x31, 0x2D, 0x30, 0x31 }; DateInfoFrame test = new DateInfoFrame(ffs, data); }
/// <summary> /// Initializes a new instance of <see cref="elp87.TagReader.id3v2.Frames.UnsunchTextFrame"/> and read frame data /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public UnsunchTextFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { this._frameBody = this.ReadFrameBody(); int terminatorPosition = this.ParseTerminatorPos(this._frameBody); byte[] descArray = new byte[terminatorPosition]; byte[] lyricArray = new byte[this._frameBody.Length - terminatorPosition - 1]; Array.Copy(this._frameBody, descArray, terminatorPosition); Array.Copy(this._frameBody, terminatorPosition + 1, lyricArray, 0, lyricArray.Length); this._description = this.GetString(descArray); this._textValue = this.GetString(lyricArray); }
public void TestFrameWithBOM() { string expDescription = "catalog"; string expValue = "0602517737280"; FrameFlagSet ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); byte[] testArray = new byte[] { 0x01, 0xFF, 0xFE, 0x63, 0x00, 0x61, 0x00, 0x74, 0x00, 0x61, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x67, 0x00, 0x00, 0x00, 0xFF, 0xFE, 0x30, 0x00, 0x36, 0x00, 0x30, 0x00, 0x32, 0x00, 0x35, 0x00, 0x31, 0x00, 0x37, 0x00, 0x37, 0x00, 0x33, 0x00, 0x37, 0x00, 0x32, 0x00, 0x38, 0x00, 0x30, 0x00 }; UserDefinedTextFrame test = new UserDefinedTextFrame(ffs, testArray); Assert.AreEqual(expDescription, test.Description); Assert.AreEqual(expValue, test.Value); }
public void TestFrame() { string expDescription = "major_brand"; string expValue = "M4A "; FrameFlagSet ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); byte[] testArray = new byte[] { 0x00, 0x6D, 0x61, 0x6A, 0x6F, 0x72, 0x5F, 0x62, 0x72, 0x61, 0x6E, 0x64, 0x00, 0x4D, 0x34, 0x41, 0x20 }; UserDefinedTextFrame test = new UserDefinedTextFrame(ffs, testArray); Assert.AreEqual(expDescription, test.Description); Assert.AreEqual(expValue, test.Value); }
/// <summary> /// Initializes a new instance of <see cref="elp87.TagReader.id3v2.Frames.AttachedPictureFrame"/> and read frame data /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public AttachedPictureFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { int mimeTerminatorPos = Array.IndexOf(this._frameData, ByteArray.Terminator); this._mimeType = this.ReadMimeType(mimeTerminatorPos); this._picType = this._frameData[mimeTerminatorPos + 1]; int descTerminatorPos = this.ReadDescTerminatorPos(mimeTerminatorPos); this._description = this.ReadDescription(mimeTerminatorPos, descTerminatorPos); this.ReadPictureData(descTerminatorPos); }
public void TestUrlFrame() { string expValue = @"http://www.jamendo.com"; FrameFlagSet ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); byte[] data = new byte[] { 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x77, 0x77, 0x77, 0x2E, 0x6A, 0x61, 0x6D, 0x65, 0x6E, 0x64, 0x6F, 0x2E, 0x63, 0x6F, 0x6D }; UrlFrame test = new UrlFrame(ffs, data); Assert.AreEqual(expValue, test.Link); }
public Abstract_OwnerIDFrameTest() { FrameFlagSet ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); testArray = new byte[] { 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x77, 0x77, 0x77, 0x2E, 0x63, 0x64, 0x64, 0x62, 0x2E, 0x63, 0x6F, 0x6D, 0x2F, 0x69, 0x64, 0x33, 0x2F, 0x74, 0x61, 0x67, 0x69, 0x6E, 0x66, 0x6F, 0x31, 0x2E, 0x68, 0x74, 0x6D, 0x6C, 0x00, 0x33, 0x43, 0x44, 0x33, 0x4E, 0x39, 0x33, 0x51, 0x32, 0x36, 0x39, 0x33, 0x36, 0x35, 0x39, 0x33, 0x32, 0x55, 0x32, 0x31, 0x38, 0x35, 0x43, 0x34, 0x43, 0x41, 0x31, 0x34, 0x44, 0x35, 0x43, 0x44, 0x32, 0x32, 0x39, 0x46, 0x38, 0x38, 0x37, 0x37, 0x32, 0x36, 0x42, 0x30, 0x31, 0x31, 0x36, 0x44, 0x38, 0x42, 0x38, 0x42, 0x42, 0x50, 0x32 }; test = new OwnerIDFrame_TestClass(ffs, testArray); }
public void TestUserDefinedUrlFrame() { string expDescription = ""; string expValue = @"http://www.mono-jpn.com"; FrameFlagSet ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); byte[] data = new byte[] { 0x00, 0x00, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x77, 0x77, 0x77, 0x2E, 0x6D, 0x6F, 0x6E, 0x6F, 0x2D, 0x6A, 0x70, 0x6E, 0x2E, 0x63, 0x6F, 0x6D }; UserDefinedUrlFrame test = new UserDefinedUrlFrame(ffs, data); Assert.AreEqual(expDescription, test.Description); Assert.AreEqual(expValue, test.Value); }
/// <summary> /// Read standart frame data and add information to "person-role" array. /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="byteArray">Byte array that contains frame data excluding frame header and header extra data.</param> public void AddData(FrameFlagSet flags, byte[] byteArray) { if (this._itemStarted == false) { this._persons = this.AddNewElementToPersons(this._persons); PersonListItemFrame roleItem = new PersonListItemFrame(flags, byteArray); string role = roleItem.GetString(); this._persons[this._persons.Length - 1].role = role; this._itemStarted = true; } else { PersonListItemFrame personItem = new PersonListItemFrame(flags, byteArray); string person = personItem.GetString(); this._persons[this._persons.Length - 1].person = person; this._itemStarted = false; } }
public Frame_TestClass(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { }
public void TestNotUsableFlagException() { FrameFlagSet ffs_01_00 = new FrameFlagSet(new byte[] { 0x01, 0x00 }); }
/// <summary> /// Initializes a new instance of <see cref="elp87.TagReader.id3v2.Frames.UniqueFileIdentifierFrame"/> and read frame data /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public UniqueFileIdentifierFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { this._data = ReadData(frameData, _terminatorPos); }
/// <summary> /// Main inheritable constructor for <see cref="elp87.TagReader.id3v2.Abstract.LanguageTextFrame"/> class. /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public LanguageTextFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { this._language = this.GetLanguage(); }
/// <summary> /// Initializes a new instance of <see cref="elp87.TagReader.id3v2.Frames.PrivateFrame"/> and read frame data /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public PrivateFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { this._data = this.ReadData(frameData, _terminatorPos); }
/// <summary> /// Main inheritable constructor for <see cref="elp87.TagReader.id3v2.Abstract.UserDefinedFrame"/> class. /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public UserDefinedFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { this.ParseFrame(this._frameData); }
/// <summary> /// Initializes a new instance of <see cref="elp87.TagReader.id3v2.Frames.PersonListTextFrame.PersonListItemFrame"/> and read frame data. /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public PersonListItemFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { }
/// <summary> /// Initializes a new instance of <see cref="elp87.TagReader.id3v2.Frames.NumericStringFrame"/> and read frame data /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public NumericStringFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { this.ParseNumericString(); }
/// <summary> /// Initializes a new instance of <see cref="elp87.TagReader.id3v2.Frames.MusicIdFrame"/> and read frame data /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public MusicIdFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { }
public Frames_UfidFrameTest() { ffs = new FrameFlagSet(new byte[] { 0x00, 0x00 }); }
/// <summary> /// Initializes a new instance of <see cref="elp87.TagReader.id3v2.Frames.UserDefinedUrlFrame"/> and read frame data /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public UserDefinedUrlFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { }
/// <summary> /// Main inheritable constructor for <see cref="elp87.TagReader.id3v2.Abstract.OwnerIDFrame"/> class. /// </summary> /// <param name="flags">Flag fields of current frame.</param> /// <param name="frameData">Byte array that contains frame data excluding frame header and header extra data.</param> public OwnerIDFrame(FrameFlagSet flags, byte[] frameData) : base(flags, frameData) { this.ParseFrame(frameData); }