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)


CKnob

1.0

CKnob (CRect &size, CControlListener *listener, int tag, CBitmap *background, CBitmap *handle, CPoint &offset);

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] source


~CKnob

1.0

~CKnob ();

Destroy a knob object. The bitmaps are destroyed if there is no more reference on it.

[source] source


draw

1.0

void draw (CDrawContext*);

Called when this control object needs to be drawed.

Called when there is a mouse-click inside this control object.

[source] source

See also :


mouse

1.0

void mouse (CDrawContext *pContext, CPoint& where);

Called when there is a mouse-click inside this control object.

See also :


onWheel

2.1

virtual bool onWheel (CDrawContext *pContext, const CPoint &where, float distance);

-


onKeyDown

2.2

virtual long onKeyDown (VstKeyCode& keyCode);

The user hits a key.


drawHandle

2.0

void drawHandle (CDrawContext *);

A subfunction for drawing the handle.

[source] source


setStartAngle

2.0

void setStartAngle (float val);

Sets the start angle of the knob.

val Angle in radian [0, 2 *PI[.

[source] source


getStartAngle

2.0

float getStartAngle ();

Returns the start angle of the knob.

return Angle in radian [0, 2 *PI[.

setRangeAngle

2.0

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] source


getRangeAngle

2.0

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.


valueToPoint

1.0

void valueToPoint (CPoint point);

Converts the current value to a point.

[source] source


valueFromPoint

1.0

float valueFromPoint (CPoint &point);

Converts a given point to the current value.

[source] source


setInsetValue

2.0

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.

setColorShadowHandle

2.0

void setColorShadowHandle (CColor color);

Sets the shadow color of the handle (when there is no pixmap assigned to the handle).

[source] source


setColorHandle

2.0

void setColorHandle (CColor color);

Sets the color of the handle (when no pixmap assigned to the handle).

[source] source


setHandleBitmap

2.1

void setHandleBitmap (CBitmap *bitmap);

Sets a new handle pixmap.

[source] source


setZoomFactor

2.1

void setZoomFactor (float val);

Sets the zoom factor for the shift mode (slower move).


getZoomFactor

2.1

float getZoomFactor ();

Returns the zoom factor.



Copyright ©2003 Steinberg Media Technologies GmbH. All Rights Reserved.