Ejemplo n.º 1
0
        public void Prepare()
        {
            try
            {
                //PixelsMap.DisComInit();
                lock (_oLock)
                {
                    if (_bPrepared)
                    {
                        (new Logger()).WriteWarning("Voting has already prepared!");
                        return;
                    }
                    _bPrepared = true;
                }
                (new Logger()).WriteDebug("prepare:in");

                ulong nSimulID = (ulong)_cRollImages.nID;
                _cRollImages.SimultaneousSet(nSimulID, 4);
                _cRollTop.SimultaneousSet(nSimulID, 4);
                _cRollBot.SimultaneousSet(nSimulID, 4);
                _cRollMid.SimultaneousSet(nSimulID, 4);

                _cRollImages.Prepare(38);
                _aBytesImages = _cRollImages.PreRenderedFramesGet();
                ClearRoll(_cRollImages);
                _cRollTop.Prepare(61);
                _aBytesTop = _cRollTop.PreRenderedFramesGet();
                ClearRoll(_cRollTop);
                _cRollBot.Prepare(29);
                _aBytesBot = _cRollBot.PreRenderedFramesGet();
                ClearRoll(_cRollBot);
                _cRollMid.Prepare(23);
                _aBytesMid = _cRollMid.PreRenderedFramesGet();
                ClearRoll(_cRollMid);

                AddInitFrames(50);

                _cThreadWorker = new System.Threading.Thread(WorkerUpdater);
                _cThreadWorker.IsBackground = true;
                _cThreadWorker.Priority     = System.Threading.ThreadPriority.Normal;
                _cThreadWorker.Start();

                _cThreadWorker = new System.Threading.Thread(Worker);
                _cThreadWorker.IsBackground = true;
                _cThreadWorker.Priority     = System.Threading.ThreadPriority.Normal;
                _cThreadWorker.Start();

                eStatus = BTL.EffectStatus.Preparing;
                if (null != Prepared)
                {
                    Plugin.EventSend(Prepared, this);
                }
                (new Logger()).WriteDebug("prepare:out");
            }
            catch (Exception ex)
            {
                (new Logger()).WriteError(ex);
                eStatus = BTL.EffectStatus.Error;
            }
        }
Ejemplo n.º 2
0
        public void Prepare()
        {
            try
            {
                DisCom.Init();

                _cRoll            = new Roll();
                _cRoll.eDirection = _cPreferences.eDirection;
                _cRoll.nSpeed     = _cPreferences.nSpeed;
                _cRoll.stArea     = _cPreferences.stArea;
                _cRoll.bCUDA      = _cPreferences.bRollCuda;
                _cRoll.nLayer     = _cPreferences.nLayer;
                _cRoll.bOpacity   = false;
                if (0 < _cPreferences.nPause)
                {
                    _cRoll.EffectIsOffScreen += _cRoll_EffectIsOffScreen;
                }
                _cRoll.Prepare();

                _ahItems          = new Dictionary <string, DateTime>();
                _cTimerRollResume = new System.Threading.Timer(TickRollResume);
                _cTimerRssRequest = new System.Threading.Timer(TickRssRequest);
                TickRssRequest(null);

                if (null != Prepared)
                {
                    Plugin.EventSend(Prepared, this);
                }
                (new Logger()).WriteDebug3("ok");
            }
            catch (Exception ex)
            {
                (new Logger()).WriteError(ex);
            }
        }