TextItem Class Reference

Portion of text with all necessary attributes. More...

List of all members.

Public Member Functions

LangId getLangId () const
 Returns language of this text item.
std::string getOutputName () const
 Returns output name for this text item.
TextParam getPitch () const
 Returnes pitch for this text item.
TextParam getRate () const
 Returnes rate for this text item.
std::wstring getText () const
 Returns the text string of current text item.
TextParam getVolume () const
 Returnes volume for this text item.
bool isMarked (size_t index) const
 Checks if the specified letter is marked.
void mark (size_t index)
 Sets a mark to say phonetically to specified letter.
void resetParams ()
 Resets all text item speech parameters to their default values.
void setLangId (LangId langId)
 Sets new language for this item.
void setOutputName (const std::string &outputName)
 Sets new value of output name.
void setPitch (TextParam pitch)
 Sets pitch for this item.
void setRate (TextParam rate)
 Sets rate for this item.
void setText (const std::wstring &text)
 Sets new value of this item text string.
void setVolume (TextParam volume)
 Sets volume for this item.
 TextItem (LangId langId, const std::wstring &text, TextParam volume, TextParam pitch, TextParam rate)
 The constructor with language , text and parameters specification.
 TextItem (const std::string &outputName, const std::wstring &text, TextParam volume, TextParam pitch, TextParam rate)
 The constructor with output name, text and parameters specification.
 TextItem (const std::wstring &text, TextParam volume, TextParam pitch, TextParam rate)
 The constructor with text and parameters specification.
 TextItem (const std::string &outputName, const std::wstring &text)
 The constructor with output name and text string specification.
 TextItem (LangId langId, const std::wstring &text)
 The constructor with language and text specification.
 TextItem (const std::wstring &text)
 The constructor with text specification.
 TextItem ()
 The default constructor.
void unmark (size_t index)
 removes mark from the specified letter


Detailed Description

This class contains portion of text for further translation to speech with all necessary attributes, such used language, pitch, rate, volume etc. Also it contains marks which letters in this part of text must be spoken phonetically to get proper acronyms pronunciation. Not every of these attributes must have proper values during entire lifetime cycle. Some of them like output name are not set at object creation. This class was designed to get convenient data storing. So some information in it has redundant meaning.

Constructor & Destructor Documentation

TextItem::TextItem ( const std::wstring &  text  )  [inline]

Parameters:
[in] text The text string for the new text item

TextItem::TextItem ( LangId  langId,
const std::wstring &  text 
) [inline]

Parameters:
[in] langId The language for the new item
[in] text The text string for the new text item

TextItem::TextItem ( const std::string &  outputName,
const std::wstring &  text 
) [inline]

Parameters:
[in] outputName The name of a output new item will be associated with
[in] text The text string for the new item

TextItem::TextItem ( const std::wstring &  text,
TextParam  volume,
TextParam  pitch,
TextParam  rate 
) [inline]

Parameters:
[in] text The text string for the new item
[in] volume The volume value for the new item
[in] pitch The pitch value for the new item
[in] rate The rate value for the new item

TextItem::TextItem ( const std::string &  outputName,
const std::wstring &  text,
TextParam  volume,
TextParam  pitch,
TextParam  rate 
) [inline]

Parameters:
[in] outputName The name of the output new item will be associated with
[in] text The text string for the new item
[in] volume The volume value for the new item
[in] pitch The pitch value for the new item
[in] rate The rate value for the new item

TextItem::TextItem ( LangId  langId,
const std::wstring &  text,
TextParam  volume,
TextParam  pitch,
TextParam  rate 
) [inline]

Parameters:
[in] langId The ID of a language for new item
[in] text The text string for the new item
[in] volume The volume value for the new item
[in] pitch The pitch value for the new item
[in] rate The rate value for the new item


Member Function Documentation

LangId TextItem::getLangId (  )  const

Use this method to get language of this item by language ID.

Returns:
The language of this text item

std::string TextItem::getOutputName (  )  const

Use this method to retrieve name of the associated output. The output name can by an empty string. It is a valid case, the output name can be set later during further processing of this text item.

Returns:
The output name associated with this text item

TextParam TextItem::getPitch (  )  const

Use this method to retreive pitch value of this item.

Returns:
The pitch value of this item

TextParam TextItem::getRate (  )  const

Use this method to retreive rate value of this item.

Returns:
The rate value of this item

std::wstring TextItem::getText (  )  const

The method to retreive text stored in this item

Returns:
The text of this item

TextParam TextItem::getVolume (  )  const

Use this method to retreive volume value of this item.

Returns:
The volume value of this item

bool TextItem::isMarked ( size_t  index  )  const

This method can be used to check if specified letter must be spoken phonetically.

Parameters:
[in] index The index of the letter to check mark of
Returns:
Non-zero if specified letter has a mark

void TextItem::mark ( size_t  index  ) 

This method marks one letter by its index to say it phonetically.

Parameters:
[in] index The index of a letter to mark

void TextItem::resetParams (  ) 

This method resets three main speech parameters to their default values. The attributes to reset are: volume, pitch and rate.

void TextItem::setLangId ( LangId  langId  ) 

This method sets new language indication by the language ID.

Parameters:
[in] langId The ID of the desired language

void TextItem::setOutputName ( const std::string &  outputName  ) 

This method sets new name of associated output

Parameters:
[in] outputName The value to set

void TextItem::setPitch ( TextParam  pitch  ) 

This method sets new pitch value for this text item

Parameters:
[in] pitch The value to set

void TextItem::setRate ( TextParam  rate  ) 

This method sets new rate value for this text item

Parameters:
[in] rate The value to set

void TextItem::setText ( const std::wstring &  text  ) 

This method sets new text content for item. Be careful, the acronym marks are always set to their initial values with this method call, but all other attributes will be stayed unchanged.

Parameters:
text New [in] text value

void TextItem::setVolume ( TextParam  volume  ) 

This method sets new volume value for this text item

Parameters:
[in] volume The value to set

void TextItem::unmark ( size_t  index  ) 

This method removes mark from the letter by its index. It means not to say it phonetically.

Parameters:
[in] index The index of the letter to remove mark from


Generated on Thu May 6 16:10:58 2010 for VoiceMan by  doxygen 1.5.9