private void act_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            if (isImport || timeline == null)
            {
                return;
            }

            string line = logInfo.logLine;

            TimelineAnchor anchor = timeline.FindAnchorMatchingLogline(CurrentTime, logInfo.logLine);

            if (anchor != null)
            {
                if (anchor.Jump == 0)
                {
                    CurrentTime = 0;
                    Paused      = true;
                }
                else
                {
                    CurrentTime = anchor.Jump > 0 ? anchor.Jump : anchor.TimeFromStart;
                    Paused      = false;
                }
            }
        }
Ejemplo n.º 2
0
        private void act_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            if (isImport || timeline == null)
            {
                return;
            }

            string line = logInfo.logLine;

            TimelineAnchor anchor = timeline.FindAnchorMatchingLogline(CurrentTime, logInfo.logLine);

            if (anchor != null)
            {
                if (anchor.Jump == 0)
                {
                    CurrentTime = 0;
                    Paused      = true;
                }
                else
                {
                    CurrentTime = anchor.Jump > 0 ? anchor.Jump : anchor.TimeFromStart;
                    Paused      = false;
                }
            }

            // echo commands
            if (logInfo.logLine.Contains("/timeline show"))
            {
                plugin.checkBoxShowView.Checked = true;
            }

            if (logInfo.logLine.Contains("/timeline hide"))
            {
                plugin.checkBoxShowView.Checked = false;
            }

            if (logInfo.logLine.Contains("/timeline rewind"))
            {
                CurrentTime = 0;
            }

            if (logInfo.logLine.Contains("/timeline pause"))
            {
                Paused = true;
            }

            if (logInfo.logLine.Contains("/timeline play") || logInfo.logLine.Contains("/timeline start"))
            {
                if (timelineTxtFilePath != String.Empty && timeline != null)
                {
                    Paused = false;
                }
            }

            if (logInfo.logLine.Contains("/timeline stop"))
            {
                CurrentTime = 0;
                Paused      = true;
            }

            if (logInfo.logLine.Contains("/timeline unload") || logInfo.logLine.Contains("/timeline close"))
            {
                plugin.TabPageControl?.buttonUnload?.PerformClick();
            }

            // auto stop
            if (AutoStop)
            {
                foreach (var k in keywordsEnd)
                {
                    if (logInfo.logLine.Contains(k))
                    {
                        CurrentTime = 0;
                        Paused      = true;
                    }
                }
            }
        }