Paint routine driven by timer
-
I want a rectangle in a panel to move corresponding to an incrementing index, which is calculated in a timer callback. I use a paint routine function, which then repaints via
repaintImmediately()
inside the time callback.
But the repaint seems not to happen fast enough, so not each index will be displayed.
Is there a better solution?
Here's a snippet:HiseSnippet 1072.3ocsV0uaaaCDmxIpcxasnEnO.BEa.JatN1ocoCHXXo1IYyXMoF0cECHHHfQh1lHTjBRTMQXK.64XOM6QZuAa2QJYKm3klZf4+vPGuu9cev63vTUHKKSkRb7dWQBi37EtiJj5o8mR4Rxf8HNOz8PZllk5aOpWQBMKiEQbbV6GwCb7VmX982+POpfJCYyOhPduhGxdMOlqme5vc+YtPb.Mh8NdbMoewtCBUx9JgJGvyZtcHIzvyoSXGQQwZ3Rbt29QbsJcjlpYYfL8TQEilptPZk+87L9YBFRzkLBLj8XR+obQzvpXMiPbVe37HeMaj+D2C4Q7YmOOC7HCC+4ZTOG3z31fT2OAH4TCRqagzicGElxSzy4f34ycGHgBxXJjpqCEqrjF+4Zt8UfDRc6X54rCRAhYZDrcmNs7g+1XmlP1NS6+AZp+P4oCEzhehQiFpx7+d+JCLgo6qhSTRfH3oKJ1SWvD8zmhkyz+SkqD.UqYJahOWFwtDDu6NFRnIKAcc2sA9atoekm7GHyRXgPNt43bYnlqj9I0.avjMZ9aM8PLPA0WDiHFdsJjJ5oxkQYAXX6Mo8XnA7UBQfsYKq8YBnSyxJCAMd5LlSRYEVdQozKdK.kfiMX+qoGu0IaZvcqNspQPO94mbRK+s.stp40.DX+gPmk9spbMWxBpEJariuIxs4QniJUu4HsJoIWJ.Q8mE9JYUxDS0oJQPXUdtETLD4LSJgO1OnjxCH8L2ramg10nbPm1HD8tpoGSjw7WTJUhUHTBupZ0y5Zj+JnD8wpx1LoAd8oBwYPFN3F.GLdsn5Hkl8FYfA7Ply+5rFOdo7Jsk.A6RXWFFlLRYXDX+3a5twWgsadfExTBV6jTnxXYhg80JcorDrxMHNlEwgq6hh.SEdIXIPlGeFKsd0.EDtYu33h6c2FWDZy00DTIGH452jvJoOPIhvw.322b3BorXgiYJQHHp1Lj4gkCY5kq0JIgCFooaUYhXve8I5jeYvdTMsxRfQAGkvR0bLdb1i8AXhuc7km6drrygFIX38rVDhy8s98AUC2nRlv31G4tXBmb4LG+GGuawbT7k6pYWpQSf2dlBRm.ReAOROk33576NDxTFexTMRsEwD+ybu6cIruD07u.EKvORgOrd79tV9jaNrFVSnhxET8h6NvkjkLfNjEFXiCkkYbcQ8kneBKT5bqKTtqP7wtC45voKGiMVBFgR++GXrbM7Cb2e7XXF6b.tt6A+5pty8i3d6P3IGR0obrjeTd7HXleHC7tDZKyvpeCr+wR2AowLvHlLxP7OvuRlcQZmRlcqXRhogopSCs25vE8el4D.SRy6Z7fGXAz9cqtq451ocGRL7liSCCwv+YvU5kqyVqfNOeEz4EqfNe6Jny1qfNubEz46tUcvm68pbsJ1dc.NX39lYdNN6KoPmkoKj7uLIIKv.
-
@toxonic I would separate the synth tier from the panel. Generally you want the UI stuff to take care of themselves so my guess is to increment (do whatever) your variable in the synth timer, and create another timer for the panel to repaint at the UI refresh rate you desire
-
@toxonic Note that here I stop the panel timer, but you might want to stop the synth timer as well depending on your use case...
HiseSnippet 1176.3ocsV0taaaCEkJIZcVasnEXO.DEa.JqYJ1IcYCHnXt1IYyXMoBUcEEHKHfQhVhHzjBRT0wXH.8EZuC6QZuAaWJJYKmpjU3s4eX.d+RGdtGxK8yjgz7bYFxpyqmkRQVetcvLgJYXBgIPiN.Y8.6iI4JZF1XZvrTRdNMBYYs9OpMX0YCT4u+7GFP3DQHcgID5MRVH8ErIL0Bq98+YFmeDIh9Z1jFQ+z9iBkhgRtr.vy51cQojvKIwzSH5vVyFY8IGFwTxr.EQQyQVaLPFMKHQNUXh+Mrb1EbpdQOT.THi4ij7HMh0VQCSX7H+58cNBph+BVXcCK7E1GyhXysufMdXoC7hLZxGVqcWvqWS30sU30sM3Y0.daXf2irCByXopEdzX6yrGIfF0XBzBZBKSrn098MrGJgHDJuIjKoGkAKlm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