void StartProject()
 {
     if (projectType == ProjectType.EditProject)
     {
         projectType = ProjectType.FileProject;
         ViewModel.Project.ProjectType = projectType;
     }
     else
     {
         project.CreateLineupEvent();
     }
     LMStateHelper.OpenProject(ViewModel.Project, captureSettings);
 }
Beispiel #2
0
        void StartProject()
        {
            bool isNew = false;

            if (projectType == ProjectType.EditProject)
            {
                projectType = ProjectType.FileProject;
                ViewModel.Project.ProjectType = projectType;
            }
            else
            {
                isNew = true;
                project.CreateLineupEvent();
            }
            LMStateHelper.OpenProject(ViewModel.Project, captureSettings, isNew);
        }
Beispiel #3
0
        //Specific LongoMatch objects
        public static LMProject CreateProject(bool withEvents = true, bool withLineupEvent = false)
        {
            LMTimelineEvent pl;
            LMProject       p = new LMProject();

            p.Dashboard         = LMDashboard.DefaultTemplate(10);
            p.LocalTeamTemplate = LMTeam.DefaultTemplate(5);
            p.LocalTeamTemplate.FormationStr   = "2-2";
            p.VisitorTeamTemplate              = LMTeam.DefaultTemplate(5);
            p.VisitorTeamTemplate.FormationStr = "2-2";
            var pd = new ProjectDescription();

            pd.FileSet = new MediaFileSet();
            pd.FileSet.Add(new MediaFile(Path.GetTempFileName(), 34000, 25, true, true, "mp4", "h264",
                                         "aac", 320, 240, 1.3, null, "Test asset 1"));
            pd.FileSet.Add(new MediaFile(Path.GetTempFileName(), 34000, 25, true, true, "mp4", "h264",
                                         "aac", 320, 240, 1.3, null, "Test asset 2"));
            p.Description = pd;
            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();

            if (withLineupEvent)
            {
                p.CreateLineupEvent();
            }

            if (withEvents)
            {
                AnalysisEventButton b = p.Dashboard.List [0] as AnalysisEventButton;

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

            return(p);
        }