MCPcopy Create free account
hub / github.com/christophhart/HISE / getText

Method getText

hi_scripting/scripting/api/ScriptComponentWrappers.cpp:3158–3199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3156}
3157
3158String ScriptedControlAudioParameter::getText(float value, int) const
3159{
3160 if(vtc.active)
3161 {
3162 value = range.convertFrom0to1(value);
3163
3164 if(type == ScriptedControlAudioParameter::Type::ComboBox)
3165 value -= 1.0;
3166
3167 return vtc.getTextForValue((double)value);
3168 }
3169
3170
3171 switch (type)
3172 {
3173 case ScriptedControlAudioParameter::Type::Slider:
3174
3175 return String(range.convertFrom0to1(jlimit(0.0f, 1.0f, value)), 1);
3176 break;
3177 case ScriptedControlAudioParameter::Type::Button:
3178 return value > 0.5f ? "On" : "Off";
3179 break;
3180 case ScriptedControlAudioParameter::Type::ComboBox:
3181 {
3182 const int index = jlimit<int>(0, itemList.size() - 1, (int)(value*(float)itemList.size()));
3183
3184 return itemList[index];
3185 break;
3186 }
3187 case ScriptedControlAudioParameter::Type::Panel:
3188 {
3189 return String((int)range.convertFrom0to1(jlimit(0.0f, 1.0f, value)));
3190 }
3191
3192 case ScriptedControlAudioParameter::Type::Unsupported:
3193 default:
3194 jassertfalse;
3195 break;
3196 }
3197
3198 return String();
3199}
3200
3201float ScriptedControlAudioParameter::getValueForText(const String &text) const
3202{

Callers 15

rebuildMethod · 0.45
comboBoxChangedMethod · 0.45
clearLoggerMethod · 0.45
logMessageMethod · 0.45
recalculateInternalMethod · 0.45
OSCLoggerMethod · 0.45
textEditorTextChangedMethod · 0.45
resultButtonClickedMethod · 0.45
goToNextMatchMethod · 0.45
textEditorTextChangedMethod · 0.45
selectedRowsChangedMethod · 0.45
threadFinishedMethod · 0.45

Calls 5

jlimitFunction · 0.85
StringClass · 0.50
convertFrom0to1Method · 0.45
getTextForValueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected