示例#1
0
        void controller_CurrentTimeUpdate(object sender, EventArgs e)
        {
            Timeline timeline = controller.Timeline;

            if (timeline == null)
            {
                return;
            }

            if (InvokeRequired)
            {
                Invoke(new Action(() => { controller_CurrentTimeUpdate(sender, e); }));
                return;
            }
            else
            {
                // play pending alerts
                var pendingAlerts = timeline.PendingAlertsAt(controller.CurrentTime);
                foreach (ActivityAlert pendingAlert in pendingAlerts)
                {
                    soundplayer.PlaySound(pendingAlert.Sound.Filename);
                    pendingAlert.Processed = true;
                }

                // sync dataGridView
                dataGridView.DataSource = null;
                dataGridView.DataSource = timeline.VisibleItemsAt(controller.CurrentTime - TimeLeftCell.THRESHOLD, numberOfRowsToDisplay).ToList();
            }
        }
示例#2
0
        void ProcessAlert(ActivityAlert alert)
        {
            if (PlaySoundByACT)
            {
                ActGlobals.oFormActMain.PlaySoundMethod(alert.Sound.Filename, 100);
            }
            else
            {
                soundplayer.PlaySound(alert.Sound.Filename);
            }

            alert.Processed = true;
        }
示例#3
0
        void ProcessAlert(ActivityAlert alert)
        {
            //TTSクラスならACT本体に読み上げさせる
            if (alert.Sound is AlertTTS)
            {
                ActGlobals.oFormActMain.TTS(alert.Sound.Filename);
            }
            else
            if (PlaySoundByACT)
            {
                ActGlobals.oFormActMain.PlaySoundMethod(alert.Sound.Filename, 100);
            }
            else
            {
                soundplayer.PlaySound(alert.Sound.Filename);
            }

            alert.Processed = true;
        }
示例#4
0
        void controller_CurrentTimeUpdate(object sender, EventArgs e)
        {
            Timeline timeline = controller.Timeline;

            if (timeline == null)
            {
                return;
            }

            if (InvokeRequired)
            {
                Invoke(new Action(() => { controller_CurrentTimeUpdate(sender, e); }));
                return;
            }
            else
            {
                // play pending alerts
                var pendingAlerts = timeline.PendingAlertsAt(controller.CurrentTime);
                foreach (ActivityAlert pendingAlert in pendingAlerts)
                {
                    if (pendingAlert.Sound != null)
                    {
                        soundplayer.PlaySound(pendingAlert.Sound.Filename);
                    }
                    if (pendingAlert.TtsSpeaker != null &&
                        !string.IsNullOrWhiteSpace(pendingAlert.TtsSentence))
                    {
                        pendingAlert.TtsSpeaker.Synthesizer.SpeakAsync(pendingAlert.TtsSentence);
                    }
                    pendingAlert.Processed = true;
                }

                // sync dataGridView
                dataGridView.DataSource = null;
                if (popupMode)
                {
                    dataGridView.DataSource = timeline.VisibleItemsAtMostWithoutCasting(controller.CurrentTime - 5, controller.CurrentTime, numberOfRowsToDisplay, ReverseOrder).ToList();
                }
                else if (over10)
                {
                    if (under10)
                    {
                        if (showCasting)
                        {
                            dataGridView.DataSource = timeline.VisibleItemsAt(controller.CurrentTime, numberOfRowsToDisplay, ReverseOrder).ToList();
                        }
                        else
                        {
                            dataGridView.DataSource = timeline.VisibleItemsAtWithoutCasting(controller.CurrentTime, numberOfRowsToDisplay, ReverseOrder).ToList();
                        }
                    }
                    else
                    {
                        dataGridView.DataSource = timeline.VisibleItemsAtLeast(controller.CurrentTime, controller.CurrentTime + 10, numberOfRowsToDisplay, ReverseOrder).ToList();
                    }
                }
                else
                {
                    if (under10)
                    {
                        if (showCasting)
                        {
                            dataGridView.DataSource = timeline.VisibleItemsAtMost(controller.CurrentTime, controller.CurrentTime + 10, numberOfRowsToDisplay, ReverseOrder).ToList();
                        }
                        else
                        {
                            dataGridView.DataSource = timeline.VisibleItemsAtMostWithoutCasting(controller.CurrentTime, controller.CurrentTime + 10, numberOfRowsToDisplay, ReverseOrder).ToList();
                        }
                    }
                    else if (showCasting)
                    {
                        dataGridView.DataSource = timeline.VisibleItemsAtMost(controller.CurrentTime, controller.CurrentTime, numberOfRowsToDisplay, ReverseOrder).ToList();
                    }
                }
            }
        }