I cannot for the life of me figure this out. This project is coming from the Template project. No matter what I do, the last slider I make is the only one that moves. Even when I move the first two sliders, the last one moves. I don’t see how they are linked. I am sure it is something stupid. Thanks for any help.
Sam
//-----------------Graphics
GetParam(kParamGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
GetParam(kParamDurMult)->InitDouble("Dur Mult", 20., 2., 200.0, 1.0, "x");
GetParam(kParamTemp)->InitDouble("Temp", 0., 0., 10.0, 1.0, "nils");
#if IPLUG_EDITOR // http://bit.ly/2S64BDd
mMakeGraphicsFunc = [&]() {
return MakeGraphics(*this, PLUG_WIDTH, PLUG_HEIGHT, PLUG_FPS);
};
mLayoutFunc = [&](IGraphics* pGraphics) {
const IRECT bounds = pGraphics->GetBounds();
const IRECT innerBounds = bounds.GetPadded(-10.f);
const IRECT sliderBounds = innerBounds.GetFromLeft(150).GetMidVPadded(100);
const IRECT sliderBounds2 = innerBounds.GetFromLeft(350).GetMidVPadded(100);
const IRECT sliderBounds3 = innerBounds.GetFromLeft(550).GetMidVPadded(100);
const IRECT versionBounds = innerBounds.GetFromTRHC(300, 20);
const IRECT titleBounds = innerBounds.GetCentredInside(200, 50);
if (pGraphics->NControls()) {
pGraphics->GetBackgroundControl()->SetTargetAndDrawRECTs(bounds);
pGraphics->GetControlWithTag(kCtrlTagSlider)->SetTargetAndDrawRECTs(sliderBounds);
pGraphics->GetControlWithTag(kCtrlTagSlider2)->SetTargetAndDrawRECTs(sliderBounds2);
pGraphics->GetControlWithTag(kCtrlTagSlider3)->SetTargetAndDrawRECTs(sliderBounds3);
pGraphics->GetControlWithTag(kCtrlTagTitle)->SetTargetAndDrawRECTs(titleBounds);
pGraphics->GetControlWithTag(kCtrlTagVersionNumber)->SetTargetAndDrawRECTs(versionBounds);
return;
}
pGraphics->SetLayoutOnResize(true);
pGraphics->AttachCornerResizer(EUIResizerMode::Size, true);
pGraphics->LoadFont("Roboto-Regular", ROBOTO_FN);
pGraphics->AttachPanelBackground(COLOR_LIGHT_GRAY);
pGraphics->AttachControl(new IVSliderControl(sliderBounds, kParamGain), kCtrlTagSlider);
pGraphics->AttachControl(new IVSliderControl(sliderBounds2, kParamDurMult), kCtrlTagSlider2);
pGraphics->AttachControl(new IVSliderControl(sliderBounds3, kParamTemp), kCtrlTagSlider3);
pGraphics->AttachControl(new ITextControl(titleBounds, "Ness Stretch", IText(30)), kCtrlTagTitle);
WDL_String buildInfoStr;
GetBuildInfoStr(buildInfoStr, __DATE__, __TIME__);
pGraphics->AttachControl(new ITextControl(versionBounds, buildInfoStr.Get(), DEFAULT_TEXT.WithAlign(EAlign::Far)), kCtrlTagVersionNumber);
};
#endif