Loading spinner animation
-
@Matt_SF Thanks so much, waiting.
-
@Sawer IIRC : when loading new samples (i.e. by use of a button or menu) > start a timer which will get periodically the loading state. You'll get a value from 0.0 to 1.0 which you can use either to run a loading bar, or make a spinner run until the value is 1.0
-
@Matt_SF Thanks for answering, however I dont know if I got your answer right.
What's IIRC?
Where in the code should I implement this? C++ side or Hise IDE side?Maybe I should give more context of the outcome I'm thinking about:
For instance; User purchase product and installs it in the computer. Then the user opens the plugin in daw, it takes like 5/6 seconds to ask samples folder. After the user selected samples folder, it takes another 5/6 seconds again to show the alert window.
In between these waiting seconds, the spinning loadng progress will animate there.
Hope It is clear now. Thanks
-
@Sawer IIRC stands for "If I recall correctly"
You have to implement this in HISE. But the loading callback only fires when you change the sample content.
If it's not the case you'll have to find a way to implement a timer which will display a spinner according to something else.This is what the docs says about the loading callback :
https://docs.hise.audio/scripting/scripting-api/scriptpanel/index.html#setloadingcallback
To display a spinner when changin samples, you should write :
if(isPreloading) t.startTimer(x); else t.stopTimer();
In the timer you'll make the spinner move.
Edit: fixed typo
-
@Matt_SF typo in that code...
-
This is how I'm doing it https://codeberg.org/LibreWave/RhapsodyBoilerplate/src/branch/main/includes/Spinner.js
-
@DanH yeah I just tossed it like that to give an idea. It was not meant to be used as is . I just corrected it.
-
-
@clevername27 please do. I'm looking at adding lottie to my next project. I've only tinkered with it briefly in the past
-
@Dan-Korneff I have a video about using lottie in HISE (might only be available for Patrons at the mo though).
-
@d-healey I'm a subscriber :)
-
@Dan-Korneff Thanks :)
-
@clevername27 See my next post. There's a great example in the documentation, though, that shows you exactly how to do it. The short answer is, "manually" lol.
-
@clevername27 @d-healey @Matt_SF Thanks so much for replying here.
Should the code be implemented in "onInint" callback right?
-
-
@Sawer put anywhere in you UI script == can be on init or in an include file. Remember to defer your UI script :
https://docs.hise.audio/hise-modules/midi-processors/list/scriptprocessor.html#audio-thread-and-deferred-callbacks -
@Matt_SF @clevername27 @d-healey Thanks so much for the reply.
However, the loading of the samples appears to happen in C++ side(somewhere in Frontendhandler.cpp) , based on what Iām understanding. I tried to implement the code provided but I still think that I do not have a proper context of how to apply
Here below is a video:Hope the video explains my point .
-
@Sawer said in Loading spinner animation:
@Matt_SF @clevername27 @d-healey Thanks so much for the reply.
However, the loading of the samples appears to happen in C++ side
Well everything happens in C++ in the compiled plugin.
The loading callback is how you access it from the scripting API.
Not sure what your video is meant to show.
-
@d-healey Here is a better video, thanks. It takes lots to load and here I wanted to have the loading spinning bar. Great , check the loading callback then. Will ask further question if i get still problems. Thanks so much
-
@d-healey I tried loading up a simple panel and implementing the preloading method. and unfortunately it is not working because the sample location overlay is activated with the the sample location button, covering the preload panel. Is there anything i can do?