public TimeNodeObject(TimeNode node) { TimeNode = node; SelectionMode = NodeSelectionMode.All; DraggingMode = NodeDraggingMode.All; LineColor = Config.Style.PaletteBackgroundLight; Height = StyleConf.TimelineCategoryHeight; StrictClipping = true; }
public void RemoveNode(TimeNode node) { TimeNodeObject to; to = nodes.FirstOrDefault (n => n.TimeNode == node); if (to != null) { RemoveObject (to, true); } }
public void Cancel() { if (currentNode == null) return; if (Timer != null) { Timer.CancelCurrent (); currentNode = null; } }
public TimerTimeNodeObject(Timer t, TimeNode tn) : base(tn) { Timer = t; }
public void EmitTimeNodeChanged(TimeNode tn, Time time) { if (TimeNodeChanged != null) TimeNodeChanged (tn, time); }
void HandleCameraDragged(MediaFile mediafile, TimeNode timenode) { // Start by pausing players Pause (); // And update HandleCameraUpdate (camerasTimeline.SelectedCamera); }
public void ResumePeriod() { if (currentPeriod == null) { string msg = Catalog.GetString ("Period recording not started"); Config.GUIToolkit.WarningMessage (msg, this); return; } Log.Debug ("Resume period at currentTime=", CurrentCaptureTime.ToMSecondsString ()); currentTimeNode = currentPeriod.Start (CurrentCaptureTime); pausebutton.Visible = true; resumebutton.Visible = false; Capturing = true; }
public TimeNode Intersect(TimeNode tn) { if (tn.Stop == null || tn.Start == null || Start == null || Stop == null) return null; if (tn.Stop <= Start || tn.Start >= Stop) return null; else return new TimeNode { Start = new Time (Math.Max (Start.MSeconds, tn.Start.MSeconds)), Stop = new Time (Math.Min (Stop.MSeconds, tn.Stop.MSeconds)) }; }
public TimeNodeObject(TimeNode node) : base(node) { }
void UpdateTimePlayed() { LineupEvent lineup = project.Lineup; List<SubstitutionEvent> subs; Time start; List<TimeNode> timenodes, playingTimeNodes; TimeNode last; subs = project.EventsByType (project.SubstitutionsEventType). Where (s => !(s is LineupEvent) && ((s as SubstitutionEvent).In == Player || (s as SubstitutionEvent).Out == Player)) .OrderBy (e => e.EventTime).Select (e => e as SubstitutionEvent).ToList (); if (lineup.AwayStartingPlayers.Contains (Player) || lineup.HomeStartingPlayers.Contains (Player)) { start = lineup.EventTime; } else { SubstitutionEvent sub = subs.Where (s => s.In == Player).FirstOrDefault (); if (sub == null) { TimePlayed = new Time (0); return; } else { start = sub.EventTime; } } timenodes = new List<TimeNode> (); /* Find the sequences of playing time */ last = new TimeNode { Start = start }; timenodes.Add (last); if (subs.Count == 0) { last.Stop = project.Description.FileSet.Duration; } else { foreach (SubstitutionEvent sub in subs) { if (last.Stop == null) { if (sub.Out == Player) { last.Stop = sub.EventTime; } } else { if (sub.In == Player) { last = new TimeNode { Start = sub.EventTime }; timenodes.Add (last); } } } } /* If the last substitution was Player IN */ if (last.Stop == null) { last.Stop = project.Description.FileSet.Duration; } playingTimeNodes = new List<TimeNode> (); /* Get the real playing time intersecting with the periods */ foreach (TimeNode timenode in timenodes) { foreach (Period p in project.Periods) { if (p.PeriodNode.Intersect (timenode) != null) { foreach (TimeNode ptn in p.Nodes) { TimeNode res = ptn.Intersect (timenode); if (res != null) { playingTimeNodes.Add (res); } } } } } TimePlayed = new Time (playingTimeNodes.Sum (t => t.Duration.MSeconds)); }
public TimeNode Start(Time start, string name = null) { TimeNode tn; if (name == null) name = Name; Stop (start); tn = new TimeNode { Name = name, Start = start }; Nodes.Add (tn); return tn; }
public void Stop(Time stop, List<DashboardButton> from) { if (currentNode == null) return; if (Timer != null) { Timer.Stop (stop); Config.EventsBroker.EmitTimeNodeStoppedEvent (currentNode, this, from); currentNode = null; } }
public void Start(Time start, List<DashboardButton> from) { if (currentNode != null) return; if (Timer != null) { currentNode = Timer.Start (start); Config.EventsBroker.EmitTimeNodeStartedEvent (currentNode, this, from); } }
public void AddTimeNode(Timer t, TimeNode tn) { TimerTimeNodeObject to = new TimerTimeNodeObject (t, tn); to.OffsetY = OffsetY; to.Height = Height; to.SecondsPerPixel = SecondsPerPixel; to.MaxTime = maxTime; to.DraggingMode = DraggingMode; to.ShowName = ShowName; to.LineColor = LineColor; AddNode (to); }
public void StartPeriod() { string periodName; if (currentPeriod != null) { string msg = Catalog.GetString ("Period recording already started"); Config.GUIToolkit.WarningMessage (msg, this); return; } recbutton.Visible = false; pausebutton.Visible = savebutton.Visible = stopbutton.Visible = true; if (PeriodsNames != null && PeriodsNames.Count > Periods.Count) { periodName = PeriodsNames [Periods.Count]; } else { periodName = (Periods.Count + 1).ToString (); } currentPeriod = new Period { Name = periodName }; currentTimeNode = currentPeriod.Start (accumTime, periodName); currentTimeNode.Stop = currentTimeNode.Start; currentPeriodStart = DateTime.UtcNow; timeoutID = GLib.Timeout.Add (20, UpdateTime); if (Capturer != null) { if (Periods.Count == 0) { Capturer.Start (); } else { Capturer.TogglePause (); } } periodlabel.Markup = currentPeriod.Name; Capturing = true; Periods.Add (currentPeriod); Log.Debug ("Start new period start=", currentTimeNode.Start.ToMSecondsString ()); }
public bool HasNode(TimeNode tn) { return nodes.FirstOrDefault (n => n.TimeNode == tn) != null; }
public void StopPeriod() { if (currentPeriod == null) { string msg = Catalog.GetString ("Period recording not started"); Config.GUIToolkit.WarningMessage (msg, this); return; } GLib.Source.Remove (timeoutID); currentPeriod.Stop (CurrentCaptureTime); accumTime = CurrentCaptureTime; Log.Debug ("Stop period stop=", accumTime.ToMSecondsString ()); currentTimeNode = null; currentPeriod = null; recbutton.Visible = true; pausebutton.Visible = resumebutton.Visible = stopbutton.Visible = false; if (Capturer != null && Capturing) { Capturer.TogglePause (); } Capturing = false; }
public TimeNode Join(TimeNode tn) { if (tn.Stop < Start || tn.Start > Stop) return null; else return new TimeNode { Start = new Time (Math.Min (Start.MSeconds, tn.Start.MSeconds)), Stop = new Time (Math.Max (Stop.MSeconds, tn.Stop.MSeconds)) }; }
void Reset() { currentPeriod = null; currentTimeNode = null; currentPeriodStart = DateTime.UtcNow; accumTime = new Time (0); Capturing = false; Capturer = null; recbutton.Visible = true; stopbutton.Visible = false; pausebutton.Visible = false; savebutton.Visible = false; cancelbutton.Visible = true; resumebutton.Visible = false; lasteventbox.Visible = false; }
public void EmitTimeNodeStoppedEvent(TimeNode node, TimerButton btn, List<DashboardButton> from) { if (TimeNodeStoppedEvent != null) { if (from == null) from = new List<DashboardButton> (); TimeNodeStoppedEvent (node, btn, from); } }
public void AddTimerNode(Timer timer, TimeNode tn) { TimerTimeline tl = Objects.OfType<TimerTimeline> ().FirstOrDefault (t => t.HasTimer (timer)); if (tl != null) { tl.AddTimeNode (timer, tn); widget.ReDraw (); } }
/// <summary> /// Periods segments have moved, adjust main camera position to segment boundaries /// </summary> void HandleTimeNodeChanged(TimeNode tNode, object val) { Time time = val as Time; Pause (); // Don't try to be accurate here. We are looking for period starts Seek (new SeekEvent { Time = time, Accurate = false }); }
public TimerButton() { BackgroundColor = StyleConf.ButtonTimerColor; currentNode = null; }