MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / TargetControlUpdated

Method TargetControlUpdated

Source/SongBuilder.cpp:1012–1031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1010}
1011
1012void SongBuilder::SongScene::TargetControlUpdated(SongBuilder::ControlTarget* target, int targetIndex, bool wasManuallyPatched)
1013{
1014 IUIControl* control = target->GetTarget();
1015 if (control != nullptr)
1016 {
1017 if (!target->mHadTarget)
1018 {
1019 mValues[targetIndex]->mFloatValue = control->GetValue();
1020 mValues[targetIndex]->mBoolValue = control->GetValue() > 0;
1021 mValues[targetIndex]->mIntValue = (int)control->GetValue();
1022
1023 mValues[targetIndex]->UpdateDropdownContents(target);
1024 }
1025 }
1026 else if (wasManuallyPatched) //user intentionally deleted connection
1027 {
1028 mValues[targetIndex]->CleanUp();
1029 mValues.erase(mValues.begin() + targetIndex);
1030 }
1031}
1032
1033void SongBuilder::SongScene::Draw(SongBuilder* owner, float x, float y, int sceneIndex)
1034{

Callers 2

PostRepatchMethod · 0.80
LoadStateMethod · 0.80

Calls 4

CleanUpMethod · 0.80
GetTargetMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected