The Media Kit Table of Contents | The Media Kit Index |
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.
|
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);
|
For example, a BContinuousParameter that selects a frequency between 20 Hz and 20,000 Hz might use a range from 0 to 3, with an exponent base of 10 and a multiplication factor of 20. In this case, the parameter will receive values from 0.0 to 3.0, which the UI control knows to map to the values 20 through 20,000 for display purposes.
|
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."
|
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."
|
Returns the granularity of values between MinValue() and MaxValue() supported by the hardware.
|
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 Media Kit Table of Contents | The Media Kit Index |
Copyright © 2000 Be, Inc. All rights reserved..