Пример #1
0
        private ByteVector RenderCommentsFields()
        {
            ByteVector vector = new ByteVector();

            vector.Add((byte)TextEncoding);
            vector.Add(Language);
            vector.Add(ByteVector.FromString(description, TextEncoding));
            vector.Add(TextDelimiter(TextEncoding));
            vector.Add(ByteVector.FromString(text, TextEncoding));

            return(vector);
        }
        private ByteVector RenderAttachedPictureFields()
        {
            ByteVector data = new ByteVector();

            data.Add((byte)TextEncoding);
            data.Add(ByteVector.FromString(MimeType, TextEncoding));
            data.Add(TextDelimiter(StringType.Latin1));
            data.Add((byte)type);
            data.Add(ByteVector.FromString(Description, TextEncoding));
            data.Add(TextDelimiter(TextEncoding));
            data.Add(this.data);

            return(data);
        }
Пример #3
0
        public ByteVector Render(bool addFramingBit)
        {
            ByteVector data = new ByteVector();

            // Add the vendor ID length and the vendor ID.  It'field important to use the
            // lenght of the data(String::UTF8) rather than the lenght of the the string
            // since this is UTF8 type and there may be more characters in the data than
            // in the UTF16 string.

            ByteVector vendorData = ByteVector.FromString(vendorId, StringType.UTF8);

            data.Add(ByteVector.FromUInt((uint)vendorData.Count, false));
            data.Add(vendorData);

            // Add the number of fields.

            data.Add(ByteVector.FromUInt(FieldCount, false));

            // Iterate over the the field lists.  Our iterator returns a
            // std::pair<String, StringList> where the first String is the field name and
            // the StringList is the values associated with that field.

            foreach (System.Collections.Generic.KeyValuePair <string, StringCollection> entry in fieldList)             //(DictionaryEntry entry in fieldList)
            {
                // And now iterate over the values of the current text.

                string           fieldName = entry.Key;       //(string)entry.Key;
                StringCollection values    = entry.Value;     //(StringList)entry.Value;

                foreach (string value in values)
                {
                    ByteVector fieldData = ByteVector.FromString(fieldName, StringType.UTF8);
                    fieldData.Add((byte)'=');
                    fieldData.Add(ByteVector.FromString(value, StringType.UTF8));

                    data.Add(ByteVector.FromUInt((uint)fieldData.Count, false));
                    data.Add(fieldData);
                }
            }

            // Append the "framing bit".
            if (addFramingBit)
            {
                data.Add((byte)1);
            }

            return(data);
        }
Пример #4
0
        private ByteVector RenderRelativeVolumeFields()
        {
            ByteVector data = new ByteVector();

            data.Add(ByteVector.FromString(identification, StringType.Latin1));
            data.Add(TextDelimiter(StringType.Latin1));

            foreach (ChannelData channel in channels.Values)
            {
                data.Add((byte)channel.ChannelType);
                data.Add(ByteVector.FromShort(channel.VolumeAdjustment));
                data.Add(RenderPeakVolume(channel.PeakVolume));
            }

            return(data);
        }
Пример #5
0
        // Set the data with the given box type, strings, and flags.
        public void SetText(ByteVector type, string[] text)
        {
            // Remove empty data and return.
            if (text == null)
            {
                listBox.RemoveChildren(FixId(type));
                return;
            }

            // Create a text...
            ByteVectorCollection data = new ByteVectorCollection();

            // and populate it with the ByteVectorized strings.
            foreach (string value in text)
            {
                data.Add(ByteVector.FromString(value, StringType.UTF8));
            }

            // Send our final byte vectors to SetData
            SetData(type, data, (uint)Mpeg4ContentType.ContainsText);
        }
Пример #6
0
 public virtual ByteVector Render(string value)
 {
     return(ByteVector.FromString(value, StringType.Latin1));
 }