Beispiel #1
0
        async Task HandleEditEvent(EditEventEvent e)
        {
            PlayEventEditionSettings settings = new PlayEventEditionSettings()
            {
                EditTags = true, EditNotes = true, EditPlayers = true, EditPositions = true
            };

            dynamic properties = new ExpandoObject();

            properties.project = project;
            properties.play    = e.TimelineEvent;

            if (e.TimelineEvent is StatEvent)
            {
                await App.Current.StateController.MoveToModal(SubstitutionsEditorState.NAME, properties, true);
            }
            else
            {
                properties.settings = settings;
                await App.Current.StateController.MoveToModal(PlayEditorState.NAME, properties, true);
            }

            await App.Current.EventsBroker.Publish(
                new EventEditedEvent {
                TimelineEvent = e.TimelineEvent
            }
                );
        }
Beispiel #2
0
        async Task HandleNewDashboardEvent(NewDashboardEvent e)
        {
            if (CheckTimelineEventsLimitation())
            {
                return;
            }
            if (Project == null)
            {
                return;
            }

            if (Project.IsLive)
            {
                if (!Capturer.Capturing)
                {
                    App.Current.Dialogs.WarningMessage(Catalog.GetString("Video capture is stopped"));
                    return;
                }
            }

            if (!Project.Model.Dashboard.DisablePopupWindow && e.Edit)
            {
                e.TimelineEvent.Model.AddDefaultPositions();

                PlayEventEditionSettings settings = new PlayEventEditionSettings()
                {
                    EditTags      = true,
                    EditNotes     = true,
                    EditPlayers   = true,
                    EditPositions = true
                };

                if (Project.ProjectType == ProjectType.FileProject)
                {
                    bool playing = VideoPlayer.Playing;
                    VideoPlayer.PauseCommand.Execute(false);
                    await App.Current.EventsBroker.Publish(new EditEventEvent { TimelineEvent = e.TimelineEvent });

                    if (playing)
                    {
                        VideoPlayer.PlayCommand.Execute();
                    }
                }
                else
                {
                    await App.Current.EventsBroker.Publish(new EditEventEvent { TimelineEvent = e.TimelineEvent });
                }
            }

            Log.Debug(String.Format("New play created start:{0} stop:{1} category:{2}",
                                    e.TimelineEvent.Start.ToMSecondsString(), e.TimelineEvent.Stop.ToMSecondsString(),
                                    e.TimelineEvent.Model.EventType.Name));
            Project.Model.AddEvent(e.TimelineEvent.Model);
            AddNewPlay(e.TimelineEvent.Model);
            await App.Current.EventsBroker.Publish(new DashboardEventCreatedEvent {
                TimelineEvent    = e.TimelineEvent,
                DashboardButton  = e.DashboardButton,
                DashboardButtons = e.DashboardButtons
            });
        }
Beispiel #3
0
        async Task HandleEditEvent(EditEventEvent e)
        {
            PlayEventEditionSettings settings = new PlayEventEditionSettings()
            {
                EditTags = true, EditNotes = true, EditPlayers = true, EditPositions = true
            };

            await ShowEditionView(settings, e);

            await App.Current.EventsBroker.Publish(
                new EventEditedEvent {
                TimelineEvent = e.TimelineEvent
            }
                );
        }
        protected virtual async Task ShowEditionView(PlayEventEditionSettings settings, EditEventEvent ev)
        {
            dynamic properties = new ExpandoObject();

            properties.project = ViewModel;
            properties.play    = ev.TimelineEvent;

            if (ev.TimelineEvent.Model is StatEvent)
            {
                await App.Current.StateController.MoveToModal(SubstitutionsEditorState.NAME, properties, true);
            }
            else
            {
                properties.settings = settings;
                await App.Current.StateController.MoveToModal(PlayEditorState.NAME, properties, true);
            }
        }