public void Start(Time start, string name = null) { if (name == null) name = Name; Stop (start); TimeNode tn = new TimeNode {Name = name, Start = start}; Nodes.Add (tn); }
public void Stop(Time stop) { if (Nodes.Count > 0) { TimeNode last = Nodes.Last(); if (last.Stop == null) { last.Stop = stop; } } }
public void Start(Time start, string name = null) { if (name == null) { name = Name; } Stop(start); TimeNode tn = new TimeNode { Name = name, Start = start }; Nodes.Add(tn); }
private void ConnectSignals() { /* Adding Handlers for each event */ /* Connect tagging related events */ mainWindow.NewTagEvent += OnNewTag; mainWindow.NewTagStartEvent += OnNewPlayStart; mainWindow.NewTagStopEvent += OnNewPlayStop; mainWindow.NewTagAtFrameEvent += OnNewTagAtFrame; mainWindow.TimeNodeChanged += OnTimeNodeChanged; mainWindow.PlaysDeletedEvent += OnPlaysDeleted; mainWindow.PlaySelectedEvent += OnPlaySelected; /* Connect playlist events */ mainWindow.PlayListNodeSelectedEvent += (tn) => {selectedTimeNode = tn;}; /* Connect tags events */ mainWindow.TagPlayEvent += OnTagPlay; /* Connect SnapshotSeries events */ mainWindow.SnapshotSeriesEvent += OnSnapshotSeries; /* Connect player events */ player.Prev += OnPrev; player.SegmentClosedEvent += OnSegmentClosedEvent; player.DrawFrame += OnDrawFrame; }
protected virtual void OnTimeNodeChanged(TimeNode tNode, object val) { /* FIXME: Tricky, create a new handler for categories */ if(tNode is Play && val is Time) { if(tNode != selectedTimeNode) OnPlaySelected((Play)tNode); Time pos = (Time)val; if(pos == tNode.Start) { player.UpdateSegmentStartTime(pos.MSeconds); } else { player.UpdateSegmentStopTime(pos.MSeconds); } } else if(tNode is Category) { mainWindow.UpdateCategories(openedProject.Categories); } }
protected virtual void OnSegmentClosedEvent() { selectedTimeNode = null; }
protected virtual void OnPlaySelected(Play play) { Log.Debug("Play selected: " + play); selectedTimeNode = play; player.SetStartStop(play.Start.MSeconds,play.Stop.MSeconds); drawingManager.Play=play; mainWindow.UpdateSelectedPlay(play); }
private void ResetGUI() { bool playlistVisible = playlist.Visible; Title = Constants.SOFTWARE_NAME; player.Visible = true; player.LogoMode = true; capturer.Visible = false; ClearWidgets(); HideWidgets(); playlist.Visible = playlistVisible; rightvbox.Visible = playlistVisible; notes.Visible = false; selectedTimeNode = null; MakeActionsSensitive(false, projectType); if (detachedPlayer) DetachPlayer(false); }
private void EmitTimeNodeChanged(TimeNode tNode, object val) { if (TimeNodeChanged != null) TimeNodeChanged(tNode, val); }
private void LoadPlaylistPlay(PlayListPlay play) { if(OpenedProject != null) { guiToolkit.ErrorMessage(Catalog.GetString( "Please, close the opened project to play the playlist.")); Stop(); return; } StartClock(); player.SetPlayListElement(play.MediaFile.FilePath, play.Start.MSeconds, play.Stop.MSeconds, play.Rate, playlist.HasNext()); selectedTimeNode = play; }
private void BindEvents(IMainWindow mainWindow, IPlayer player) { /* Track loaded element */ mainWindow.PlaySelectedEvent += (p) => {selectedTimeNode = p;}; player.SegmentClosedEvent += () => {selectedTimeNode = null;}; /* Handle New/Open/Save playlist */ mainWindow.OpenPlaylistEvent += OnOpenPlaylist; mainWindow.NewPlaylistEvent += OnNewPlaylist; mainWindow.SavePlaylistEvent += OnSavePlaylist; /* Handle Add/Select/Rate events from other widgets */ mainWindow.PlayListNodeAddedEvent += OnPlayListNodeAdded; mainWindow.PlayListNodeSelectedEvent += LoadPlaylistPlay; mainWindow.ApplyRateEvent += (p) => {p.Rate = player.Rate;}; mainWindow.RenderPlaylistEvent += OnRenderPlaylistEvent; /* Handle Next/Prev from the player */ player.Next += () => {Next();}; player.Prev += () => { if(selectedTimeNode is PlayListPlay) Prev(); }; }
protected virtual void OnTimeNodeChanged(TimeNode tNode, object val) { if(TimeNodeChanged != null) TimeNodeChanged(tNode, val); }
protected virtual void OnEditProperties(TimeNode tNode, object val) { EditCategoryDialog dialog = new EditCategoryDialog(ts); dialog.Category = tNode as Category; dialog.Project = project; dialog.Run(); dialog.Destroy(); if(TimeNodeChanged != null) TimeNodeChanged(tNode, tNode.Name); }
protected void EmitTimeNodeChanged(TimeNode tNode) { if (TimeNodeChanged != null) TimeNodeChanged(tNode, tNode.Name); }
protected void EmitTimeNodeChanged(TimeNode tn, object o) { if(TimeNodeChanged != null) TimeNodeChanged(tn, o); }