示例#1
0
 private void _cPlaylist_EffectStopped(Effect cSender, Effect cEffect)
 {
     try
     {
         (new Logger()).WriteDebug("eff_stopped_in");
         hrc.plugins.PlaylistItem cPLI = _ahVideoBinds[(Video)cEffect];
         cPLI.oStatus = StatusGet("played");
         cPLI.Save(_cDBI);
         (new Logger()).WriteDebug("status 'played' saved:[id=" + cPLI.nID + "][name=" + cPLI.oAsset.sName + "]");
     }
     catch (Exception ex)
     {
         (new Logger()).WriteError(ex);
     }
 }
示例#2
0
        public void Prepare()
        {
            try
            {
                (new Logger()).WriteDebug2("prepare_in");
                _cDBI       = new DBInteract();
                _cPLCurrent = null;
                _nPLID      = _cDBI.TryToGetIDFromCommands();
                (new Logger()).WriteDebug2("pl_id=" + _nPLID);
                _ahVideoBinds = new Dictionary <Video, helpers.replica.cues.plugins.PlaylistItem>();

                _cPlaylist                 = new btl.Playlist();
                _cPlaylist.stArea          = _cPreferences.stArea;
                _cPlaylist.stMergingMethod = _cPreferences.stMerging;
                _cPlaylist.nLayer          = _cPreferences.nLayer;
                _cPlaylist.bOpacity        = false;
                _cPlaylist.bStopOnEmpty    = true;
                _cPlaylist.aChannelsAudio  = new byte[] { 0, 1 };
                _cPlaylist.EffectStarted  += _cPlaylist_EffectStarted;
                _cPlaylist.EffectStopped  += _cPlaylist_EffectStopped;
                _cPlaylist.EffectFailed   += _cPlaylist_EffectFailed;
                _cPlaylist.Stopped        += _cPlaylist_Stopped;
                _cPlaylist.Prepare();


                Video cVideo;
                _cPLCurrent = _cDBI.AdvancedPlaylistGet(_nPLID > 0 ? _nPLID : _cPreferences.nPlaylistID);
                (new Logger()).WriteDebug2("pl_id=" + (_nPLID > 0 ? _nPLID : _cPreferences.nPlaylistID));
                helpers.replica.cues.plugins.PlaylistItem cPLI = _cPLCurrent.aItems[0];
                cVideo           = new Video(cPLI.oAsset.cFile.sFile);
                cVideo.nDuration = (ulong)(cPLI.nFramesQty == long.MaxValue || cPLI.nFramesQty < 1 ? cPLI.oAsset.nFramesQty : cPLI.nFramesQty);
                cVideo.Prepare();
                _cPlaylist.VideoAdd(cVideo);
                _ahVideoBinds.Add(cVideo, cPLI);

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