Exemplo n.º 1
0
        public static Project CreateProject(bool withEvents = true, string description = null)
        {
            TimelineEvent timeLineEvent;
            ProjectDummy  project = new ProjectDummy()
            {
                Dashboard = DashboardDummy.Default(),
                FileSet   = new MediaFileSet()
            };

            project.shortDescription = description;
            project.FileSet.Add(new MediaFile(Path.GetTempFileName(), 34000, 25, true, true, "mp4", "h264",
                                              "aac", 320, 240, 1.3, null, "Test asset 1"));
            project.FileSet.Add(new MediaFile(Path.GetTempFileName(), 34000, 25, true, true, "mp4", "h264",
                                              "aac", 320, 240, 1.3, null, "Test asset 2"));
            project.UpdateEventTypesAndTimers();
            project.IsLoaded = true;

            if (withEvents)
            {
                var analysisEventButton = project.Dashboard.List [0] as AnalysisEventButton;

                /* No tags, no players */
                timeLineEvent = new TimelineEvent {
                    EventType = analysisEventButton.EventType,
                    Start     = new Time(0),
                    Stop      = new Time(100),
                    FileSet   = project.FileSet
                };
                project.Timeline.Add(timeLineEvent);
                /* tags, but no players */
                analysisEventButton = project.Dashboard.List [1] as AnalysisEventButton;
                timeLineEvent       = new TimelineEvent {
                    EventType = analysisEventButton.EventType,
                    Start     = new Time(0),
                    Stop      = new Time(100),
                    FileSet   = project.FileSet
                };
                timeLineEvent.Tags.Add(analysisEventButton.AnalysisEventType.Tags [0]);
                project.Timeline.Add(timeLineEvent);
                /* tags and players */
                analysisEventButton = project.Dashboard.List [2] as AnalysisEventButton;
                timeLineEvent       = new TimelineEvent {
                    EventType = analysisEventButton.EventType,
                    Start     = new Time(0),
                    Stop      = new Time(100),
                    FileSet   = project.FileSet
                };
                timeLineEvent.Tags.Add(analysisEventButton.AnalysisEventType.Tags [1]);
                project.Timeline.Add(timeLineEvent);
            }

            return(project);
        }
Exemplo n.º 2
0
        public static Project CreateProject(bool withEvents = true)
        {
            TimelineEvent pl;
            Project       p = new ProjectDummy();

            p.Dashboard = DashboardDummy.Default();
            p.FileSet   = new MediaFileSet();
            p.FileSet.Add(new MediaFile(Path.GetTempFileName(), 34000, 25, true, true, "mp4", "h264",
                                        "aac", 320, 240, 1.3, null, "Test asset 1"));
            p.FileSet.Add(new MediaFile(Path.GetTempFileName(), 34000, 25, true, true, "mp4", "h264",
                                        "aac", 320, 240, 1.3, null, "Test asset 2"));
            p.Periods.Replace(new RangeObservableCollection <Period> {
                new Period {
                    Name  = "First Period",
                    Nodes = new RangeObservableCollection <TimeNode> {
                        new TimeNode {
                            Start = new Time(10),
                            Stop  = new Time(50)
                        }
                    }
                },
                new Period {
                    Name  = "Second Period",
                    Nodes = new RangeObservableCollection <TimeNode> {
                        new TimeNode {
                            Start = new Time(50),
                            Stop  = new Time(90)
                        }
                    }
                },
            });
            p.UpdateEventTypesAndTimers();
            p.IsLoaded = true;
            if (withEvents)
            {
                AnalysisEventButton b = p.Dashboard.List [0] as AnalysisEventButton;

                /* No tags, no players */
                pl = new TimelineEvent {
                    EventType = b.EventType,
                    Start     = new Time(0),
                    Stop      = new Time(50),
                    FileSet   = p.FileSet
                };
                p.Timeline.Add(pl);
                /* tags, but no players */
                b  = p.Dashboard.List [1] as AnalysisEventButton;
                pl = new TimelineEvent {
                    EventType = b.EventType,
                    Start     = new Time(20),
                    Stop      = new Time(60),
                    FileSet   = p.FileSet
                };
                pl.Tags.Add(b.AnalysisEventType.Tags [0]);
                p.Timeline.Add(pl);
                /* tags and players */
                b  = p.Dashboard.List [2] as AnalysisEventButton;
                pl = new TimelineEvent {
                    EventType = b.EventType,
                    Start     = new Time(70),
                    Stop      = new Time(100),
                    FileSet   = p.FileSet
                };
                pl.Tags.Add(b.AnalysisEventType.Tags [1]);
                p.Timeline.Add(pl);
            }

            return(p);
        }
Exemplo n.º 3
0
 public ProjectDummy()
 {
     Dashboard = DashboardDummy.Default();
     FileSet   = new MediaFileSet();
     UpdateEventTypesAndTimers();
 }