CKnob
#include <vstcontrols.h>
class CKnob : public CControl;
Define a knob with a given background and foreground handle. The handle
describes a circle over the background (between -45deg and +225deg). By
clicking Alt+Left Mouse the default value is used. By clicking Alt+Left Mouse
the value changes with a vertical move (version 2.1)
Create a knob with a given size, listener, tag and pixmap.
size |
The coordinates of the enclosing rectangle, relative to the parent frame. |
listener |
The object responsible for handling events in this control. |
tag |
The index of this control. |
background |
The background pixmap.It can be the same as the background of the frame where
this control is added. |
handle |
The handle pixmap, drawn with transparency. |
offset |
Indicates an offset in the background pixmap for the region to display. |
source
~CKnob ();
Destroy a knob object. The bitmaps are destroyed if there is no more reference
on it.
source
Called when this control object needs to be drawed.
Called when there is a mouse-click inside this control object.
source
See also :
-
The
CControlListener
's valueChanged
method which is called when the value has changed.
Called when there is a mouse-click inside this control object.
See also :
-
The
CControlListener
's valueChanged
method which is called when the value has changed.
-
The user hits a key.
A subfunction for drawing the handle.
source
void setStartAngle (float val);
Sets the start angle of the knob.
val |
Angle in radian [0, 2 *PI[ . |
source
float getStartAngle ();
Returns the start angle of the knob.
return |
Angle in radian [0, 2 *PI[ . |
void setRangeAngle (float val);
Sets the angle's range of the knob.
val |
Angle in radian ]-2 *PI, 2 *PI[ . The value is positive for a
clockwise and negative for an anti-clockwise knob. |
source
float getRangeAngle ();
Returns the angle's range of the knob.
return |
Angle in radian ]-2 *PI, 2 *PI[ . The value is positive for a
clockwise and negative for an anti-clockwise knob. |
void valueToPoint (
CPoint point);
Converts the current value to a point.
source
float valueFromPoint (
CPoint &point);
Converts a given point to the current value.
source
void setInsetValue (int val);
Sets the inset value of the handle in the knob.
return |
Angle in radian ]-2 *PI, 2 *PI[ . The value is positive for a
clockwise and negative for an anti-clockwise knob. |
void setColorShadowHandle (
CColor color);
Sets the shadow color of the handle (when there is no pixmap assigned to the
handle).
source
void setColorHandle (
CColor color);
Sets the color of the handle (when no pixmap assigned to the handle).
source
void setHandleBitmap (
CBitmap *bitmap);
Sets a new handle pixmap.
source
void setZoomFactor (float val);
Sets the zoom factor for the shift mode (slower move).
float getZoomFactor ();
Returns the zoom factor.