VoiceMan
|
The value of speech attribute. More...
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 TextParam & | operator+= (size_t step) |
Increments current value onto specified step. | |
const TextParam & | operator-= (size_t step) |
Decrements current value onto specified step. | |
const TextParam & | operator= (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. |
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.
TextParam::TextParam | ( | size_t | value | ) |
[in] | value | The initial value for new object |
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.
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.
[in] | min | The low bound of the interval to map into |
[in] | aver | The average value of the interval to map into |
[in] | max | The upper bound of the interval to map into |
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 .
[in] | step | The step to change value for |
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 .
[in] | step | The step to change value for |
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.
[in] | value | The new value to set |
void TextParam::reset | ( | ) |
Use this method to set value as in just created object (usually 50).