Sliderpack resize "issues"
-
@d-healey said in Sliderpack resize "issues":
You need to store the value of the additional sliders and restore them when the number changes. You can use a data object for this.
That‘s actually pretty hacky. A clean solution would be the possibility of defining a fixed upper limit and then the resizing would just change the pointer instead of reallocating new memory when you resize a slider pack.
This should be rather easy to implement, I‘ll see what I can do later.
-
@lalalandsynth here's what I'm using...
inline function onARPSLIDERSNUMBERControl(component, value) { local lastAmount = SliderPack5.get("sliderAmount"); for (i = 0; i < SliderPack4.get("sliderAmount"); i++) { SliderPack4Data[i] = SliderPack4.getSliderValueAt(i); } for (i = 0; i < SliderPack5.get("sliderAmount"); i++) { SliderPack5Data[i] = SliderPack5.getSliderValueAt(i); } SliderPack4.set("sliderAmount", value); SliderPack5.set("sliderAmount", value); Arpeggiator1.setAttribute(Arpeggiator1.NumStepSlider,value); if (lastAmount < value) { for (i = 0; i < SliderPack4.get("sliderAmount"); i++) { SliderPack4.setSliderAtIndex(i, SliderPack4Data[i]); } for (i = 0; i < SliderPack5.get("sliderAmount"); i++) { SliderPack5.setSliderAtIndex(i, SliderPack5Data[i]); } } NOTEAMOUNTLABEL.set("text", Math.round(value)); }; Content.getComponent("ARPSLIDERSNUMBER").setControlCallback(onARPSLIDERSNUMBERControl);
This was for two sliderpacks btw.
Would much prefer @Christoph-Hart's permanent solution however
-
Looks like Christoph's solution is ready :)
https://github.com/christophhart/HISE/commit/2b7471a257b3814949fcd8c5f855ca2ae29d4bfc
-
@d-healey Awesome!
-
@lalalandsynth so how do we implement this?
-
@DanH is it something like
Sliderpack1.setUsePreallocatedLength(16);
Assuming that our max limit of sliders is going to be 16?
-
Basically yes, but I haven't pushed the autocomplete yet (I did just now). I also made it accesible through the SliderPack class, not just the SliderPackData class like before.
-
@Christoph-Hart Thanks. I'm getting 'Unknown Function' error...
HiseSnippet 1158.3ocuW0sSiaDEdbHCcSnvBaWodazdEqJMJdWJcWUUUHPnMkEvByhVo8hsC1mjLBmYbsGSIspR8coOU8snuAsmw1I1ALYchn0WDk4727M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hCHJDfmM3AN5duytBnPi74zSiT9QpG.SsA8XqNXe8fwFKyHUJsQdr1HcDt2wDqWxxpko+.NoSAkj2cdVbpZoajm9Rp7iZqeSQJCbjsot8RO2pHDyhy+li4X96VEN+cgCjUR3tA0hqbFTLdqT.d0S38eLdmLWPmd8vroLvVkd36VzmtLGP4LYjhK5eLSEv0S2nu1EePGdUQRRU33Txz0sF202FDtsFWlmxzbbQflo4Xl3TaNAxO3jjOpeuzihofXRD+TwZ3aVw0MxFtk1ROrG9LtO33ncEeIh8h04EKfNubAzY6EPmuZAzYmEPmudAz4UyTG8Kn2KRIGlTlfDr5D+L.CijKhiyHI+6tvtFm
-
@DanH
SliderPack1
notSliderpack1
-
@d-healey doh!
-
@d-healey also is there a better way of controlling multiple sliderpacks from one SP than the below?
inline function onSliderPack5Control(component, value) { SliderPack12.setSliderAtIndex(value, component.getSliderValueAt(value)); SliderPack13.setSliderAtIndex(value, component.getSliderValueAt(value)); SliderPack14.setSliderAtIndex(value, component.getSliderValueAt(value)); SliderPack16.setSliderAtIndex(value, component.getSliderValueAt(value)); }; SliderPack5.setControlCallback(onSliderPack5Control);
I saw a linkTo API....
-
@DanH If you want them to be completely linked, so that changing one will always change the others, then you can use a data object.
HiseSnippet 879.3ocuVstaSCCE1taFQKWDCwCPz9Um.pZKitMgPqqWFTfsTsNXf3GSdItslkX243LnfPhGEdm3Eg2.33jrlTnL1pDjeT0yU+cN9juS5pjNrf.oBgyu+3QLD95jdiE5gMGR4BTmVH7MI6PCzLkUrpFiGQCBXtHLdgmXTfyuHJ546a1f5QENrTUHzqjbG1K39bcp1t0eN2yaapKaeteFuWsdGGonozSFB3YARYzHpywzArcoF2xQP3qz1kqkpdZplE.9zP5Nt2P46Ew9+Jd.+HOlQnBpGjnX0nlC4dtcOqVCPH7hcSq7Ehq76P1g6xmnOsCbqHCVoQjsGfycdPpxk.R3LPhDCokH8bT7Q5TKF7bMRGAbgzmBs5rPY2P+ddbWlpKz1.nPvXnqFmATtugIMk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