Beispiel #1
0
/*
        internal static RawFrame CreateV4Frame(string frameID, FrameOptions flags, byte[] payload)
        {
            var f = new RawFrameV4(frameID, flags, payload);
            return f;
        }
*/

        internal static RawFrame CreateFrame(string frameId, FrameOptions options, IList<byte> payload,
                                             TagVersion version)
        {
            RawFrame frame;
            switch (version)
            {
                case TagVersion.Id3V23:
                    frame = new RawFrameV3(frameId, options, payload);
                    break;
                case TagVersion.Id3V24:
                    frame = new RawFrameV4(frameId, options, payload);
                    break;
                default:
                    throw new Id3TagException("Unknown Tag Version found!");
            }

            return frame;
        }
        public void ImportTest()
        {
            var payload = new byte[] {0x30, 0x31, 0x32, 0x33};
            var flags = new FrameOptions();
            var rawFrame = new RawFrameV3("ABCD", flags, payload);

            var frame = new UnknownFrame();
            frame.Import(rawFrame, 0);

            Assert.AreEqual("ABCD", frame.Descriptor.Id);
            Assert.That(frame.Content, Is.EquivalentTo(payload));
        }
Beispiel #3
0
 internal static RawFrame CreateV3Frame(string frameId, byte[] flags, byte[] payload)
 {
     var f = new RawFrameV3(frameId, flags, payload);
     return f;
 }