static void EffectVideoAudio_OnChannelSet(shared.Effect cSender, byte[] aValue) { try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effectvideoaudio:channels:set: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); ((BTL.Play.EffectVideoAudio)cEffectCover.oEffect).aChannelsAudio = aValue; } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static void PlaylistAddEffect(shared.Playlist cPL, shared.Effect cEffect, ushort nTransDur) { EffectCover cEffectCover = null; EffectCover cEffectToAdd = null; try { lock (_ahEffects) { if (_ahEffects.ContainsKey(cPL)) cEffectCover = _ahEffects[cPL]; else throw new Exception("playlist:add:effect: указанный объект плейлиста не зарегистрирован на сервере [hcPL:" + cPL.GetHashCode() + "]"); if (_ahEffects.ContainsKey(cEffect)) cEffectToAdd = _ahEffects[cEffect]; else throw new Exception("playlist:add:effect: добавляемый эффект не зарегистрирован на сервере [hcPL:" + cPL.GetHashCode() + "] [hceff:" + cEffect.GetHashCode() + "]"); } ((BTL.Play.Playlist)cEffectCover.oEffect).EffectAdd((BTL.Play.Effect)cEffectToAdd.oEffect, nTransDur); } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static void EffectVideo_OnCUDASet(shared.Effect cSender, bool nValue) { try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effect:layer:set: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); ((BTL.Play.EffectVideo)cEffectCover.oEffect).bCUDA = nValue; } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static void EffectVideo_OnAreaSet(shared.Effect cSender, helpers.Area stArea) { try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effect:area:set: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); if (helpers.Area.stEmpty != stArea) { BTL.Play.EffectVideo cEffectVideoBTL; if (cEffectCover.oEffect is BTL.Play.EffectVideoAudio) cEffectVideoBTL = (BTL.Play.EffectVideo)(BTL.Play.EffectVideoAudio)cEffectCover.oEffect; else cEffectVideoBTL = (BTL.Play.EffectVideo)cEffectCover.oEffect; cEffectVideoBTL.stArea = stArea; } } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static bool Dispose(shared.Effect cEffect) { bool bRetVal = false; try { EffectCover cEffectCover = null; lock (_ahEffects) { if (_ahEffects.ContainsKey(cEffect)) { cEffectCover = _ahEffects[cEffect]; if (null == cEffectCover) (new Logger()).WriteDebug2("effect:dispose: is null [hc:" + cEffect.GetHashCode() + "]"); } else if(_ahEffectsRemoved.ContainsKey(cEffect)) bRetVal = true; } if (null != cEffectCover) { cEffectCover.Dispose(); bRetVal = true; } else if (!bRetVal) (new Logger()).WriteNotice("dispose: указанный эффект не зарегистрирован [hc:" + cEffect.GetHashCode() + "]"); //TODO LANG // не ошибка, т.к. он просто удален в GC } catch (Exception ex) { (new Logger()).WriteError(ex); } return bRetVal; }
static void EffectVideo_OnDockSet(shared.Effect cSender, helpers.Dock cDock) { try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effect:dock:set: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); BTL.Play.EffectVideo cEffectVideoBTL; if (cEffectCover.oEffect is BTL.Play.EffectVideoAudio) cEffectVideoBTL = (BTL.Play.EffectVideo)(BTL.Play.EffectVideoAudio)cEffectCover.oEffect; else cEffectVideoBTL = (BTL.Play.EffectVideo)cEffectCover.oEffect; cEffectVideoBTL.cDock = cDock; } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static shared.Roll.Direction Roll_OnDirectionGet(shared.Roll cSender) { shared.Roll.Direction eRetVal = shared.Roll.Direction.DownToUp; try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("roll:direction:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); eRetVal = (shared.Roll.Direction) Enum.Parse(typeof(shared.Roll.Direction), ((BTL.Play.Roll)cEffectCover.oEffect).eDirection.ToString(), true); } catch (Exception ex) { (new Logger()).WriteError(ex); } return eRetVal; }
static void Effect_OnTagSet(shared.Effect cSender, object oValue) { try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effect:tag:set: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); ((BTL.Play.Effect)cEffectCover.oEffect).oTag = oValue; } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static void RollCreate(shared.Effect cSender) { (new Logger()).WriteDebug3("in [hc:" + cSender.GetHashCode() + "]"); EffectCreate(cSender); try { BTL.Play.Roll cRoll = new BTL.Play.Roll(); EffectCover cEffectCover = null; lock (_ahEffects) { _ahEffects[cSender] = new EffectCover(cRoll); cEffectCover = _ahEffects[cSender]; } cEffectCover.sType = "Roll"; cEffectCover.sInfo = "x=" + cRoll.stArea.nLeft + ", y=" + cRoll.stArea.nTop; //cRoll.cDock = cDock; //cRoll.nLayer = nZ; //cRoll.bOpacity = bOpacity; //cRoll.nDelay = nDelay; //cRoll.cTag = cSender; //EMERGENCY это что за хрень???????? Tag не использовать нигде!!!! кроме пользовательского фронтенда!!!!! } catch (Exception ex) { (new Logger()).WriteError(ex); } (new Logger()).WriteDebug4("return [hc:" + cSender.GetHashCode() + "]"); }
static int Roll_OnEffectsQtyGet(shared.Roll cSender) { int nRetVal = -1; try { EffectCover cEffectCover = EffectCoverGet(cSender); if(null == cEffectCover) throw new Exception("roll:effectsqty:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); nRetVal = ((BTL.Play.Roll)cEffectCover.oEffect).nEffectsQty; } catch (Exception ex) { (new Logger()).WriteError(ex); } return nRetVal; }
static void Playlist_OnPLItemsDelete(shared.Playlist cPL, shared.Effect[] aEffects) { try { EffectCover cEffectCover = null; lock (_ahEffects) { if (_ahEffects.ContainsKey(cPL)) cEffectCover = _ahEffects[cPL]; else throw new Exception("playlist:items_delete: отсутствует указанный объект плейлиста [hc:" + cPL.GetHashCode() + "]"); } int[] aIDs = _ahEffects.Where(o => aEffects.Contains(o.Key)).Select(o => o.Value.oEffect.GetHashCode()).ToArray(); ((BTL.Play.Playlist)cEffectCover.oEffect).PLItemsDelete(aIDs); } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static void Playlist_OnEndTransDurationSet(shared.Playlist cPL, ushort nEndTransDuration) { try { EffectCover cEffectCover = null; lock (_ahEffects) { if (_ahEffects.ContainsKey(cPL)) cEffectCover = _ahEffects[cPL]; else throw new Exception("playlist:EndTransDurationSet: отсутствует указанный объект плейлиста [hc:" + cPL.GetHashCode() + "]"); } ((BTL.Play.Playlist)cEffectCover.oEffect).EndTransDurationSet(nEndTransDuration); } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static void PlaylistSkip(shared.Playlist cPL, bool bLast, ushort nNewTransDur, shared.Effect cEffect) { try { (new Logger()).WriteDebug("playlist:skip: [e:" + (null == cEffect ? "null" : cEffect.nDuration.ToString()) + "]"); EffectCover cEffectCover = null; BTL.Play.Effect cEffectToSkip = null; lock (_ahEffects) { if (_ahEffects.ContainsKey(cPL)) cEffectCover = _ahEffects[cPL]; else throw new Exception("playlist:skip: отсутствует указанный объект плейлиста [hc:" + cPL.GetHashCode() + "]"); if (null != cEffect) { if (_ahEffects.ContainsKey(cEffect)) cEffectToSkip = (BTL.Play.Effect)_ahEffects[cEffect].oEffect; else throw new Exception("playlist:skip:effect: пропускаемый эффект не зарегистрирован на сервере [hcPL:" + cPL.GetHashCode() + "] [hceff:" + cEffect.GetHashCode() + "]"); } } ((BTL.Play.Playlist)cEffectCover.oEffect).Skip(bLast, nNewTransDur, cEffectToSkip); } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static ulong Effect_OnFrameCurrentGet(shared.Effect cSender) { ulong nRetVal = ulong.MaxValue; try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effect:frame:current:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); nRetVal = ((BTL.Play.EffectVideo)cEffectCover.oEffect).nFrameCurrent; } catch (Exception ex) { (new Logger()).WriteError(ex); } return nRetVal; }
static void Roll_OnDirectionSet(shared.Roll cSender, shared.Roll.Direction eDirection) { try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("roll:direction:set: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); ((BTL.Play.Roll)cEffectCover.oEffect).eDirection = (BTL.Play.Roll.Direction)Enum.Parse(typeof(BTL.Play.Roll.Direction), eDirection.ToString(), true); } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static object Effect_OnTagGet(shared.Effect cSender) { object oRetVal = null; try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effect:tag:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); oRetVal = ((BTL.Play.Effect)cEffectCover.oEffect).oTag; } catch (Exception ex) { (new Logger()).WriteError(ex); } return oRetVal; }
static float Roll_OnSpeedGet(shared.Roll cSender) { float nRetVal = short.MaxValue; try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("roll:speed:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); nRetVal = ((BTL.Play.Roll)cEffectCover.oEffect).nSpeed; } catch (Exception ex) { (new Logger()).WriteError(ex); } return nRetVal; }
static bool Stop(shared.Effect cEffect) { bool bRetVal = false; try { EffectCover cEffectCover = null; lock (_ahEffects) { if (_ahEffects.ContainsKey(cEffect)) cEffectCover = _ahEffects[cEffect]; } if (null != cEffectCover) { if (BTL.EffectStatus.Stopped != cEffectCover.eStatus) { cEffectCover.Stop(); bRetVal = true; } else (new Logger()).WriteDebug2("stop: указанный эффект уже остановлен [hc:" + cEffect.GetHashCode() + "]"); } else throw new Exception("stop: указанный эффект не зарегистрирован [hc:" + cEffect.GetHashCode() + "]"); //TODO LANG } catch (Exception ex) { (new Logger()).WriteError(ex); } return bRetVal; }
static void Roll_OnSpeedSet(shared.Roll cSender, float nSpeed) { try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("roll:speed:set: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); ((BTL.Play.Roll)cEffectCover.oEffect).nSpeed = nSpeed; } catch (Exception ex) { (new Logger()).WriteError(ex); } }
public static ulong Container_OnSumDurationGet(shared.Effect cSender) { ulong nRetVal = ulong.MaxValue; try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effect:sumduration:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); nRetVal = ((BTL.IContainer)cEffectCover.oEffect).nSumDuration; } catch (Exception ex) { (new Logger()).WriteError(ex); } return nRetVal; }
static bool Roll_OnStopOnEmptyGet(shared.Roll cSender) { bool bRetVal = false; try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("roll:StopOnEmpty:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); bRetVal = ((BTL.Play.Roll)cEffectCover.oEffect).bStopOnEmpty; } catch (Exception ex) { (new Logger()).WriteError(ex); } return bRetVal; }
static bool EffectVideo_OnCUDAGet(shared.Effect cSender) { bool bRetVal = false; try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effect:layer:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); bRetVal = ((BTL.Play.EffectVideo)cEffectCover.oEffect).bCUDA; } catch (Exception ex) { (new Logger()).WriteError(ex); } return bRetVal; }
static void Roll_OnStopOnEmptySet(shared.Roll cSender, bool bStopOnEmpty) { try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("roll:StopOnEmpty:set: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); ((BTL.Play.Roll)cEffectCover.oEffect).bStopOnEmpty = bStopOnEmpty; } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static helpers.Area EffectVideo_OnAreaGet(shared.Effect cSender) { helpers.Area stRetVal = helpers.Area.stEmpty; try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effect:area:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); stRetVal = ((BTL.Play.EffectVideo)cEffectCover.oEffect).stArea; } catch (Exception ex) { (new Logger()).WriteError(ex); } return stRetVal; }
static void Roll_OnEffectAdd(shared.Roll cSender, shared.Effect cEffect, float nSpeed) { try { EffectCover cEffectCoverSender = EffectCoverGet(cSender); if (null == cEffectCoverSender) throw new Exception("roll:effect:add: указанный объект [roll] не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); EffectCover cEffectCover = EffectCoverGet(cEffect); if (null == cEffectCover) throw new Exception("roll:effect:add: указанный объект [effect] не зарегистрирован на сервере [hc:" + cEffect.GetHashCode() + "]"); ((BTL.Play.Roll)cEffectCoverSender.oEffect).EffectAdd((BTL.IVideo)cEffectCover.oEffect, nSpeed); } catch (Exception ex) { (new Logger()).WriteError(ex); } }
static byte[] EffectVideoAudio_OnChannelGet(shared.Effect cSender) { byte[] aRetVal = null; try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effectvideoaudio:channels:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); aRetVal = ((BTL.Play.EffectVideoAudio)cEffectCover.oEffect).aChannelsAudio; } catch (Exception ex) { (new Logger()).WriteError(ex); } return aRetVal; }
static ushort Effect_OnLayerGet(shared.Effect cSender) { ushort nRetVal = ushort.MaxValue; try { EffectCover cEffectCover = EffectCoverGet(cSender); if (null == cEffectCover) throw new Exception("effect:layer:get: указанный объект не зарегистрирован на сервере [hc:" + cSender.GetHashCode() + "]"); nRetVal = ((BTL.Play.Effect)cEffectCover.oEffect).nLayer; } catch (Exception ex) { (new Logger()).WriteError(ex); } return nRetVal; }
static void EffectCreate(shared.Effect cEffect) { (new Logger()).WriteDebug3("in [hc:" + cEffect.GetHashCode() + "]"); EffectCover cEffectCover = null; lock (_ahEffects) { if (_ahEffects.ContainsKey(cEffect)) cEffectCover = _ahEffects[cEffect]; } if (null != cEffectCover) { (new Logger()).WriteDebug2("effect:create: effect exists [hc:" + cEffect.GetHashCode() + "]"); BTL.EffectStatus eES = (BTL.EffectStatus)cEffectCover.eStatus; if (BTL.EffectStatus.Stopped == eES || BTL.EffectStatus.Idle == eES) cEffectCover.Idle(); //Dispose(); надо бы его убивать вообще-то........ else throw new Exception("create: указанный эффект уже создан [hc:" + cEffect.GetHashCode() + "]"); //TODO LANG } else { lock (_ahEffects) { _ahEffects.Add(cEffect, null); } } (new Logger()).WriteDebug4("return [hc:" + cEffect.GetHashCode() + "]"); }
static void PlaylistCreate(shared.Playlist cPlaylistShared, helpers.Dock cDock, ushort nZ, bool bStopOnEmpty, bool bOpacity, ulong nDelay) { (new Logger()).WriteDebug3("in [hc:" + cPlaylistShared.GetHashCode() + "]"); EffectCreate(cPlaylistShared); try { BTL.Play.Playlist cPlaylist = new BTL.Play.Playlist(); EffectCover cEffectCover = null; lock (_ahEffects) { _ahEffects[cPlaylistShared] = new EffectCover(cPlaylist); cEffectCover = _ahEffects[cPlaylistShared]; } cEffectCover.sType = "Playlist"; cEffectCover.sInfo = "x=" + cDock.cOffset.nLeft + ", y=" + cDock.cOffset.nTop; cPlaylist.cDock = cDock; cPlaylist.nLayer = nZ; cPlaylist.bStopOnEmpty = bStopOnEmpty; cPlaylist.bOpacity = bOpacity; cPlaylist.nDelay = nDelay; cPlaylist.oTag = cPlaylistShared; //EMERGENCY это что за хрень???????? Tag не использовать нигде!!!! кроме пользовательского фронтенда!!!!! cPlaylist.OnPlaylistIsEmpty += new BTL.Play.Playlist.PlaylistIsEmpty(OnPlaylistIsEmpty); } catch (Exception ex) { (new Logger()).WriteError(ex); } (new Logger()).WriteDebug4("return [hc:" + cPlaylistShared.GetHashCode() + "]"); }