direcs  2012-09-30
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SpeakThread Class Reference

Speaks a text with espeak (Linux only). More...

#include <speakThread.h>

List of all members.

Public Slots

void speak (QString text, int phase=0)

Signals

void speechCompleted (int mPhase)

Public Member Functions

virtual void run ()
void setLanguage (QString language)
void setRate (int value)
void setVoice (unsigned char gender, unsigned char age)
 SpeakThread ()
void stop ()
 ~SpeakThread ()

Private Member Functions

QString removeHTML (QString string)

Private Attributes

int mPhase
bool saySomething
volatile bool stopped
QString textToSpeak
 this is for the thread, which waits for something to say.

Static Private Attributes

static const unsigned long THREADSLEEPTIME = 200

Detailed Description

Speaks a text with espeak (Linux only).

Author:
Markus Knapp Also removes HTML-Tags from the text to speak in case of we got the text from a text edit field. If a text is already spoken, this former speach is stopped and the next text is about to speak.

Definition at line 41 of file speakThread.h.


Constructor & Destructor Documentation

SpeakThread::SpeakThread ( )

Definition at line 24 of file speakThread.cpp.

Here is the call graph for this function:

SpeakThread::~SpeakThread ( )

Definition at line 42 of file speakThread.cpp.

Here is the call graph for this function:


Member Function Documentation

QString SpeakThread::removeHTML ( QString  string)
private

Definition at line 159 of file speakThread.cpp.

Here is the caller graph for this function:

void SpeakThread::run ( )
virtual

Definition at line 67 of file speakThread.cpp.

Here is the call graph for this function:

void SpeakThread::setLanguage ( QString  language)

Definition at line 125 of file speakThread.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void SpeakThread::setRate ( int  value)

Definition at line 135 of file speakThread.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void SpeakThread::setVoice ( unsigned char  gender,
unsigned char  age 
)

Definition at line 145 of file speakThread.cpp.

Here is the call graph for this function:

void SpeakThread::speak ( QString  text,
int  phase = 0 
)
slot

Speaks a text with espeak. All HTML-Code in the parameter (text) is also removed internally).

Parameters:
textis the text to speak.
phaseis an optional value. This could be a special phase which could be returned when the speech ends or so.

Definition at line 100 of file speakThread.cpp.

Here is the call graph for this function:

void SpeakThread::speechCompleted ( int  mPhase)
signal

This is to let other methods or classes know that we completed the speech.

Parameters:
mPhasecould be a phase we where other program continue with their actions.

Here is the caller graph for this function:

void SpeakThread::stop ( )

Definition at line 52 of file speakThread.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

int SpeakThread::mPhase
private

Definition at line 78 of file speakThread.h.

bool SpeakThread::saySomething
private

Definition at line 76 of file speakThread.h.

volatile bool SpeakThread::stopped
private

Definition at line 75 of file speakThread.h.

QString SpeakThread::textToSpeak
private

this is for the thread, which waits for something to say.

Definition at line 77 of file speakThread.h.

const unsigned long SpeakThread::THREADSLEEPTIME = 200
staticprivate

Definition at line 82 of file speakThread.h.


The documentation for this class was generated from the following files: