コード例 #1
0
        override public void Prepare()
        {
            lock (_aEffects)
                try
                {
                    if (EffectStatus.Idle != ((IEffect)this).eStatus)
                    {
                        return;
                    }

                    if (stMergingMethod.eDeviceType == MergingDevice.DisCom)
                    {
                        PixelsMap.DisComInit();
                    }

                    foreach (Effect cEffect in _aEffects)
                    {
                        if (EffectStatus.Idle == cEffect.eStatus)
                        {
                            ((IVideo)cEffect).stMergingMethod = this.stMergingMethod;
                            cEffect.Prepare();
                        }
                    }

                    if (null != _cPMDuo && stArea != _cPMDuo.cFirst.stArea)
                    {
                        Baetylus.PixelsMapDispose(_cPMDuo, true);
                        _cPMDuo = null;
                    }
                    if (null == _cPMDuo)
                    {
                        _cPMDuo = new PixelsMap.Triple(this.stMergingMethod, this.stArea, PixelsMap.Format.ARGB32, true, Baetylus.PixelsMapDispose);
                        if (1 > _cPMDuo.cFirst.nLength)
                        {
                            (new Logger()).WriteNotice("1 > __cPixelsMap.nLength. composite.prepare");
                        }
                        _cPMDuo.Allocate();
                    }
                    _cPMDuo.RenewFirstTime();
                    nPixelsMapSyncIndex = byte.MaxValue;
                    base.Prepare();
                }
                catch (Exception ex)
                {
                    (new Logger()).WriteError(ex);
                }
        }
コード例 #2
0
ファイル: Transition.cs プロジェクト: ratsil/bethe.btl
        override public void Prepare()
        {
            base.Prepare();
            if (0 == nDuration)
            {
                nDuration = 1;
            }


            if (stMergingMethod.eDeviceType == MergingDevice.DisCom)
            {
                PixelsMap.DisComInit();
            }



            if (EffectStatus.Idle == _cEffectSource.eStatus || EffectStatus.Stopped == _cEffectSource.eStatus)
            {
                _cEffectSource.Prepare();
            }
            if (EffectStatus.Idle == _cEffectTarget.eStatus || EffectStatus.Stopped == _cEffectTarget.eStatus)
            {
                _cEffectTarget.Prepare();
            }

            if (_cEffectSource is IVideo && _cEffectTarget is IVideo)
            {
                stArea = SumOfAreas(((IVideo)_cEffectSource).stArea, ((IVideo)_cEffectTarget).stArea);
                if (null != _cPMDuo && stArea != _cPMDuo.cFirst.stArea)
                {
                    Baetylus.PixelsMapDispose(_cPMDuo, true);
                    _cPMDuo = null;
                }
                if (null == _cPMDuo)
                {
                    //_cPixelsMap = new PixelsMap(stMergingMethod, stArea, PixelsMap.Format.ARGB32);
                    _cPMDuo = new PixelsMap.Triple(new MergingMethod(stMergingMethod.eDeviceType, 0), stArea, PixelsMap.Format.ARGB32, true, Baetylus.PixelsMapDispose);  //MergingDevice.DisCom
                    if (1 > _cPMDuo.cFirst.nLength)
                    {
                        (new Logger()).WriteNotice("1 > _cPixelsMap.nLength. transition.prepare");
                    }
                    _cPMDuo.Allocate();
                }
                _cPMDuo.RenewFirstTime();
                nPixelsMapSyncIndex = byte.MaxValue;
            }
        }