XYPad initial setValue



  • I have a XYPad and I want it to remember last used value when it's initialised, both the cursors position and of course the x & y values, I can't for my life get this to work.
    Any tip how I should think to set it up the right way?

    HiseSnippet 1756.3ocsX01aaaCDVJIZq1qFXEaeZeXfPXnPowwU1INoufhlVm3trkjZTm0kfthBEIZYhHKZHQGa017uZ+v1+fs6njrjbryRCPErAD4w63yc7gm3wNAbaZXHOPQszwQCoJp2Uqajuneq9VLek82UQ8a0N4zNVNJuLZnUXH0QQUc4WgBUKshh74ed9Ks7r7soYcon7VNyld.a.Sj0amc9clmWaKG5wrA4F8l6ruM2uE2iOB.xxZlJCsrO2xkdjENrkzTT+l8bXBdPWgkfFpntxK4NQc6yG6GO92xBYm4QwF0U5BFJt61bOGDwXuJs5y7b5j5vgJfU5j49KG69+n1gLG1z9yBCeuT.ISi7wC0ktN3UOO7Lu4vSMG7VIFd2Sqqc.anHSBhsuSaeeAMnmErDjGVwiUYo+9tZs3vH7E0FXcNsc.zXpFFaYZVkzzzb0mVobkxO7gDhbAmPHqeiepTFV.CEjKrBh0tiuG4YjzY0kJZwGLj6CMLzSGfd1L1kJBIh9Thc.OLjXIHLelnR4SNsE1gQpJnk9SlinuwpjGRZTkjWvuRYt8EwRhM8TogTQGXkT7F9HAymZzajusfw8MbWsR4OUoL3rDDGgvhHkLzxm5ERFiSDwx2gzWZY.SnCxrNCjFqC5uiAGUzmElCaOMSZ+bRSAXh3rocHhMo+KmZRsq6ISsyfcItA7Q.BskadpTtjasdvdrW34YjNqF5m4Fu2ReUbpKA+.swYqW.rAqZhxRO0ChNgyNefQg.3qBrbXvBXav9FuKy5LAcPp8qRLk+lmzFIhmMZ7.yZMeuDXt0bBrF+Fpsv3clUMqNtZ+2WMdsLQ1A3hGXiwUg.6CHl0ZzL+a4bYdfCMnK6izDmdA52L2Ke4Zucy7u8Eou72MSiwS8ur2L+h0uoYp9MMuM5u8z4e6u34G07FnSLwjfJlOY.PKywz6wCh2ovYXJrT1YLGyP2bRSHWVa3QeVbHmYG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.v68HQ.PgKTqMVOsOj2OJ+8h7U4dAtov8dZcXB69yGuKMG7BL0u13M4VVpnsWudPYdYfcEs1m70+JUThq+2ENXR.CoRGMZPWfiZSAj3iE8iTmkvDBwsMw1XjoK02Q13egmDg0w1pIBqmJTYfET2xGriSif2iycj8.XxWdcVkzNDaSpml8PSCN2ix.lC6C11XnXc.6yWmF2Bc13Vnyl2BcZdKzYqagNaeKz4QWqN3M68hQB9f3sIPGc1Sl5VUcuzDEpKq7eQsZ35C
    


  • You were almost there. What you need to do is to use the actual setValue() call in the mouse callback so that the value gets propagated through the HISE restore system.

    Be aware that you can not only pass numbers into this call but also full JSON objects like in this case. We duplicate the reference to it in the Panel.data object so it will be kept around.

    HiseSnippet 2110.3ocsXs2aabiDeWmrWq0c9PKP+q9GGHVb3t0wxJqjshSSPQSheznbwIBUooInsnfdWJIVuhTXWpG6k5OD8aZ+Fb2Lj6SY4TGCDA2zkjyL72vY37f8ikArjDYrk8luJcJyx9u4LHUnFe3XJWX06HK6Ow4MusOMz5IoSoIIrPKa6a8s3h1adaK8u+3adBMhJBXkSYY8ZIOf8b9Dtpb19O5+vihNgFxdEeREp2+Q8BjhCkQxY.Ptkiu0TZv4zQrWPQx1vwx9ubbHWIiGnnJVhk8sehLLcvX4Bgg9WyS3mEwvAssF.BxL8IxnPDw3rVGNlGE1OWgSr.ozuT8ukQ8+BmS4g7h4KOF9L8BjRNpddXuw6CdsqBO+qO7rq.uaaf2m6LHHlOUUtBhs+pSOghEOjBlfpvxPq0F+9e24PIPgP0ZB8b1IwvfBN7tmueSRWe+se3VM1pAXHRTj4zXh1r2WDQ9ZRN2iXpCkSlJEv.O2bBbMbd26RdbXHgRRlcl7rekEnHJIQMlQBoJX1HohrXLOXLYA3EPNiQLHUyIPYBS8ZZzLl21a0HWzsPVaMGmFfw6t3gqcoVKAFg08a08JHH8OifkvpEyCpom6BdnZr61j6R5bUB8R7LlwGMVUvTE1.kqO3Jo9N4LEWv7FNSDn3Rg2HPae2VMH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• @Christoph-Hart Ahh, thank you, well explained!
    It is a bit of a brain hurt but I think I've got it now 🙂


Log in to reply
 

8
Online

553
Users

2.1k
Topics

16.4k
Posts