VoiceMan
Public Member Functions
TextParam Class Reference

The value of speech attribute. More...

List of all members.

Public Member Functions

size_t getValue ()
 Returns native (not mapped) parameter value.
double getValue (double min, double aver, double max) const
 Returns the value mapped into specified interval.
const TextParamoperator+= (size_t step)
 Increments current value onto specified step.
const TextParamoperator-= (size_t step)
 Decrements current value onto specified step.
const TextParamoperator= (size_t value)
 Sets new value to this parameter.
void reset ()
 Restores default parameter value.
 TextParam ()
 The default constructor.
 TextParam (size_t value)
 The constructor with initial value specification.

Detailed Description

This class contains value of any text characteristic. Usually such characteristics are a voice pitch, rate or volume. A value is stored in percents and can be mapped into the provided interval. A interval can be specified by minimum, average and maximum values.

See also:
TextItem

Constructor & Destructor Documentation

TextParam::TextParam ( size_t  value)
Parameters:
[in]valueThe initial value for new object

Member Function Documentation

size_t TextParam::getValue ( )

This method returns the value of parameter as it stored in the object and not mapped into any interval. This value must be between 0 and 100.

Returns:
The native parameter value
double TextParam::getValue ( double  min,
double  aver,
double  max 
) const

This method maps stored value into the specified interval. The interval can be specified by three floating point values: two bounds and average point. Average point can be used to shift middle of the interval from its original position. It allows non-linear mapping, what is often required for good adjusting of speech parameters. There is no checking for relations between provided values. The middle point can lay outside of minimal and maximum bounds.

Parameters:
[in]minThe low bound of the interval to map into
[in]averThe average value of the interval to map into
[in]maxThe upper bound of the interval to map into
Returns:
The mapped value
const TextParam & TextParam::operator+= ( size_t  step)

This operator increments current value onto on specified step. It preserves from overflow and if step is too large maximum valid value will be assumed .

Parameters:
[in]stepThe step to change value for
Returns:
The reference to the current object
const TextParam & TextParam::operator-= ( size_t  step)

This operator decrements current value onto on specified step. It preserves from overflow and if step is too large minimum valid value will be assumed .

Parameters:
[in]stepThe step to change value for
Returns:
The reference to the current object
const TextParam & TextParam::operator= ( size_t  value)

This method sets new value of this object. It contains checking to validate specified argument. If received number too large the maximum value is used.

Parameters:
[in]valueThe new value to set
Returns:
The reference to the current object
void TextParam::reset ( )

Use this method to set value as in just created object (usually 50).