ACAT.Extensions.Default.FunctionalAgents.LectureManager.LectureManagerMainForm.OnIndexReached C# (CSharp) Method

OnIndexReached() private method

Callback invoked when the TTS engine has reached the specified book mark in the stream
private OnIndexReached ( int index ) : void
index int bookmark index
return void
        private void OnIndexReached(int index)
        {
            Log.Debug("OnIndexReached() - index=" + index.ToString());

            switch (Mode)
            {
                case SpeechMode.All:
                    if (isLastSentence(_lastSentenceSpoken) &&
                            Common.AppPreferences.LectureManagerSpeakAllParagraphPause > 0)
                    {
                        Invoke(new MethodInvoker(delegate()
                            {
                                _speakAllParagraphTimer.Interval = Common.AppPreferences.LectureManagerSpeakAllParagraphPause;
                                _speakAllParagraphTimer.Start();
                            }));
                    }
                    else
                    {
                        ProcessNextSpeakAllSentence();
                    }

                    break;

                case SpeechMode.Paragraph:
                    Log.Debug("OnIndexReached() - currentState=" + Mode.ToString());
                    Log.Debug(" now continuing with next sentence...");
                    ProcessNextSpeakParagraphSentence();
                    break;

                case SpeechMode.Sentence:
                    Speaking = false;
                    break;
            }
        }