Beispiel #1
0
        protected override void LoadFromStream(System.IO.Stream stream)
        {
            base.LoadFromStream(stream);

            uint entryCount = stream.ReadBEUInt32();

            for (uint i = 0; i < entryCount; i++)
            {
                EditListEntry entry = new EditListEntry();
                if (Version == 1)
                {
                    entry.SegmentDuration = stream.ReadBEUInt64();
                    entry.MediaTime       = stream.ReadBEInt64();
                }
                else
                {
                    entry.SegmentDuration = stream.ReadBEUInt32();
                    entry.MediaTime       = stream.ReadBEInt32();
                }
                entry.MediaRateInteger  = stream.ReadBEInt16();
                entry.MediaRateFraction = stream.ReadBEInt16();

                _Entries.Add(entry);
            }
        }
Beispiel #2
0
        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            uint entryCount = stream.ReadBEUInt32();

            this.Entries = new EditListEntry[entryCount];

            for (uint i = 0; i < entryCount; i++)
            {
                ulong segmentDuration;
                long  mediaTime;
                short mediaRateInteger;
                short mediaRateFraction;

                if (Version == 1)
                {
                    segmentDuration = stream.ReadBEUInt64();
                    mediaTime       = stream.ReadBEInt64();
                }
                else
                {
                    segmentDuration = stream.ReadBEUInt32();
                    mediaTime       = stream.ReadBEInt32();
                }

                mediaRateInteger  = stream.ReadBEInt16();
                mediaRateFraction = stream.ReadBEInt16();

                Entries[i] = new EditListEntry(segmentDuration, mediaTime, mediaRateInteger, mediaRateFraction);
            }
        }
Beispiel #3
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEInt32(Entries.Length);

            for (int i = 0; i < Entries.Length; i++)
            {
                ref EditListEntry entry = ref Entries[i];

                if (Version == 1)
                {
                    stream.WriteBEUInt64(entry.SegmentDuration);
                    stream.WriteBEInt64(entry.MediaTime);
                }
                else
                {
                    stream.WriteBEUInt32((uint)entry.SegmentDuration);
                    stream.WriteBEInt32((int)entry.MediaTime);
                }

                stream.WriteBEInt16(entry.MediaRateInteger);
                stream.WriteBEInt16(entry.MediaRateFraction);
            }