Ejemplo n.º 1
0
        protected override void Parse()
        {
            BinaryReader br = new BinaryReader(_dataStream);

            this._soundclassname = SwfStrings.SwfString(this._SwfVersion, br);
            this._soundinfo = SoundInfo.Parse(_dataStream);
        }
Ejemplo n.º 2
0
        public static SoundInfo Parse(System.IO.Stream input)
        {
            BinaryReader br = new BinaryReader(input);

            BitStream bits = new BitStream(input);

            SoundInfo info = new SoundInfo();

            bool _reserved1 = bits.GetBits(1) == 1;
            bool _reserved2 = bits.GetBits(1) == 1;
            info._syncstop = bits.GetBits(1) == 1;
            info._syncnomultiple = bits.GetBits(1) == 1;
            info._hasEnvelope = bits.GetBits(1) == 1;
            info._hasLoops = bits.GetBits(1) == 1;
            info._hasOutPoint = bits.GetBits(1) == 1;
            info._hasInPoint = bits.GetBits(1) == 1;

            if (_reserved1 || _reserved2)
                throw new SwfFormatException("Reserved bits are not set to false");

            if (info._hasInPoint)
                info._inPoint = br.ReadUInt32();

            if (info._hasOutPoint)
                info._outPoint = br.ReadUInt32();

            if (info._hasLoops)
                info._loopCount = br.ReadUInt16();

            if (info._hasEnvelope)
            {
                info._envelopePoints = br.ReadByte();
                info._envelopeRecords = new SoundEnvelope[info._envelopePoints];
                for (uint i = 0; i < info._envelopePoints; i++)
                    info._envelopeRecords[i] = SoundEnvelope.Parse(br);

            }

            return info;
        }
Ejemplo n.º 3
0
        protected override void Parse()
        {
            BinaryReader br = new BinaryReader(_dataStream);

            _soundID = br.ReadUInt16();
            _soundinfo = SoundInfo.Parse(_dataStream);
        }