Inheritance: Achamenes.ID3.Frames.Frame
Beispiel #1
0
        public override void WriteToStream(System.IO.Stream stream)
        {
            LastPlayedOnFrame frame  = (LastPlayedOnFrame)this.FrameToWrite;
            List <Field>      fields = new List <Field>();

            // Declare the fields to write.
            fields.Add(new SingleByteField((byte)this.Encoding));  //Encoding identifier byte
            fields.Add(TextField.CreateTextField(frame.LastPlayedOn.ToShortDateString(),
                                                 EncodingScheme.Ascii));
            fields.Add(TextField.CreateTextField(frame.PlayCount.ToString(),
                                                 EncodingScheme.Ascii));
            fields.Add(TextField.CreateTextField(frame.Memo, this.Encoding));

            // Calculate the length and write the header
            int length = 0;

            foreach (Field f in fields)
            {
                length += f.Length;
            }
            HeaderWriter.WriteHeader(stream, new FrameHeader(this.FrameID, length));

            // Write the fields
            foreach (Field f in fields)
            {
                f.WriteToStream(stream);
            }
        }
Beispiel #2
0
 public LastPlayedOnFrameWriter(
     LastPlayedOnFrame frameToWrite,
     FrameHeaderWriter frameHeaderWriter,
     string frameID,
     EncodingScheme encoding)
     : base(frameToWrite, frameHeaderWriter, frameID, encoding)
 {
 }
Beispiel #3
0
        public override FrameParser CreateFrameParser(ID3v2MajorVersion version, string frameID)
        {
            FrameParser parser = LastPlayedOnFrame.CreateParser(version, frameID);

            if (parser == null)
            {
                return(base.CreateFrameParser(version, frameID));
            }
            return(parser);
        }
Beispiel #4
0
 public LastPlayedOnFrameWriter(
     LastPlayedOnFrame	frameToWrite,
     FrameHeaderWriter	frameHeaderWriter,
     string				frameID,
     EncodingScheme		encoding)
     : base(frameToWrite, frameHeaderWriter, frameID, encoding)
 {
 }