Jamba Views / Text Edit

Text Edit

Text Edit

The purpose of this view is to manage a text parameter (GUIJmbParam<UTF8String>) that is handled like all other regular parameters:

  • like “regular” parameters, its value is exposed and reusable by other views (through its id)
  • the value can be part of the state (so automatically saved/restored when the plugin gets reloaded)
Tip

The VST SDK only handles VST parameters, which are defined as floats between 0.0 and 1.0. Jamba extends the notion of parameters and adds Jmb parameters which can be of any type (boolean, Strings, etc…)

Example

The XML defining the text edit (Source)

<view class="jamba::TextEdit" control-tag="Param_AudioInputLabelA" font="~ NormalFont" font-color="~ BlackCColor" origin="407, 33" size="140, 20" text-alignment="center" title="Input Label A"/>

The jmb param is defined this way (represents a UTF-8 string) (Source)

JmbParam<UTF8String> fLabelAParam;

The jmb param is initialized this way (Source)

fLabelAParam =
  jmb<UTF8StringSerializer>(ABSwitchParamID::kAudioInputLabelA, STR16("Label A"))
    .guiOwned() // only the GUI cares about this parameter
    .defaultValue("Input Label A")
    .add();