Jamba Views / Param Image

Param Image

Param Image

This view renders a parameter value as an image (the Param Display view renders a param value as a string). The image provided must be a filmstrip with each frame representing each value the param can have.

As a result, this view works for any parameter (both Vst and Jmb) that is (or can be interpreted as) a discrete parameter.

In addition to the attributes exposed by CustomDiscreteControlView, this class exposes the following attributes:

Attribute Description
image The image to use. It must be formatted as a filmstrip (similar to the various button views). This means that there should be one frame for each value the parameter can have. For example, for an on/off status LED, the parameter has 1 step (so 2 values) and as a result the image should have 2 frames.
inverse Inverses the frames (last frame is first frame, etc…)

The example above shows 2 LED lighs (A and B) driven by the same parameter. The A LED light is set to inverse.

Tip

This view can be used to render status LEDs for example and all other kinds of graphical representation of a parameter value

Example

The XML defining the 2 LED lights (Source)

<view back-color="~ TransparentCColor" class="jamba::ParamImage" control-tag="Param_AudioSwitch" image="Control_LEDLight" inverse="true" size="22, 24" step-count="-1" ... />
<view back-color="~ TransparentCColor" class="jamba::ParamImage" control-tag="Param_AudioSwitch" image="Control_LEDLight" inverse="false" size="22, 24" step-count="-1" .../>

The vst param is defined this way (Source)

// ESwitchState is an enum
VstParam<ESwitchState> fSwitchParam;

The vst param is initialized this way (Source)

fSwitchParam =
  vst<SwitchStateParamConverter>(ABSwitchParamID::kAudioSwitch, STR16 ("Audio Switch"))
    .defaultValue(ESwitchState::kA)
    .shortTitle(STR16 ("Switch"))
    .add();
Info

The device was written with an older version of Jamba and the SwitchStateParamConverter converter is no longer necessary (an EnumParamConverter could be used instead).