ASPiK SDK
|
CAnimKnob
The most common control we will use is the Animation Knob control. The C++ class name is CAnimKnob. This knob is animated when the user clicks and drags the mouse over it. The animation is provided in the graphics file in a vertical strip-animation format. This type of file is easily related to a piece of movie film which is made up of a vertical sequence of individual pictures, each showing the scene in a slightly different position. For the CAnimKnob, this graphic file consists of a vertical set of images that shows the knob in a slightly different position starting from the lowest setting and moving to the highest setting.
The figure on the left depicts a graphics file for the CAnimKnob object. For this example we observe:
• The width is the width of the graphics file in pixels
• The height is the height of a single knob image in pixels
• Both width and height describe the outer square that encloses the knob image and not the knob portion alone; we call that outer square a cell
• This example has five (5) sub-image components (cells) that shows the knob in five different settings from low to high
When you setup the knob in the GUI designer, you will drag and drop a CAnimKnob object onto the canvas. You will then need to set the following parameters in the control’s attribute fields:
• size: the width and height of a single cell, separated by a comma (e.g. 42,42)
• height-of-one-image: the height of a cell value only (e.g. 42)
• sub-pixmaps: the number of cells in the animation strip (5 here)
• bitmap: the name of the PNG graphic file associated with the control
• zoom-factor: the fine-tuning factor used when the user holds the modifier key while dragging the mouse; the higher this value, the less the knob will rotate as you drag the mouse
• control-tag: the controlID value that links this control to a plugin parameter
You will notice there are many more CAnimKnob attributes that you may set in the GUI designer such as opacity and tool-tip text. You may experiment with these as you wish. Our animation knob objects will all have identical sizes for one image (42,42) and will have the same number of sub-pixmaps (80). These settings produce reasonably good-sized knobs with enough animation cells to produce a fluid, continuous animation without clicking or glitches in the motion.