AddComment() public method

Adds a Xiph comment to the current instance.
public AddComment ( uint streamSerialNumber, ByteVector data ) : void
streamSerialNumber uint /// A value containing the serial number /// of the stream containing the comment. ///
data ByteVector /// A object containing the raw Xiph /// comment to add to the current instance. ///
return void
Ejemplo n.º 1
0
        /// <summary>
        ///    Reads the file with a specified read style.
        /// </summary>
        /// <param name="propertiesStyle">
        ///    A <see cref="ReadStyle" /> value specifying at what level
        ///    of accuracy to read the media properties, or <see
        ///    cref="ReadStyle.None" /> to ignore the properties.
        /// </param>
        private void Read(ReadStyle propertiesStyle)
        {
            long end;
            Dictionary <uint, Bitstream> streams = ReadStreams(null,
                                                               out end);
            List <ICodec> codecs = new List <ICodec> ();

            InvariantStartPosition = end;
            InvariantEndPosition   = Length;

            foreach (uint id in streams.Keys)
            {
                tag.AddComment(id,
                               streams [id].Codec.CommentData);
                codecs.Add(streams [id].Codec);
            }

            if (propertiesStyle == ReadStyle.None)
            {
                return;
            }

            PageHeader last_header = LastPageHeader;

            TimeSpan duration = streams [last_header
                                         .StreamSerialNumber].GetDuration(
                last_header.AbsoluteGranularPosition);

            properties = new Properties(duration, codecs);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///    Reads the file with a specified read style.
        /// </summary>
        /// <param name="propertiesStyle">
        ///    A <see cref="ReadStyle" /> value specifying at what level
        ///    of accuracy to read the media properties, or <see
        ///    cref="ReadStyle.None" /> to ignore the properties.
        /// </param>
        void Read(ReadStyle propertiesStyle)
        {
            var streams = ReadStreams(null, out var end);
            var codecs  = new List <ICodec> ();

            InvariantStartPosition = end;
            InvariantEndPosition   = Length;

            foreach (uint id in streams.Keys)
            {
                tag.AddComment(id, streams[id].Codec.CommentData);
                codecs.Add(streams[id].Codec);
            }

            if ((propertiesStyle & ReadStyle.Average) == 0)
            {
                return;
            }

            var last_header = LastPageHeader;

            var duration = streams[last_header.StreamSerialNumber].GetDuration(last_header.AbsoluteGranularPosition);

            properties = new Properties(duration, codecs);
        }