Derived from: BParameter
Declared in: be/media/ParameterWeb.h
Library: libmedia.so
Allocation: Constructor only
The BContinuousParameter class represents parameters whose values can vary along a continuous range. Examples include gain or equalizer controls, turntable pitch controls, and the like.
The default system theme implements BContinuousParameters as BSlider controls.
Call BParameterGroup::MakeContinuousParameter() to create a BContinuousParameter control.
You never create or delete a BContinuousParameter object yourself. Use the appropriate BParameterGroup functions to create these objects and add them to groups.
void GetResponse(response *response, float *factor, float *offset) void SetResponse(response response, float factor, float offset)
GetResponse() returns in response, factor, and offset the response type, factor, and offset currently in effect for the BContinuousParameter.
SetResponse() sets these values.
The response describes how the BContinuousParameter's value is displayed to me the user. For example, if your parameter is polynomial in scale, you may wish to record only the base value, and let the BContinuousParameter handle presenting the value to the user as a polynomial by raising the value to the power specified by factor before displaying the value on the screen.
Constant | Description |
---|---|
B_LINEAR | For every unit of change in the parameter's value, the displayed value also changes by 1. The factor should be 1. |
B_POLYNOMIAL | The factor is a power to which the control's value is raised before being displayed. |
B_EXPONENTIAL | The factor is the base; the displayed value is the factor raised to the power of the parameter's value. |
B_LOGARITHMIC | The factor is the base; the displayed value is the base factor logarithm of the parameter's value. |
The offset is added to the value after the transformation specified by response is computed, but before displaying the value.
If you wish the displayed value to be v2+1, you would use the following call:
SetResponse(B_POLYNOMIAL, 2.0, 1.0);
float MaxValue(void)
Returns the maximum possible value the BContinuousParameter can take, which was specified when the control was created. The value is in the units specified when the control was created, such as "dB" or "Hz."
float MinValue(void)
Returns the minimum possible value the BContinuousParameter can take, which was specified when the object was created. The value is in the units specified when the object was created, such as "dB" or "Hz."
float ValueStep(void)
Returns the granularity of values between MinValue() and MaxValue() supported by the hardware.
virtual type_code ValueType(void)
Return a type_code indicating the data type of the control's value; by default, this is B_FLOAT_TYPE.
Declared in: <be/media/ParameterWeb.h>
Constant | Description |
---|---|
B_LINEAR | For every unit of change in the parameter's value, the displayed value also changes by 1. The factor should be 1. |
B_POLYNOMIAL | The factor is a power to which the control's value is raised before being displayed. |
B_EXPONENTIAL | The factor is the base; the displayed value is the factor raised to the power of the parameter's value. |
B_LOGARITHMIC | The factor is the base; the displayed value is the base factor logarithm of the parameter's value. |
These values define the response type for a BContinuousParameter.
B_LINEAR indicates that the user interface will display the parameter's value as-is.
B_POLYNOMIAL displays the parameter's value raised to the factor power. For instance, if factor is 2, the displayed value would be the parameter's value squared.
B_EXPONENTIAL displays the factor raised to the power of the parameter's value. If the parameter's value is 3 and the factor is 2, the displayed value would be 23 or 8.
B_LOGARITHMIC displays the base factor logarithm of the parameter's value; if the factor is 10 and the parameter's value is 3, the displayed value would be log10(3).
The Be Book, in lovely HTML, for BeOS Release 4.
Copyright © 1998 Be, Inc. All rights reserved.
Last modified November 3, 1998.