internal AnimatedEvent( Engine engine, UInt64 idRundownEvent, UInt64 idEventBinding, VideoLayer videoLayer, TStartType startType, TPlayState playState, DateTime scheduledTime, TimeSpan duration, TimeSpan scheduledDelay, Guid mediaGuid, string eventName, DateTime startTime, bool isEnabled, IDictionary <string, string> fields, TemplateMethod method, int templateLayer ) : base( engine, idRundownEvent, idEventBinding, videoLayer, TEventType.Animation, startType, playState, scheduledTime, duration, scheduledDelay, TimeSpan.Zero, mediaGuid, eventName, startTime, TimeSpan.Zero, null, TimeSpan.Zero, TimeSpan.Zero, TTransitionType.Cut, TEasing.None, 0, 0, string.Empty, isEnabled, false, false, AutoStartFlags.None, false, 0, 0, 0 ) { _fields = new SimpleDictionary <string, string>(fields); _fields.DictionaryOperation += _fields_DictionaryOperation; _method = method; _templateLayer = templateLayer; }
private bool _setPlayState(TPlayState newPlayState) { if (SetField(ref _playState, newPlayState, nameof(PlayState))) { if (newPlayState == TPlayState.Playing) { StartTime = Engine.CurrentTime; StartTc = ScheduledTc + TimeSpan.FromTicks(_position * Engine.FrameTicks); } if (newPlayState == TPlayState.Scheduled) { StartTime = default(DateTime); StartTc = ScheduledTc; Position = 0; _uppdateScheduledTime(); } return(true); } return(false); }
public IEvent CreateNewEvent( ulong idRundownEvent = 0, ulong idEventBinding = 0, VideoLayer videoLayer = VideoLayer.None, TEventType eventType = TEventType.Rundown, TStartType startType = TStartType.None, TPlayState playState = TPlayState.Scheduled, DateTime scheduledTime = default(DateTime), TimeSpan duration = default(TimeSpan), TimeSpan scheduledDelay = default(TimeSpan), TimeSpan scheduledTC = default(TimeSpan), Guid mediaGuid = default(Guid), string eventName = "", DateTime startTime = default(DateTime), TimeSpan startTC = default(TimeSpan), TimeSpan?requestedStartTime = null, TimeSpan transitionTime = default(TimeSpan), TimeSpan transitionPauseTime = default(TimeSpan), TTransitionType transitionType = TTransitionType.Cut, TEasing transitionEasing = TEasing.Linear, double?audioVolume = null, ulong idProgramme = 0, string idAux = "", bool isEnabled = true, bool isHold = false, bool isLoop = false, bool isCGEnabled = false, byte crawl = 0, byte logo = 0, byte parental = 0, AutoStartFlags autoStartFlags = AutoStartFlags.None, string command = null, IDictionary <string, string> fields = null, TemplateMethod method = TemplateMethod.Add, int templateLayer = -1 ) { return(Query <Event>(parameters: new object[] { idRundownEvent, idEventBinding, videoLayer, eventType, startType, playState, scheduledTime, duration, scheduledDelay, scheduledTC, mediaGuid, eventName, startTime, startTC, requestedStartTime, transitionTime, transitionPauseTime, transitionType, transitionEasing, audioVolume, idProgramme, idAux, isEnabled, isHold, isLoop, isCGEnabled, crawl, logo, parental, autoStartFlags, command, fields, method, templateLayer })); }
internal CommandScriptEvent(Engine engine, ulong idRundownEvent, ulong idEventBinding, TStartType startType, TPlayState playState, TimeSpan scheduledDelay, string eventName, DateTime startTime, bool isEnabled, string command) : base(engine, idRundownEvent, idEventBinding, VideoLayer.None, TEventType.CommandScript, startType, playState, DateTime.MinValue, TimeSpan.Zero, scheduledDelay, TimeSpan.Zero, Guid.Empty, eventName, startTime, TimeSpan.Zero, null, TimeSpan.Zero, TimeSpan.Zero, TTransitionType.Cut, TEasing.None, null, 0, string.Empty, isEnabled, false, false, AutoStartFlags.None, false, 0, 0, 0, -1, null) { _command = command; }
internal Event( Engine engine, UInt64 idRundownEvent, UInt64 idEventBinding, VideoLayer videoLayer, TEventType eventType, TStartType startType, TPlayState playState, DateTime scheduledTime, TimeSpan duration, TimeSpan scheduledDelay, TimeSpan scheduledTC, Guid mediaGuid, string eventName, DateTime startTime, TimeSpan startTC, TimeSpan?requestedStartTime, TimeSpan transitionTime, TimeSpan transitionPauseTime, TTransitionType transitionType, TEasing transitionEasing, decimal?audioVolume, UInt64 idProgramme, string idAux, bool isEnabled, bool isHold, bool isLoop, AutoStartFlags autoStartFlags, bool isCGEnabled, byte crawl, byte logo, byte parental) { _engine = engine; _id = idRundownEvent; _idEventBinding = idEventBinding; _layer = videoLayer; _eventType = eventType; _startType = startType; _playState = playState == TPlayState.Paused ? TPlayState.Scheduled: playState == TPlayState.Fading ? TPlayState.Played : playState; _scheduledTime = scheduledTime; _duration = duration; _scheduledDelay = scheduledDelay; _scheduledTc = scheduledTC; _eventName = eventName; _startTime = startTime; _startTc = startTC; _requestedStartTime = requestedStartTime; _transitionTime = transitionTime; _transitionPauseTime = transitionPauseTime; _transitionType = transitionType; _transitionEasing = transitionEasing; _audioVolume = audioVolume; _idProgramme = idProgramme; _idAux = idAux; _isEnabled = isEnabled; _isHold = isHold; _isLoop = isLoop; _isCGEnabled = isCGEnabled; _crawl = crawl; _logo = logo; _parental = parental; _autoStartFlags = autoStartFlags; _setMedia(null, mediaGuid); _subEvents = new Lazy <SynchronizedCollection <Event> >(() => { var result = new SynchronizedCollection <Event>(); if (_id != 0) { var seList = Engine.DbReadSubEvents(this); foreach (Event e in seList) { e.Parent = this; result.Add(e); } } return(result); }); _next = new Lazy <Event>(() => { var next = (Event)Engine.DbReadNext(this); if (next != null) { next.Prior = this; } return(next); }); _prior = new Lazy <Event>(() => { Event prior = null; if (startType == TStartType.After && _idEventBinding > 0) { prior = (Event)Engine.DbReadEvent(_idEventBinding); } return(prior); }); _parent = new Lazy <Event>(() => { if ((startType == TStartType.WithParent || startType == TStartType.WithParentFromEnd) && _idEventBinding > 0) { return((Event)Engine.DbReadEvent(_idEventBinding)); } return(null); }); }
internal Event( Engine engine, UInt64 idRundownEvent, UInt64 idEventBinding, VideoLayer videoLayer, TEventType eventType, TStartType startType, TPlayState playState, DateTime scheduledTime, TimeSpan duration, TimeSpan scheduledDelay, TimeSpan scheduledTC, Guid mediaGuid, string eventName, DateTime startTime, TimeSpan startTC, TimeSpan?requestedStartTime, TimeSpan transitionTime, TimeSpan transitionPauseTime, TTransitionType transitionType, TEasing transitionEasing, double?audioVolume, UInt64 idProgramme, string idAux, bool isEnabled, bool isHold, bool isLoop, AutoStartFlags autoStartFlags, bool isCGEnabled, byte crawl, byte logo, byte parental, short routerPort, RecordingInfo recordingInfo) { _engine = engine; _rundownSync = engine.RundownSync; Id = idRundownEvent; IdEventBinding = idEventBinding; _layer = videoLayer; _eventType = eventType; _startType = startType; _playState = playState == TPlayState.Paused ? TPlayState.Scheduled: playState == TPlayState.Fading ? TPlayState.Played : playState; _scheduledTime = scheduledTime; _duration = duration; _scheduledDelay = scheduledDelay; _scheduledTc = scheduledTC; _eventName = eventName; _startTime = startTime; _startTc = startTC; _requestedStartTime = requestedStartTime; _transitionTime = transitionTime; _transitionPauseTime = transitionPauseTime; _transitionType = transitionType; _transitionEasing = transitionEasing; _audioVolume = audioVolume; _idProgramme = idProgramme; _idAux = idAux; _isEnabled = isEnabled; _isHold = isHold; _isLoop = isLoop; _isCGEnabled = isCGEnabled; _crawl = crawl; _logo = logo; _parental = parental; _autoStartFlags = autoStartFlags; _mediaGuid = mediaGuid; _subEvents = new Lazy <SynchronizedCollection <Event> >(() => { var result = new SynchronizedCollection <Event>(); if (Id == 0) { return(result); } var seList = DatabaseProvider.Database.ReadSubEvents(_engine, this); foreach (Event e in seList) { e.Parent = this; result.Add(e); } return(result); }); _next = new Lazy <Event>(() => { var next = (Event)DatabaseProvider.Database.ReadNext(_engine, this); if (next != null) { next.Prior = this; } return(next); }); _prior = new Lazy <Event>(() => { Event prior = null; if (startType == TStartType.After && IdEventBinding > 0) { prior = (Event)DatabaseProvider.Database.ReadEvent(_engine, IdEventBinding); } if (prior != null) { prior.Next = this; } return(prior); }); _parent = new Lazy <Event>(() => { if ((startType == TStartType.WithParent || startType == TStartType.WithParentFromEnd) && IdEventBinding > 0) { return((Event)DatabaseProvider.Database.ReadEvent(_engine, IdEventBinding)); } return(null); }); _rights = new Lazy <List <IAclRight> >(() => { var rights = DatabaseProvider.Database.ReadEventAclList <EventAclRight>(this, _engine.AuthenticationService as IAuthenticationServicePersitency); rights.ForEach(r => ((EventAclRight)r).Saved += AclEvent_Saved); return(rights); }); _routerPort = routerPort; _recordingInfo = recordingInfo; FieldLengths = DatabaseProvider.Database.EventFieldLengths; }