General Settings



  • I assume there's no way to add a entry to General Settings...

    I have a button to toggle analysers on and off which is currently saved to preset - annoying for the user but the alternative was worse. Would be nice to have it as a global setting...



  • Just fake it like I did with this Fine Tune slider

    fa84d5ab-7c99-4be3-98b2-1b8d3b240fe3-image.png



  • @d-healey it's more the functionality I want (nice slider tho!)

    The analysers are either Save in Preset or the default value whenever the plugin loads (so you might turn them off in a project with several instances, but when you reopen the project they're all back on again - or vice versa)

    Unless there's another way?!



  • @DanH said in General Settings:

    The analysers are either Save in Preset or the default value whenever the plugin loads

    What's that got to do with general settings?

    If you need to store a value outside the preset just write it to a file and read it back on init.



  • @d-healey That's a good idea 😆

    Need to learn how to do this anyway. Any examples to learn from?





  • @d-healey Thanks, so I'm able to write the file from my button callback (no doubt in a super long winded way 😆 )

    if (value == 1)
        {
            local data = 
            {
            "value": 1
            };
            Engine.dumpAsJSON(data, "../AnaData.js");
        }
        
        if (value == 0)
        {
            local data = 
            {
            "value": 0
            };
            Engine.dumpAsJSON(data, "../AnaData.js");
        }
    

    In the oninit callback I'm not really sure how to extract the info I need to get it to do what I want. Any guidance would be hugely appreciated 🙂

    inline function checkOnLoadANA()
        {
            local aData = Engine.loadFromJSON("../AnaData.js");
    
            Console.print(aData);
        }
    
    checkOnLoadANA();
    


  • If you're writing the same thing twice there is probably a way to write it only once.

    Engine.dumpAsJSON({"value":value}, "../AnaData.js");

    Try aData.value in your checkOnLoad function to get the value you saved.



  • @d-healey Thanks, not getting much joy from:

    if (aData.value == 1)
    
    do this etc
    

    Any idea what I'm doing wrong?



  • @DanH Snippet time



  • @d-healey thanks!

    HiseSnippet 1077.3ocuV0saaaCElJwpH1ctnEXO.b9JGfLOot9yvBBlcbbF7ViiwbWvtqfQh1hyRjBRTsyHvXOM6hc+.1E6MZW02ftCEkrjcTRS7vFMPBO+puygGdNbbjvgFGKhPF0e8hPJx3SLmrfK856QXbzvSPFOx7LRrjFg0rNdQHINl5hLL18aULLpWCktd+2bLwmvcnErPnKDLG5qXALYA2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xcSI9.rxDZqnMxDZmKDEPbhDuwQeqU8Hs8R4.Xhm99z5vCkAZ7pKqllVcrPAvaGeiiiJU74.1q1lmtE17kagMOaKr44agMuXKr4kagMe0sZi5Y68Rjh.80Dfw3AoMMMLFvIPUVZEI5e.A9GF4
    


  • First thing I saw. Your button is set to saveInPreset, this will trigger on init and overwrite any previous value in your file. Other than that your code would work fine if you made sure you had the right amount of curly braces - proper indentation would help.

    Here's how I'd do it.

    HiseSnippet 957.3ocsV0kaaaDDdWYyTS1pfDfd.HzSx.trToIoEMnnRVVNPswxBUoF8Mi0KWIt0K2kfboSELLPNJ8HjiPNO8odCRlk+HRqp3FH.yWrme914alclY0zDEkklpRPX6WuLlgvek0rkRc3vPBWhFeDB+PqSHoZVhagpCWFSRSYAHLdmWZTfs2Ek+8u+7gDAQRY0pPnyTbJ6U7HttV6z9+JWHNlDvdMOpg2Os+XpRNTITY.e1wxGESnWRVvlPLt0xBgevn.tVkLSSzrTDd2CUAKmEpdirv+y3o7KDLiPOzL3fJTerRDXXrQKZXHWDLsJuSQvoLstJrSQU3qsNgGvWoutZ7nbCt0HZVOvstK50qI87+7oGtA81sfdO1ZFMgGqqsX31WZMVBWTyIvUPSZU3Kp0aaYMTAdH0dQjKYGm.BqPz8499G39Le+8eQaG3ZHU6dEIwcJQxD8b+I2JjKX5gpnXkDD51ovbGCl1NbofKYtyyjTMWIcUxCyzZkrmAahRzkVA7.3rEYr8a6bsi8H4B.lWPVT7fzeY1oS5dcmbyc9w7+byAtcFHIGQzDu+LEhkicQX8RgRa0YWbf.OtImKaltk7oy9doF84HGRDhKf9rtqS2MmTzPF8xSkuRQBFLYPWSJz1wVnnDga.PQnTUlPBvEnFGkmRc7791++jvb.dkYhiMnMUIXdwIbf7Ms01wE9fb0vv0YzKZbALQoYmJ6tuoN6bii65llOei1J4ifkrQylw1j6BXWYVzErjpq4JGg92aOfX8oGPZN+RKtLa3nRNVx0mFyjepwFTYG.7e+9XSY2LIUpC7Klkn4FJfOhcErhpXtx15HV5kZULrsYUaCB+E5bqOrbpqnMAwCL.J6YP+0p8Xucd+kqDd+48eCOPGVukS1OjwWDVuOzk0OkbEarbZBCZKMSrnFAeuhf2tZj2z0jG68rJ5fZD59m0HzOJcsP+tqWOz+cPetlEUsx09AX7+3aLTq8IF0evF4Wr59+rJBVHpBxDD8s2RZdZnz.zYbq0QlUNxTtdYymNtWVc94R2GaMkqogalus1.egdo6a9V9PTaqQymyn5Zxtq0w+w8+qNneSko4xEmPzIbnAyZRVzLncfx.lHg1NyzKtkYNqP12HapLyXxfbgO.ekF6YjwkF6UYDEQnIpyoE6LLO0sWtFfSx7W7sge5AH61CkuGAvY464ihfWfOmRMkhuA39lw7js.y2sEXd5Vf4YaAlmuEX99s.yObmXL+3mAYZUTwXBnX5n7kqX7HIA5xx6HQeD.CuGMg
    


  • @d-healey Thank you 🙂


Log in to reply
 

9
Online

1.6k
Users

4.6k
Topics

42.5k
Posts