Queue animations or be able to know when an animation ended

Case:
For an automatic ranking template (sport) I need to update the current ranking of a participant based on his current running time and show who s immediately before him (faster) and who’s the one closer to him on time (but still to reach -slower).
I made all the logic with a timer calculating when to override the data, but apparently on data received by caspar, the animation it is not always triggered and therefore visible.

I assume that since multiple update commands could be reached almost at the same time, caspar does not manage to cue them to show them on after another.
I try to put some sleep time on the code to help, but since it is a random error…it is quite difficult to say if it improved things or not.

Is it a right thinking? Do you have any idea or experience on it or native method that Caspar has to solve this situation?

Thanks in advance

F.

To understand your use case I would need to know, why these updates come in at the same time. Do you have multiple programms that sends these updates? I usuallly do it like so, that I only have one program, that sends updates to a template. This helps, that the template is not flooded with data.

Caspar will ship the updates first in - first out. If you want to queue them you need to handle that in the template.

Simplest for this case would probably be to only update if the new value is greater than the old value (e.g. you don’t need to show anything in between, just the highest/latest value).

If you have an issue with animations it’s probably because the animation is running (perhaps you change out the class on the elements) and will not restart if you change the class while it’s running (you’d need to remove and add the class again).

Also - if you are doing a lot of updates to templates it’s much better to talk straight to the template with Websockets than going through AMCP.

Hello didi!
1 program only sending updates. But it could happen that multiple people pass at the same point almost at the same time and therefore multiple transactions are received and new update triggered with new related data (this could happen even in a few hundreds of a second gap).
This is not a problem if it is only the text to be updated, but it is if it includes also shapes as BG or extremely short animations…apparently.

Hello,
Thanks for the feedback.
I will try to do that

If you have an issue with animations it’s probably because the animation is running (perhaps you change out the class on the elements) and will not restart if you change the class while it’s running (you’d need to remove and add the class again).

in the next few days :slight_smile:
Hopefully will work!

F.

That multiple update problem can be avoided by triggering a timer, that, after a short period of time, like 100ms, updates all changes in one update command.

2 Likes

I have a pretty similar scenario, for me works fine to have a xml file with all the race data and send via client only the position or the number of the participant.
All the logic is inside the template, like reading the file in fixed interval and update accordingly what’s on screen

You need to build some kind of a queue - no matter:

  1. in software that counts everything and send this to Caspar
  2. in Caspar. Flash language - Action script is quite powerful to handle that

Also you need to perform a “roll” - like in movies, but - a few lines on the screen: first is locked, others is scrolling by latest passes