Пример #1
0
        public void Stop()
        {
            try
            {
                _bStopping = true;


                if (_cPLPhotoLeft.eStatus == BTL.EffectStatus.Running && 0 == _cPLPhotoLeft.nSumDuration)
                {
                    _cPLPhotoLeft.Stop();
                }
                if (_cPLPhotoRight.eStatus == BTL.EffectStatus.Running && 0 == _cPLPhotoRight.nSumDuration)
                {
                    _cPLPhotoRight.Stop();
                }

                lock (_aLoops)
                {
                    foreach (Effect cEffect in _aLoops)
                    {
                        if (cEffect.eStatus == BTL.EffectStatus.Running)
                        {
                            if (cEffect.oTag == "voting_imagesL_loop")
                            {
                                _cPLPhotoLeft.nDuration = _cPLPhotoLeft.nFrameCurrent + _nEmergencyDuration;
                                _cPLPhotoLeft.Skip(false, 0, cEffect);
                            }
                            if (cEffect.oTag == "voting_imagesR_loop")
                            {
                                _cPLPhotoRight.nDuration = _cPLPhotoRight.nFrameCurrent + _nEmergencyDuration;
                                _cPLPhotoRight.Skip(false, 0, cEffect);
                            }
                            if (cEffect.oTag == "voting_top_loop1" || cEffect.oTag == "voting_top_loop2")
                            {
                                _cPLMatTop.nDuration = _cPLMatTop.nFrameCurrent + _nEmergencyDuration;
                                _cPLMatTop.Skip(false, 0, cEffect);
                            }
                            if (cEffect.oTag == "new_votes_loop" || cEffect.oTag == "voting_mid_loop1")
                            {
                                _cPLMatMiddle.nDuration = _cPLMatMiddle.nFrameCurrent + _nEmergencyDuration;
                                _cPLMatMiddle.Skip(false, 0, cEffect);
                            }
                        }
                        else
                        {
                            ((Animation)cEffect).nLoopsQty = 10;
                        }
                    }
                }
                (new Logger()).WriteDebug("stopping");
            }
            catch (Exception ex)
            {
                (new Logger()).WriteError(ex);
            }
            if (null != Stopped)
            {
                Plugin.EventSend(Stopped, this);
            }
        }
Пример #2
0
        public void Stop()
        {
            try
            {
                if (null == _cTimerRequest)
                {
                    return;
                }
                _RollFeedStop = true;
                _cTimerRequest.Change(Timeout.Infinite, Timeout.Infinite);
                _cTimerRequest = null;
                if (_cPLBackground != null)
                {
                    _cPLBackground.Skip(false, 0);
                }
                if (_cPLMask != null)
                {
                    _cPLMask.Skip(false, 0);
                }
                if (_cPLBackground != null)
                {
                    while (_cPLBackground.eStatus != BTL.EffectStatus.Stopped)
                    {
                        Thread.Sleep(5);
                    }
                }

                _cRoll.Stop();
                (new Logger()).WriteDebug("stop");
            }
            catch (Exception ex)
            {
                (new Logger()).WriteError(ex);
            }
            if (null != Stopped)
            {
                Plugin.EventSend(Stopped, this);
            }
        }