Public Member Functions | |
double | getValue (double min, double aver, double max) const |
Returns the value mapped into specified interval. | |
size_t | getValue () |
Returns native (not amapped) parameter value. | |
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 (size_t value) | |
The constructor with initial value specification. | |
TextParam () | |
The default constructor. |
TextParam::TextParam | ( | size_t | value | ) |
[in] | value | The initial value for new object |
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 |
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.
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).