Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 public void Stop(Time stop)
 {
     if (Nodes.Count > 0)
     {
         TimeNode last = Nodes.Last();
         if (last.Stop == null)
         {
             last.Stop = stop;
         }
     }
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
 protected virtual void OnSegmentClosedEvent()
 {
     selectedTimeNode = null;
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 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);
 }
Ejemplo n.º 9
0
 private void EmitTimeNodeChanged(TimeNode tNode, object val)
 {
     if (TimeNodeChanged != null)
         TimeNodeChanged(tNode, val);
 }
Ejemplo n.º 10
0
        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;
        }
Ejemplo n.º 11
0
        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);
 }
Ejemplo n.º 13
0
 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);
 }
Ejemplo n.º 14
0
 protected void EmitTimeNodeChanged(TimeNode tNode)
 {
     if (TimeNodeChanged != null)
         TimeNodeChanged(tNode, tNode.Name);
 }
Ejemplo n.º 15
0
 protected void EmitTimeNodeChanged(TimeNode tn, object o)
 {
     if(TimeNodeChanged != null)
         TimeNodeChanged(tn, o);
 }