public void Start() { try { (new Logger()).WriteDebug("start_in"); bool bFirst = true; foreach (hrc.plugins.PlaylistItem cPLI in _cPLCurrent.aItems) { if (bFirst) { bFirst = false; _cPlaylist.Start(); // first pli was added in prepare! continue; } Video cVideo; cVideo = new Video(cPLI.oAsset.cFile.sFile); cVideo.nDuration = (ulong)(cPLI.nFramesQty == long.MaxValue || cPLI.nFramesQty < 1 ? cPLI.oAsset.nFramesQty : cPLI.nFramesQty); _cPlaylist.VideoAdd(cVideo); _ahVideoBinds.Add(cVideo, cPLI); } if (null != Started) { Plugin.EventSend(Started, this); } (new Logger()).WriteDebug("started"); } catch (Exception ex) { (new Logger()).WriteError(ex); Stop(); } }
public void PreparePlaylists() { _bBlenderDidNewVotes = false; _bBlenderIsPreparing = false; _cPLMatTop = new btl.Playlist() { bCUDA = _cPreferences.bCUDA, nLayer = _cPreferences.nLayer, nDelay = 0, cDock = new Dock(_cPreferences.nLeft, (short)(_cPreferences.nTop + 67)), bStopOnEmpty = true, bOpacity = false }; _cPLMatMiddle = new btl.Playlist() { bCUDA = _cPreferences.bCUDA, nLayer = _cPreferences.nLayer, nDelay = 34, cDock = new Dock((short)(_cPreferences.nLeft + 186), (short)(_cPreferences.nTop + 87)), bStopOnEmpty = true, bOpacity = false }; _cPLMatBottom = new btl.Playlist() { bCUDA = _cPreferences.bCUDA, nLayer = _cPreferences.nLayer, nDelay = 22, cDock = new Dock(_cPreferences.nLeft, (short)(_cPreferences.nTop + 87)), bStopOnEmpty = true, bOpacity = false }; _cPLPhotoLeft = new btl.Playlist() { bCUDA = _cPreferences.bCUDA, nLayer = _cPreferences.nLayer, nDelay = 50, cDock = new Dock(_cPreferences.nLeft, _cPreferences.nTop), bStopOnEmpty = false, bOpacity = false }; _cPLPhotoRight = new btl.Playlist() { bCUDA = _cPreferences.bCUDA, nLayer = _cPreferences.nLayer, nDelay = 50, cDock = new Dock((short)(_cPreferences.nLeft + 253), _cPreferences.nTop), bStopOnEmpty = false, bOpacity = false }; Animation cLoop; _cPLMatTop.AnimationAdd(new Animation(Path.Combine(_cPreferences.sFolderMat, "voting_top_in")) { bCUDA = _cPreferences.bCUDA, bKeepAlive = false, bOpacity = false, nLoopsQty = 1 }, 0); cLoop = new Animation(Path.Combine(_cPreferences.sFolderMat, "voting_top_loop1")) { bCUDA = _cPreferences.bCUDA, bKeepAlive = true, bOpacity = false, nLoopsQty = _nLoopTop, oTag = "voting_top_loop1" }; lock (_aLoops) _aLoops.Add(cLoop); _cPLMatTop.AnimationAdd(cLoop, 0); _cPLMatTop.EffectStarted += new ContainerVideoAudio.EventDelegate(_cPLMatTop_EffectStarted); _cPLMatTop.EffectStopped += new ContainerVideoAudio.EventDelegate(RemoveOnStopped); _cPLMatBottom.AnimationAdd(new Animation(Path.Combine(_cPreferences.sFolderMat, "voting_bot_in")) { bCUDA = _cPreferences.bCUDA, bKeepAlive = false, bOpacity = false, nLoopsQty = 1 }, 0); _cPLMatBottom.AnimationAdd(new Animation(Path.Combine(_cPreferences.sFolderMat, "voting_bot_loop")) { bCUDA = _cPreferences.bCUDA, bKeepAlive = true, bOpacity = false, nLoopsQty = 0 }, 0); _cPLMatMiddle.AnimationAdd(new Animation(Path.Combine(_cPreferences.sFolderVotes, "voting_mid_in")) { bCUDA = _cPreferences.bCUDA, bKeepAlive = false, bOpacity = false, nLoopsQty = 1 }, 0); cLoop = new Animation(Path.Combine(_cPreferences.sFolderVotes, "voting_mid_loop1")) { bCUDA = _cPreferences.bCUDA, bKeepAlive = true, bOpacity = false, nLoopsQty = _nLoopMid, oTag = "voting_mid_loop1" }; _cPLMatMiddle.AnimationAdd(cLoop, 0); lock (_aLoops) _aLoops.Add(cLoop); _cPLMatMiddle.EffectStarted += new ContainerVideoAudio.EventDelegate(_cPLMatMiddle_EffectStarted); _cPLMatMiddle.EffectStopped += new ContainerVideoAudio.EventDelegate(RemoveOnStopped); _cPLMatTop.Stopped += new Effect.EventDelegate(PL_Stopped); _cPLMatBottom.Stopped += new Effect.EventDelegate(PL_Stopped); _cPLMatMiddle.Stopped += new Effect.EventDelegate(PL_Stopped); _cPLPhotoLeft.Stopped += new Effect.EventDelegate(PL_Stopped); _cPLPhotoRight.Stopped += new Effect.EventDelegate(PL_Stopped); _cPLPhotoLeft.EffectStopped += new ContainerVideoAudio.EventDelegate(RemoveOnStopped); _cPLPhotoRight.EffectStopped += new ContainerVideoAudio.EventDelegate(RemoveOnStopped); _cPLMatTop.Prepare(); _cPLMatBottom.Prepare(); _cPLMatMiddle.Prepare(); _cPLPhotoLeft.Prepare(); _cPLPhotoRight.Prepare(); _cPLPhotoLeft.Start(); _cPLPhotoRight.Start(); (new Logger()).WriteDebug3("ok"); }
public void PreparePlaylists() { _bBlenderDidNewVotes = false; _bBlenderIsPreparing = false; _cPLMatTop = new btl.Playlist() { stMergingMethod = _cPreferences.stMerging, nLayer = _cPreferences.nLayer, nDelay = 0, cDock = new Dock(_cPreferences.nLeft, (short)(_cPreferences.nTop + 67)), bStopOnEmpty = true, bOpacity = false }; _cPLMatMiddle = new btl.Playlist() { stMergingMethod = _cPreferences.stMerging, nLayer = _cPreferences.nLayer, nDelay = 34, cDock = new Dock((short)(_cPreferences.nLeft + 186), (short)(_cPreferences.nTop + 87)), bStopOnEmpty = true, bOpacity = false }; _cPLMatBottom = new btl.Playlist() { stMergingMethod = _cPreferences.stMerging, nLayer = _cPreferences.nLayer, nDelay = 22, cDock = new Dock(_cPreferences.nLeft, (short)(_cPreferences.nTop + 87)), bStopOnEmpty = true, bOpacity = false }; _cPLPhotoLeft = new btl.Playlist() { stMergingMethod = _cPreferences.stMerging, nLayer = _cPreferences.nLayer, nDelay = 50, cDock = new Dock(_cPreferences.nLeft, _cPreferences.nTop), bStopOnEmpty = false, bOpacity = false }; _cPLPhotoRight = new btl.Playlist() { stMergingMethod = _cPreferences.stMerging, nLayer = _cPreferences.nLayer, nDelay = 50, cDock = new Dock((short)(_cPreferences.nLeft + 253), _cPreferences.nTop), bStopOnEmpty = false, bOpacity = false }; Animation cLoop; _cPLMatTop.AnimationAdd(new Animation(Path.Combine(_cPreferences.sFolderMat, "voting_top_in")) { stMergingMethod = _cPreferences.stMerging, bKeepAlive = false, bOpacity = false, nLoopsQty = 1 }, 0); cLoop = new Animation(Path.Combine(_cPreferences.sFolderMat, "voting_top_loop1")) { stMergingMethod = _cPreferences.stMerging, bKeepAlive = true, bOpacity = false, nLoopsQty = _nLoopTop, oTag = "voting_top_loop1" }; lock (_aLoops) _aLoops.Add(cLoop); _cPLMatTop.AnimationAdd(cLoop, 0); _cPLMatTop.EffectStarted += new ContainerVideoAudio.EventDelegate(_cPLMatTop_EffectStarted); _cPLMatTop.EffectStopped += new ContainerVideoAudio.EventDelegate(RemoveOnStopped); _cPLMatBottom.AnimationAdd(new Animation(Path.Combine(_cPreferences.sFolderMat, "voting_bot_in")) { stMergingMethod = _cPreferences.stMerging, bKeepAlive = false, bOpacity = false, nLoopsQty = 1 }, 0); _cPLMatBottom.AnimationAdd(new Animation(Path.Combine(_cPreferences.sFolderMat, "voting_bot_loop")) { stMergingMethod = _cPreferences.stMerging, bKeepAlive = true, bOpacity = false, nLoopsQty = 0 }, 0); _cPLMatMiddle.AnimationAdd(new Animation(Path.Combine(_cPreferences.sFolderVotes, "voting_mid_in")) { stMergingMethod = _cPreferences.stMerging, bKeepAlive = false, bOpacity = false, nLoopsQty = 1 }, 0); cLoop = new Animation(Path.Combine(_cPreferences.sFolderVotes, "voting_mid_loop1")) { stMergingMethod = _cPreferences.stMerging, bKeepAlive = true, bOpacity = false, nLoopsQty = _nLoopMid, oTag = "voting_mid_loop1" }; _cPLMatMiddle.AnimationAdd(cLoop, 0); lock (_aLoops) _aLoops.Add(cLoop); _cPLMatMiddle.EffectStarted += new ContainerVideoAudio.EventDelegate(_cPLMatMiddle_EffectStarted); _cPLMatMiddle.EffectStopped += new ContainerVideoAudio.EventDelegate(RemoveOnStopped); _cPLMatTop.Stopped += new Effect.EventDelegate(PL_Stopped); _cPLMatBottom.Stopped += new Effect.EventDelegate(PL_Stopped); _cPLMatMiddle.Stopped += new Effect.EventDelegate(PL_Stopped); _cPLPhotoLeft.Stopped += new Effect.EventDelegate(PL_Stopped); _cPLPhotoRight.Stopped += new Effect.EventDelegate(PL_Stopped); _cPLPhotoLeft.EffectStopped += new ContainerVideoAudio.EventDelegate(RemoveOnStopped); _cPLPhotoRight.EffectStopped += new ContainerVideoAudio.EventDelegate(RemoveOnStopped); _cPLMatTop.Prepare(); _cPLMatBottom.Prepare(); _cPLMatMiddle.Prepare(); _cPLPhotoLeft.Prepare(); _cPLPhotoRight.Prepare(); _cPLPhotoLeft.Start(); _cPLPhotoRight.Start(); (new Logger()).WriteDebug3("ok"); }