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

Method setValue

hi_scripting/scripting/api/ScriptComponentWrappers.cpp:3098–3123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3096}
3097
3098void ScriptedControlAudioParameter::setValue(float newValue)
3099{
3100 if (scriptProcessor.get() != nullptr)
3101 {
3102 bool *enableUpdate = &dynamic_cast<MainController*>(parentProcessor)->getPluginParameterUpdateState();
3103
3104 if (enableUpdate)
3105 {
3106 ScopedValueSetter<bool> setter(*enableUpdate, false, true);
3107
3108 const float convertedValue = range.convertFrom0to1(newValue);
3109 const float snappedValue = range.snapToLegalValue(convertedValue);
3110
3111 if (!lastValueInitialised || lastValue != snappedValue)
3112 {
3113 lastValue = snappedValue;
3114 lastValueInitialised = true;
3115 scriptProcessor->setAttribute(componentIndex, snappedValue, sendNotificationAsync);
3116 }
3117 }
3118 }
3119 else
3120 {
3121 //jassertfalse;
3122 }
3123}
3124
3125float ScriptedControlAudioParameter::getDefaultValue() const
3126{

Callers 6

SliderWrapperMethod · 0.45
updateComponentMethod · 0.45
labelTextChangedMethod · 0.45
timerCallbackMethod · 0.45
listBoxItemClickedMethod · 0.45
returnKeyPressedMethod · 0.45

Calls 4

getMethod · 0.45
convertFrom0to1Method · 0.45
snapToLegalValueMethod · 0.45
setAttributeMethod · 0.45

Tested by

no test coverage detected