How to make it
-
@Jay Oh weird, I havent opened that snippet in like a year. but I just got to my computer and heres the base script for the presetbrowser in the pic above
HiseSnippet 1540.3ocsW80aaaCDWJMpnwacXEXOOP3mjWScs655FRQwRqSbavVRMpSSKPVQAiDsEWjHEDoZpQQ9Zrua6s8QXeC1tSjxRx1Ks0.SOjXd+m+tiGONJSFvTJYli6VGOKk439kdimIzQChnbgyA6439UdGRUZVFwP5IyRoJEKzw08ZOEI3t0lNEe+8O+DZLUDvpH43bhjGv9UdBWWQczt+BONdHMjcLOolz2e2CBjhAxXYNDOWyqmSJM3b5T1QTTrM7bbu99gbsLarlpYJPlmHCmMNRdgvH+IbE+rXFtnuyXvPFxNCh3wgiJ2qJGG2MGUsyulYm+MdGxC4yoWg.ecACRkF0w.2MtpPp+mQH4VKj1zDR2xabPFOUWwAimuv6.AjPlPAntdnXj0Yi+7FdCjfDBc2D54rgYvh4Z3+fd81l.+oyCa0Bfakl7NZF4n8e0nGeD4QjRMmxzCjIoRArvusgcaTGAjLTPhgA.BSwzOiJBigxiOzh.e28tDLaoHxIDcDijVHCYhLNjkoJDAcmg7PCUvqm1dHM.PwYs2lz9kJVV62.txZvg4h.MWJ.CRASwzAQfCLlPQljISHThJkEvmvYgVeUnLWDyELxjRCTnqIrU.rjXB.eiFcraA7KVFPisVZDUGAg3PdLa7L3jPBhMVMqQDiZqo6TfdXBF4WZ9Gtf0K2.ML8DtnPIkekyAH465ZjFfGcVN6+vVFjGPy2TwehLi3OArH.FktD1o00naZtJpPltZ4XcFWL0uemNOjb4bqjwz4Yh5JY7fQBahJBh3ZIcapgQChpmSvzucuMG.9vkqJaKM4qExzwk4EEAp7HJnpggdMYkYbtfq8qmYM3QgApPDagXc4LxVKLO0r5MP3d0kQUX+kVLB2cvNa.F6H9fAUUHNeeVC5Z03rUWytvXk53SpLMOF56XTkJXwjK355VhTbbs0hvRohiPc5OGfrES.yzCYh7CfJRL8ztsYOs.10LFa.V0QxEL2sejEWI2lzdmcZC+6JLTIp282kbge6eSfx2P+N3+A50KHMsq5BFvucS2CGfZR.P0KKv0QKgksVDkLIfw.plmBsbRj4JFAPr3yf6oJPmJcqBgCQwFXkxuLE3ydGzYsDmzQbEJ6Iz3blgUW..xi01xoBABhnhorPLPtbwfoQXbQDSTqlfqHVUI97trtaaDfVVi.7UrXVflE1YoREovrUvKFxjw9Ak2JrMbTFh1l0Nb.SOl8dMT0LWPra3R4gNcUowPUMl55bZCYMfPGxcH8sMxZzNtHlGiJCNozekVCKHVVGriE4QKafS60vAUs2ZX47yTllhUFqaLSLENncax81tRRCQq+A7RIgVpofpZ+JSaYuuXJ.ycikzvpaNp4Arp9tXwdsfBHUdOv7xVr..yzAlzyGubzlGmWPtP9Eqqpm6kZ1yE9cZ8gVaAdjrHqISVIOqwfiyqjMN2W1UonuHO4LVVYIVofvfQMm155eZSaEXFpolfRwAPO0mmxrqKZgGZ98xyl4XmJB90KOXOplhiqYoAxkxxzbLbb2i8NXdWyvaa4sGSctVlVHqs91wsktf6MKGsCSONbv02vyjHbd+7Qh+qzcmUMe7d617Ljiapmcroc1YO1DJztnEVLsyNOMCP3YjAwzTkkDtes+7EPifmUz75o4bMMqTjiynoo.uSvSCVZuhlkPNFt38Y4Sa4TD.OW7B9zH8fXdv43bmyipGGymB3o6FPsk7hxJLE9FhBvBZKfh4bAOTG43549GvtJhgFCW8sEONXogfgwukgXe3lyjiO9vx.JcZLHLNrqPw0yp+3jOiA06ckCp+oFh2xaDGtVe0w3FqHFghp+OhQ6yato29Sl.83qBvM8F9508sLeD2+BYtF5XdHEZbBkydGkmLFdUW.C7t.J3UX9dC7fkYcObMh.iYhvhE+C7YY1GW6ZY1ujoSBMHS9VaeO7AT2nfBDShh2KtE7vUXMouSQSDPOudc64j.uk6sAA31+NvY8Uqy8VCc990Pm6uF57CqgNOXMz4GWCc9oqTG7YzONWKSLGG.Bi1unapq69BJTYUTE57u.WHz88C
-
@pluginboi when opening the snippet is giving me this error
-
@Jay Do you have different sub Preset folders set up in your Userpreset project folder? and then edit this line to be the names of each folder
var presetFolders = ["Factory", "User"]; // update this with your actual folder names
-
@pluginboi Thanks a lot.
-
@pluginboi what to add, to make it show the selected preset on a label?
-
@Jay I figure it out
-
@pluginboi I was wondering if you know how to save a preset to a file because I'm using this and is not working
inline function onsaveOkControl(component, value)
{
Engine.saveUserPreset(presetNametoSave);
};
Content.getComponent("saveOk").setControlCallback(onsaveOkControl);any idea why?
Thanks in advance!!!
-
@Jay this is how i save them to the 'user' sub folder but you could get rid of the child folder to make it general. I found this in an old thread I think @Dan-Korneff posted about out so he may have more info if you're doing more customization
var pre_folder = FileSystem.getFolder(FileSystem.UserPresets).getChildFile("User"); function save(file) { Engine.saveUserPreset(file); } //// Save as Button inline function onSaveasBTNControl(component, value) { if (value) FileSystem.browse(pre_folder, true, "*.preset", save); PresetHandler.init(); populatePanel1(); UpdatePresetLabel(); }; Content.getComponent("SaveasBTN").setControlCallback(onSaveasBTNControl);
-
@pluginboi T h a n k Y o u
-
This is always showing one preset name behind it. Do you think you can help me with this?
note: it's doing it in both examplesnamespace UserPresetWidgets { inline function createPresetButton(name, x, y, up) { local widget = Content.addPanel(name, x, y); Content.setPropertiesFromJSON(name, { "width": 10, "height": 15, "saveInPreset": false, "allowCallbacks": "Clicks & Hover" }); widget.data.up = up; widget.setPaintRoutine(function(g) { g.setColour(this.data.hover ? 0xFF65B17c : 0xFF2C4433); g.fillTriangle([0, 0, this.getWidth(), this.getHeight()], this.data.up ? Math.PI/2 : 1.5 * Math.PI); }); widget.setMouseCallback(function(event) { this.data.hover = event.hover; if(event.clicked) { if(this.data.up) { convoLbl1.set("text", Engine.getCurrentUserPresetName()); Engine.loadNextUserPreset(true); } else { convoLbl1.set("text", Engine.getCurrentUserPresetName()); Engine.loadPreviousUserPreset(true); } } this.repaint(); }); return widget; }; } const var UpButton = UserPresetWidgets.createPresetButton("UpButton", 749, 10, true); const var DownButton = UserPresetWidgets.createPresetButton("DownButton", 736, 10, false); // ============== second attemp // next inline function onnextBtnControl(component, value) { convoLbl1.set("text", Engine.getCurrentUserPresetName()); Engine.loadNextUserPreset(true); }; Content.getComponent("nextBtn").setControlCallback(onnextBtnControl); // prev inline function onprevBtnControl(component, value) { convoLbl1.set("text", Engine.getCurrentUserPresetName()); Engine.loadPreviousUserPreset(true); }; Content.getComponent("prevBtn").setControlCallback(onprevBtnControl);
-
@Jay You have to load the preset first, then get the name, you have it the other way around
if(this.data.up) { // First load the preset Engine.loadNextUserPreset(true); // Then get the loaded preset name convoLbl1.set("text", Engine.getCurrentUserPresetName()); }
-
@ulrik Thank you so much, you're right