C# Class ACAT.Extensions.Default.FunctionalAgents.LectureManager.LectureManagerMainForm

Inheritance: System.Windows.Forms.Form, IExtension, IPanel
Afficher le fichier Open project: brlima94/acat-localization Class Usage Examples

Méthodes publiques

Méthode Description
GetInvoker ( ) : ACAT.Lib.Core.Extensions.ExtensionInvoker

Gets the extension invoker object

GoToTop ( ) : void

Goes to the top of file

LectureManagerMainForm ( ) : System

Initializes a new instance of the class.

NavigateBackward ( ) : void

Goes backward by the navigational unit

NavigateForward ( ) : void

Goes forward by the navigational unit

OnPause ( ) : void

Not used

OnResume ( ) : void

Not used

PauseSpeaking ( ) : void

Pauses the lecture

ProcessExit ( ) : void

Exit lecture manager after user confirmation

ProcessReadAllSpeech ( ) : void

Read the entire text to speech

ProcessSpeakNext ( ) : void

Speak the next unit of text

StopIfSpeaking ( ) : bool

Stops speaking and update ui

StopSpeaking ( ) : void

Stop speaking

Méthodes protégées

Méthode Description
OnFormClosing ( FormClosingEventArgs e ) : void

Release resources

Private Methods

Méthode Description
ActiveEngine_EvtBookmarkReached ( object sender, ACAT.Lib.Core.TTSManagement.TTSBookmarkReachedEventArgs e ) : void

The text to speech engine informs us when it has exhausted its buffer so we can load the next unit

Dispose ( bool disposing ) : void
Form1_FormClosing ( object sender, FormClosingEventArgs e ) : void

Release resources

GetCursorPos ( System.Windows.Forms.POINT &lpPoint ) : bool
InitializeComponent ( ) : void
Instance_EvtScannerShow ( object sender, ACAT.Lib.Core.PanelManagement.ScannerShowEventArg arg ) : void

Inovked when the companian scanner is displayed. Dock this form to the scanner

LectureManagerMainForm_LocationChanged ( object sender, EventArgs e ) : void

Make this window active

OnIndexReached ( int index ) : void

Callback invoked when the TTS engine has reached the specified book mark in the stream

ProcessNextSpeakAllSentence ( ) : void

Speak all the next sentences

ProcessNextSpeakParagraphSentence ( ) : void

Speak the next sentence in the paragraph

ProcessSpeakParagraph ( ) : void

Speak the next paragraph sentence by sentence

ProcessSpeakSentence ( ) : void

Speak the next sentence

SendMessage ( IntPtr hWnd, int wMsg, int wParam, int lParam ) : int
SendTextImmediate ( string speechText ) : void

Sends the specified text to the TTS engine

_speakAllParagraphTimer_Tick ( object sender, EventArgs e ) : void

TImer for speaking the entire para

centerControls ( List controls, MoveDirection direction ) : void

Since we are resizing the form, the controls on the form are all anchored. We have to make sure they are all repositioned correctly. Use the center of gravity method to move all the controls relative to each other. The CG can move vertically, horizontally or in both directions

clickOnThisWindow ( ) : void

Restore focus to this window by simulating a mouse click on it. This seems to be the only fool-proof reliable method to make sure that the window has focus.

dumpParagraphs ( ) : void

Dumps para to the debug output

dumpSentences ( Paragraph para ) : void

Dumps sentences in the para to the debug output

enableWatchdogs ( ) : void

enable watchdogs to keep the window active

flagLongSentences ( ) : void

If the sentence is longer than a specified length, show it in a different color. SOme TTS engines may have a buffer limit and this flags sentences that will not fit in the buffer

frmMain_Load ( object sender, EventArgs e ) : void

Form load. Initialize

getLastWord ( String sentence ) : String

Gets the last word in the sentence

getNextPara ( ) : Paragraph

Gets the paragraph object of the next paragraph

getNextSentence ( ) : Sentence

Gets the next sentence object

getNextSentenceToSpeak ( ) : Sentence

Gets the sentence object of the next sentence that has to be spoken

getPreviousPara ( ) : Paragraph

Gets the prevous para object

getPreviousSentence ( ) : Sentence

Gets previous sentence object

getSpeechBufferSize ( ) : int

Gets the buffer size of the TTS engine. Some hardware engines have limited buffers before an overflow will occur

getSpeechTimerInterval ( string speechText ) : int

If not using bookmarks, use an algorithm to determine how long to wait for TTS to complete, depending on the lenght of the text

getWords ( String s ) : List

Splits the specified string into words

gotoNextPara ( String text, int index ) : int

Starting from the specified index offset in the text, goes to the beginning of the next para

gotoNextPara ( ) : void

Navigates to the next paragraph

gotoNextSentence ( ) : void

Goes to the next sentence

gotoPrevPara ( ) : void

Navigates to the previous paragraph

gotoPrevSentence ( ) : void

Navigate to the previous sentence

isEnd ( String text, int index ) : bool

Have we reched the end of the text stream?

isLastSentence ( Sentence sentence ) : bool

Is this the last sentence in the paragraph

isParagraphTerminator ( char ch ) : bool

Checks if the char is a para terminator

isSentenceTerminator ( char ch ) : bool

Checks if the specified char is a sentence terminator

isWhiteSpace ( char ch ) : bool

Checks if the char is a space or tab

loadFile ( ) : System.Threading.Tasks.Task

Load the file asynchronously so as to not tie up the ui

parse ( ) : void

Parses the text, breaks it up into paras and sentences and stores the entire text as a list of paras and sentences

parseAndDisplayText ( ) : void

Parses the text into para and sentences and displays the text in the form

parseSentences ( Paragraph para, String text, int index ) : int

Parses the specified paragraph into sentences, creates a list of sentence object and adds the list to the paragraph object

positionForm ( Form form ) : void

Dock the form next to the scanner

removeWatchdogs ( ) : void

Remove watchdogs

resolveAbbreviations ( Paragraph para, String text ) : int

Resolves any abbreviations in the text. For example, Dr. should not be interpreted as the end of the sentence, but merely as a part of the sentence.

setCaretPosAndSelect ( int pos, int length ) : void

Highlights text starting at the specified position and length

skipSentenceAndParaTerminators ( String text, int index ) : int

Starting from the index, skips sentence and para terminators and returns index

skipSentenceTerminators ( string text, int index ) : int

starting at the specified index skips all sentence terminators.

skipWhiteSpaces ( string text, int index ) : int

Starting at index, skips all the white spaces

speakNextSentence ( ) : Sentence

Sends the next sentence to the tts engine

speechTimer_Tick ( object sender, EventArgs e ) : void

Timer tick method used when timers are used to gauge how long the speech tackes

updateFileName ( String fileName ) : void

Updates the status bar with the name of the file

updateModeField ( ) : void

Update the mode field on the form based on the mode setting

updateStatusField ( ) : void

Update the status bar on the form depending on the context

Method Details

GetInvoker() public méthode

Gets the extension invoker object
public GetInvoker ( ) : ACAT.Lib.Core.Extensions.ExtensionInvoker
Résultat ACAT.Lib.Core.Extensions.ExtensionInvoker

GoToTop() public méthode

Goes to the top of file
public GoToTop ( ) : void
Résultat void

LectureManagerMainForm() public méthode

Initializes a new instance of the class.
public LectureManagerMainForm ( ) : System
Résultat System

NavigateBackward() public méthode

Goes backward by the navigational unit
public NavigateBackward ( ) : void
Résultat void

NavigateForward() public méthode

Goes forward by the navigational unit
public NavigateForward ( ) : void
Résultat void

OnFormClosing() protected méthode

Release resources
protected OnFormClosing ( FormClosingEventArgs e ) : void
e System.Windows.Forms.FormClosingEventArgs
Résultat void

OnPause() public méthode

Not used
public OnPause ( ) : void
Résultat void

OnResume() public méthode

Not used
public OnResume ( ) : void
Résultat void

PauseSpeaking() public méthode

Pauses the lecture
public PauseSpeaking ( ) : void
Résultat void

ProcessExit() public méthode

Exit lecture manager after user confirmation
public ProcessExit ( ) : void
Résultat void

ProcessReadAllSpeech() public méthode

Read the entire text to speech
public ProcessReadAllSpeech ( ) : void
Résultat void

ProcessSpeakNext() public méthode

Speak the next unit of text
public ProcessSpeakNext ( ) : void
Résultat void

StopIfSpeaking() public méthode

Stops speaking and update ui
public StopIfSpeaking ( ) : bool
Résultat bool

StopSpeaking() public méthode

Stop speaking
public StopSpeaking ( ) : void
Résultat void