public void Init() { Animation cBadgeIn = new Animation(_cPreferences.sBadgeIn, 1, false); if (0 == _cPreferences.stBadgeSize.Width) _cPreferences.stBadgeSize.Width = (int)cBadgeIn.stArea.nWidth; if (0 == _cPreferences.stBadgeSize.Height) _cPreferences.stBadgeSize.Height = (int)cBadgeIn.stArea.nHeight; _cPlaylistBadge = new Playlist(); _cPlaylistBadge.nLayer = _cPreferences.nBadgeLayer; _cPlaylistBadge.bStopOnEmpty = true; _cPlaylistBadge.OnPlaylistIsEmpty += OnPlaylistIsEmpty; _cPlaylistBadge.stArea = new Area(_cPreferences.stBadgeSize); _cPlaylistBadge.EffectAdd(cBadgeIn, 0); _cPlaylistBadge.EffectAdd(new Animation(_cPreferences.sBadgeLoop, 0, true), 0); _cPlaylistBadge.EffectAdd(new Animation(_cPreferences.sBadgeOut, 1, false), 0); _cPlaylistBadge.Prepare(); _cShowLoop = new Animation(_cPreferences.sShowLoop, 0, true); if (0 == _cPreferences.stShowSize.Width) _cPreferences.stShowSize.Width = (int)_cShowLoop.stArea.nWidth; if (0 == _cPreferences.stShowSize.Height) _cPreferences.stShowSize.Height = (int)_cShowLoop.stArea.nHeight; _cShowOut = new Animation(_cPreferences.sShowOut, 1, false); _cShowTransition = new Animation(_cPreferences.sShowTransition, 1, true); _cStandbyLoop = new Animation(_cPreferences.sStandbyLoop, 0, true); _cStandbyTransition = new Animation(_cPreferences.sStandbyTransition, 1, true); _cStandbyOut = new Animation(_cPreferences.sStandbyOut, 1, false); _cMatOut = new Animation(_cPreferences.sOut, 1, false); _cMatOut.stArea = new Area(_cPreferences.stOutSize); _cMatOut.nLayer = _cPreferences.nOutLayer; _cMatOut.Prepare(); Animation cStandbyIn = new Animation(_cPreferences.sStandbyIn, 1, false); cStandbyIn.Prepare(); _cStandbyLoop.Prepare(); _cPlaylistShow = new Playlist(); _cPlaylistShow.nLayer = _cPreferences.nShowLayer; _cPlaylistShow.bStopOnEmpty = true; _cPlaylistShow.OnPlaylistIsEmpty += OnPlaylistIsEmpty; _cPlaylistShow.stArea = new Area(_cPreferences.stShowSize); _cPlaylistShow.EffectAdd(cStandbyIn, 0); _cPlaylistShow.EffectAdd(_cStandbyLoop, 0); _cPlaylistShow.Prepare(); _cStandbyOut.Prepare(); _cShowOut.Prepare(); _cStandbyTransition.Prepare(); _cShowTransition.Prepare(); }
public void Prepare() { try { //PixelsMap.DisComInit(); _cRoll = new btl.Roll(); _cRoll.eDirection = _cPreferences.eDirection; _cRoll.nSpeed = _cPreferences.nSpeed; _cRoll.stArea = _cPreferences.stArea; _cRoll.stMergingMethod = _cPreferences.stRollMerging; _cRoll.nLayer = _cPreferences.nLayer; _cRoll.bOpacity = false; _cRoll.EffectIsOnScreen += _cRoll_EffectIsOnScreen; _nWaitAndStop = 0; if (_cPreferences.cBackground != null) { _stAreaComposite = new Area((short)(_cPreferences.stArea.nLeft - _cPreferences.cBackground.stArea.nLeft), (short)(_cPreferences.stArea.nTop - _cPreferences.cBackground.stArea.nTop), _cPreferences.stArea.nWidth, _cPreferences.stArea.nHeight); _cRoll.stArea = _cPreferences.cBackground.stArea; _cAnimIn = new Animation(_cPreferences.cBackground.sIn, 1, false); _cAnimIn.Prepare(); _cAnimLoop = new Animation(_cPreferences.cBackground.sLoop, 0, true); _cAnimLoop.Prepare(); _cAnimOut = new Animation(_cPreferences.cBackground.sOut, 1, false); _cAnimOut.Prepare(); _cPLBackground = new Playlist(); _cPLBackground.bStopOnEmpty = true; _cPLBackground.EffectAdd(_cAnimIn); _cPLBackground.EffectAdd(_cAnimLoop); _cPLBackground.EffectAdd(_cAnimOut); _cPLBackground.Prepare(); if (_cPreferences.cBackground.sMaskIn != null && _cPreferences.cBackground.sMaskIn.Length > 0) { _cMaskIn = new Animation(_cPreferences.cBackground.sMaskIn, 1, false); _cMaskIn.Prepare(); _cMaskLoop = new Animation(_cPreferences.cBackground.sMaskLoop, 0, true); _cMaskLoop.Prepare(); _cMaskOut = new Animation(_cPreferences.cBackground.sMaskOut, 1, false); _cMaskOut.Prepare(); _cMaskAllOff = new Animation(_cPreferences.cBackground.sMaskAllOff, 0, true); _cMaskAllOff.Prepare(); _cPLMask = new Playlist(); _cPLMask.bStopOnEmpty = false; _cPLMask.EffectAdd(_cMaskIn); _cPLMask.EffectAdd(_cMaskLoop); _cPLMask.EffectAdd(_cMaskOut); _cPLMask.EffectAdd(_cMaskAllOff); _cPLMask.Prepare(); } } else { _stAreaComposite = new Area(0, 0, _cPreferences.stArea.nWidth, _cPreferences.stArea.nHeight); } _cRoll.Prepare(); _aItems = new List <Item>(); _cTimerRequest = new System.Threading.Timer(TickRequest); TickRequest(null); _cRollFeed = new Thread(RollFeed); _cRollFeed.IsBackground = true; _cRollFeed.Start(); _cTimerStop = new System.Threading.Timer(AsyncStop); if (null != Prepared) { Plugin.EventSend(Prepared, this); } (new Logger()).WriteDebug3("ok"); } catch (Exception ex) { (new Logger()).WriteError(ex); } }