UIKnob

Undocumented in source.
class UIKnob : UIElement , IParameterListener {}

Constructors

this
this(UIContext context, FloatParameter param)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

clearCrosspoints
void clearCrosspoints()
Undocumented in source. Be warned that the author may not have intended to support it.
containsPoint
bool containsPoint(int x, int y)
Undocumented in source. Be warned that the author may not have intended to support it.
drawKnob
void drawKnob(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] dirtyRects)
Undocumented in source. Be warned that the author may not have intended to support it.
drawTrail
void drawTrail(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] dirtyRects)
Undocumented in source. Be warned that the author may not have intended to support it.
getBaseAngle
float getBaseAngle()

Max angle of the trail, fit for aaFillSector.

getCenter
vec2f getCenter()
Undocumented in source. Be warned that the author may not have intended to support it.
getMaxAngle
float getMaxAngle()

Min angle of the trail, fit for aaFillSector.

getMinAngle
float getMinAngle()

Min angle of the trail, fit for aaFillSector.

getRadius
float getRadius()
Undocumented in source. Be warned that the author may not have intended to support it.
getSubsquare
box2i getSubsquare()
getValueAngle
float getValueAngle()

Angle of the trail, fit for aaFillSector.

onAnimate
void onAnimate(double dt, double time)
Undocumented in source. Be warned that the author may not have intended to support it.
onBeginDrag
void onBeginDrag()
Undocumented in source. Be warned that the author may not have intended to support it.
onBeginParameterEdit
void onBeginParameterEdit(Parameter sender)
Undocumented in source. Be warned that the author may not have intended to support it.
onDraw
void onDraw(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] dirtyRects)
Undocumented in source. Be warned that the author may not have intended to support it.
onEndParameterEdit
void onEndParameterEdit(Parameter sender)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseClick
bool onMouseClick(int x, int y, int button, bool isDoubleClick, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseDrag
void onMouseDrag(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseExit
void onMouseExit()
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseMove
void onMouseMove(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onParameterChanged
void onParameterChanged(Parameter sender)
Undocumented in source. Be warned that the author may not have intended to support it.
onStopDrag
void onStopDrag()
Undocumented in source. Be warned that the author may not have intended to support it.
sensivity
float sensivity()
sensivity
float sensivity(float sensivity)

Sets sensivity.

Manifest constants

defaultSensivity
enum defaultSensivity;
Undocumented in source.

Static functions

angleConvert
float angleConvert(float angle)

Exists because public angle properties are given in a different referential, where 0 is at the top

Variables

LEDDepth
ushort LEDDepth;
Undocumented in source.
LEDDiffuseLit
RGBA LEDDiffuseLit;
Undocumented in source.
LEDDiffuseUnlit
RGBA LEDDiffuseUnlit;
Undocumented in source.
LEDDistanceFromCenter
float LEDDistanceFromCenter;
Undocumented in source.
LEDDistanceFromCenterDragged
float LEDDistanceFromCenterDragged;
Undocumented in source.
LEDRadiusMax
float LEDRadiusMax;
Undocumented in source.
LEDRadiusMin
float LEDRadiusMin;
Undocumented in source.
_mousePosOnLast0Cross
float _mousePosOnLast0Cross;
Undocumented in source.
_mousePosOnLast1Cross
float _mousePosOnLast1Cross;
Undocumented in source.
_param
FloatParameter _param;

The parameter this knob is linked with.

_pushedAnimation
float _pushedAnimation;
Undocumented in source.
_sensivity
float _sensivity;

Sensivity: given a mouse movement in 100th of the height of the knob, how much should the normalized parameter change.

_shouldBeHighlighted
bool _shouldBeHighlighted;
Undocumented in source.
animationTimeConstant
float animationTimeConstant;
Undocumented in source.
hasAlternateTrail
bool hasAlternateTrail;
Undocumented in source.
knobDiffuse
RGBA knobDiffuse;
Undocumented in source.
knobMaterial
RGBA knobMaterial;
Undocumented in source.
knobRadius
float knobRadius;
Undocumented in source.
litTrailDiffuse
RGBA litTrailDiffuse;
Undocumented in source.
litTrailDiffuseAlt
RGBA litTrailDiffuseAlt;
Undocumented in source.
numLEDs
int numLEDs;
Undocumented in source.
style
KnobStyle style;
Undocumented in source.
trailBaseAngle
float trailBaseAngle;
Undocumented in source.
trailMaxAngle
float trailMaxAngle;
Undocumented in source.
trailMinAngle
float trailMinAngle;
Undocumented in source.
trailOffsetX
float trailOffsetX;
Undocumented in source.
trailOffsetY
float trailOffsetY;
Undocumented in source.
trailRadiusMax
float trailRadiusMax;
Undocumented in source.
trailRadiusMin
float trailRadiusMin;
Undocumented in source.
unlitTrailDiffuse
RGBA unlitTrailDiffuse;
Undocumented in source.

Inherited Members

From UIElement

~this
~this()
Undocumented in source.
render
void render(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] areasToUpdate)
reflow
void reflow(box2i availableSpace)

Meant to be overriden almost everytime for custom behaviour. Default behaviour is to span the whole area and reflow children. Any layout algorithm is up to you. Children elements don't need to be inside their parent.

position
box2i position()
position
box2i position(box2i p)

Forces the position of the element. It is typically used in the parent reflow() method

child
UIElement child(int n)
Undocumented in source. Be warned that the author may not have intended to support it.
addChild
void addChild(UIElement element)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseClick
bool onMouseClick(int x, int y, int button, bool isDoubleClick, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseWheel
bool onMouseWheel(int x, int y, int wheelDeltaX, int wheelDeltaY, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseMove
void onMouseMove(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onBeginDrag
void onBeginDrag()
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseDrag
void onMouseDrag(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onStopDrag
void onStopDrag()
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseEnter
void onMouseEnter()
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseExit
void onMouseExit()
Undocumented in source. Be warned that the author may not have intended to support it.
onKeyDown
bool onKeyDown(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
onKeyUp
bool onKeyUp(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
mouseClick
bool mouseClick(int x, int y, int button, bool isDoubleClick, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
mouseRelease
void mouseRelease(int x, int y, int button, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
mouseWheel
bool mouseWheel(int x, int y, int wheelDeltaX, int wheelDeltaY, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
mouseMove
void mouseMove(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
keyDown
bool keyDown(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
keyUp
bool keyUp(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
animate
void animate(double dt, double time)
Undocumented in source. Be warned that the author may not have intended to support it.
context
UIContext context()
Undocumented in source. Be warned that the author may not have intended to support it.
isVisible
bool isVisible()
Undocumented in source. Be warned that the author may not have intended to support it.
setVisible
void setVisible(bool visible)
Undocumented in source. Be warned that the author may not have intended to support it.
zOrder
int zOrder()
Undocumented in source. Be warned that the author may not have intended to support it.
setZOrder
void setZOrder(int zOrder)
Undocumented in source. Be warned that the author may not have intended to support it.
setDirtyWhole
void setDirtyWhole()

Mark this element as wholly dirty.

setDirty
void setDirty(box2i rect)

Mark a part of the element dirty. This part must be a subrect of the _position.

parent
UIElement parent()
topLevelParent
UIElement topLevelParent()
isMouseOver
bool isMouseOver()
Undocumented in source. Be warned that the author may not have intended to support it.
isDragged
bool isDragged()
Undocumented in source. Be warned that the author may not have intended to support it.
isFocused
bool isFocused()
Undocumented in source. Be warned that the author may not have intended to support it.
getDrawList
void getDrawList(AlignedBuffer!UIElement list)

Appends the Elements that should be drawn, in order. You should empty it before calling this function. Everything visible get into the draw list, but that doesn't mean they will get drawn if they don't overlap with a dirty area.

onDraw
void onDraw(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] dirtyRects)

Draw method. You should redraw the area there. For better efficiency, you may only redraw the part in _dirtyRect. diffuseMap and depthMap are made to span _position exactly, so you can draw in the area (0 .. _position.width, 0 .. _position.height)

onAnimate
void onAnimate(double dt, double time)

Called periodically. Override this to create animations. Using setDirty there allows to redraw an element continuously (like a meter or an animated object). Warning: Summing dt will not lead to a time that increase like time. time can go backwards if the window was reopen. time is guaranteed to increase as fast as system time but is not synced to audio time.

_parent
UIElement _parent;

Parent element. Following this chain gets to the root element.

_position
box2i _position;

Position is the graphical extent An Element is not allowed though to draw further than its _position.

_children
AlignedBuffer!UIElement _children;
Undocumented in source.
_visible
bool _visible;

If _visible is false, neither the Element nor its children are drawn.

_zOrder
int _zOrder;

By default, every Element have the same z-order Because the sort is stable, tree traversal order is the default order (depth first).

From IParameterListener

onParameterChanged
void onParameterChanged(Parameter sender)

Called when a parameter value was changed You'll probably want to call setDirtyWhole() or setDirty() in it to make the graphics respond to host changing a parameter.

onBeginParameterEdit
void onBeginParameterEdit(Parameter sender)

Called when a parameter value start being changed due to an UI element

onEndParameterEdit
void onEndParameterEdit(Parameter sender)

Called when a parameter value stops being changed

Meta