static void TextCreate(shared.Text cTextShared, object[] aArgs) //EMERGENCY раскрыть массив в нормальные параметры!!!! { BTL.Play.Text cTextBTL = new BTL.Play.Text((string)aArgs[0], new Font((string)aArgs[1], (int)aArgs[2], (FontStyle)aArgs[3]), (float)aArgs[7]); EffectCover cEffectCover = null; lock (_ahEffects) { EffectCreate(cTextShared); _ahEffects[cTextShared] = new EffectCover(cTextBTL); cEffectCover = _ahEffects[cTextShared]; } cEffectCover.sType = "Text"; cEffectCover.sInfo = (string)aArgs[0]; cTextBTL.stColor = Color.FromArgb((int)(byte)aArgs[19], (int)(byte)aArgs[4], (int)(byte)aArgs[5], (int)(byte)aArgs[6]); cTextBTL.stColorBorder = Color.FromArgb((int)(byte)aArgs[20], (int)(byte)aArgs[8], (int)(byte)aArgs[9], (int)(byte)aArgs[10]); cTextBTL.cDock = new helpers.Dock((helpers.Dock.Corner)aArgs[21], (short)aArgs[11], (short)aArgs[12]); cTextBTL.nLayer = aArgs[13].ToUShort(); cTextBTL.nDelay = aArgs[14].ToULong(); cTextBTL.nDuration = aArgs[15].ToULong(); cTextBTL.bOpacity = (bool)aArgs[16]; cTextBTL.nInDissolve = (byte)aArgs[17]; cTextBTL.nOutDissolve = (byte)aArgs[18]; cTextBTL.nMaxOpacity = (byte)aArgs[19]; }
static void AudioCreate(shared.Audio cAudioShared, string sFilename) { BTL.Play.Audio cAudioBTL = new BTL.Play.Audio(sFilename); EffectCover cEffectCover = null; lock (_ahEffects) { EffectCreate(cAudioShared); _ahEffects[cAudioShared] = new EffectCover(cAudioBTL); cEffectCover = _ahEffects[cAudioShared]; } cEffectCover.sType = "Audio"; cEffectCover.sInfo = sFilename; }
static void AnimationCreate(shared.Animation cAnimationShared, string sFolder, ushort nLoopsQty, bool bKeepAlive, helpers.Dock cDock, ushort nZ, bool bOpacity, ulong nDelay, float nPixelAspectRatio) { (new Logger()).WriteDebug3("in [bKeepAlive:" + bKeepAlive + "]"); BTL.Play.Animation cAnimationBTL = new BTL.Play.Animation(sFolder, nLoopsQty, bKeepAlive); EffectCover cEffectCover = null; lock (_ahEffects) { EffectCreate(cAnimationShared); _ahEffects[cAnimationShared] = new EffectCover(cAnimationBTL); cEffectCover = _ahEffects[cAnimationShared]; } cEffectCover.sType = "Animation"; cEffectCover.sInfo = sFolder; cAnimationBTL.cDock = cDock; cAnimationBTL.nLayer = nZ; cAnimationBTL.bOpacity = bOpacity; cAnimationBTL.nDelay = nDelay; cAnimationBTL.nPixelAspectRatio = nPixelAspectRatio; }
static void VideoCreate(shared.Video cVideoShared, string sFilename, helpers.Dock cDock, ushort nZ, ulong nFrameStart, ulong nDuration, bool bOpacity, ulong nDelay) //TODO убрать dock - его инициализация уже дублируется в userspace { BTL.Play.Video cVideoBTL = new BTL.Play.Video(sFilename); EffectCover cEffectCover = null; lock (_ahEffects) { EffectCreate(cVideoShared); _ahEffects[cVideoShared] = new EffectCover(cVideoBTL); cEffectCover = _ahEffects[cVideoShared]; } cEffectCover.sType = "Video"; cEffectCover.sInfo = sFilename; cVideoBTL.cDock = cDock; cVideoBTL.nLayer = nZ; cVideoBTL.nFrameStart = nFrameStart; cVideoBTL.nDuration = nDuration; cVideoBTL.bOpacity = bOpacity; cVideoBTL.nDelay = nDelay; }
public static void OnEffectEvent(shared.EffectEventType eEventType, EffectCover cEffectCover) { Logger cLogger = new Logger(); cLogger.WriteDebug3("in [" + eEventType.ToString() + "]"); try { if (null != cEffectCover) { shared.Effect cEffectShared = null; cLogger.WriteDebug4("effect:event:" + eEventType.ToString() + ":lock:before [ec hc:" + cEffectCover.GetHashCode() + " info: " + cEffectCover.sInfo + "]"); lock (_ahEffects) cEffectShared = _ahEffects.FirstOrDefault(row => row.Value == cEffectCover).Key; cLogger.WriteDebug4("effect:event:" + eEventType.ToString() + ":lock:after [ec hc:" + cEffectCover.GetHashCode() + "]"); if (null != cEffectShared) { cLogger.WriteDebug4("effect:event:" + eEventType.ToString() + ":raise:before [ec hc:" + cEffectCover.GetHashCode() + "][shared hc:" + cEffectShared.GetHashCode() + "]"); cEffectShared.OnEffectEventRaised(eEventType); cLogger.WriteDebug4("effect:event:" + eEventType.ToString() + ":raise:after [ec hc:" + cEffectCover.GetHashCode() + "][shared hc:" + cEffectShared.GetHashCode() + "]"); } else throw new Exception("effect:event:" + eEventType.ToString() + ": указанный экземпляр эффекта не зарегистрирован на сервере [ec hc:" + cEffectCover.GetHashCode() + "]"); } else throw new Exception("effect:event:" + eEventType.ToString() + ": экземпляр эффекта не может быть null"); } catch (Exception ex) { cLogger.WriteError(ex); } cLogger.WriteDebug4("return [" + eEventType.ToString() + "]"); }
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 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() + "]"); }
static void PluginCreate(shared.Plugin cPlugin, string sFile, string sClass, string sData) { Plugin cPluginBTL = new Plugin(sFile, sClass, sData); EffectCover cEffectCover = null; lock (_ahEffects) { EffectCreate(cPlugin); _ahEffects[cPlugin] = new EffectCover(cPluginBTL); cEffectCover = _ahEffects[cPlugin]; } cEffectCover.sType = "Plugin"; cEffectCover.sInfo = sFile; }