Пример #1
0
        public override bool OnInitialize()
        {
            if (_name == null && _origPath != null)
            {
                _name = Path.GetFileNameWithoutExtension(_origPath);
            }

            base.OnInitialize();

            hdr   = Header->_header;
            cmp   = Header->_frameCompInfo;
            audio = Header->_audioInfo;
            video = Header->_videoInfo;

            _componentTypes = new List <byte>();

            for (int i = 0; i < Header->_frameCompInfo._numComponents; i++)
            {
                _componentTypes.Add(Header->_frameCompInfo._frameComp[i]);
            }

            uint    size = Header->_header._firstFrameSize;
            VoidPtr addr = Header->_header.FirstFrame;

            _frames = new THPFrame[NumFrames];
            for (int i = 0; i < NumFrames; i++)
            {
                _frames[i] = new THPFrame(addr, size, this);
                addr      += size;
                size       = _frames[i].Header->_frameSizeNext;
            }

            if (_componentTypes.Count > 1)
            {
                _audio = new THPStream(this);
            }
            else
            {
                _audio = null;
            }

            return(false);
        }
Пример #2
0
        public override bool OnInitialize()
        {
            if ((_name == null) && (_origPath != null))
                _name = Path.GetFileNameWithoutExtension(_origPath);

            base.OnInitialize();

            hdr = Header->_header;
            cmp = Header->_frameCompInfo;
            audio = Header->_audioInfo;
            video = Header->_videoInfo;

            _componentTypes = new List<byte>();

            for (int i = 0; i < Header->_frameCompInfo._numComponents; i++)
                _componentTypes.Add(Header->_frameCompInfo._frameComp[i]);

            uint size = Header->_header._firstFrameSize;
            VoidPtr addr = Header->_header.FirstFrame;
            _frames = new THPFrame[NumFrames];
            for (int i = 0; i < NumFrames; i++)
            {
                _frames[i] = new THPFrame(addr, size, this);
                addr += size;
                size = _frames[i].Header->_frameSizeNext;
            }

            if (_componentTypes.Count > 1)
                _audio = new THPStream(this);
            else
                _audio = null;

            return false;
        }