Countdowns - OpenSlides/OpenSlides GitHub Wiki
Countdowns are used for counting down time on projectors. Mostly related to a speaker, which time is limited.
Countdowns have three fields, which indicates the state of the countdown:
-
reset:
running
is false andcountdown_time==default_time
-
started (or running):
running
is true andcountdown_time!=default_time
-
stopped (or paused):
running
is false andcountdown_time!=default_time
The default_time
holds the time in seconds a fresh started countdown should have. If default_time == 0
, the countdown should be counting up instead of down and should be displayed in black.
countdown_time
is different:
- In the reset state, it is equal to
default_time
, so it mostly holds a small number (like 60). This is used to differentiate this state to the stopped one. - In the stopped state
countdown_time
holds the remaining seconds - In the running state
countdown_time
holds a unix-timestamp of the date where the countdown will reach 0.
To get the current countdown time in seconds for a running countdown, you have to subtract the current time from countdown_time
.
Countdowns are not directly controlled by the server (there are no dedicated actions). The client controls the countdown with projector_countdown.update
since the client can update running
and countdown_time
.
A meeting has two special countdowns: The list of speaker countdown (meeting/list_of_speakers_countdown_id
) and the poll countdown (meeting/poll_countdown_id
). Both countdowns are almost like "normal" countdowns, but they cannot be deleted and are auto-created when a meeting gets created. They are used for the LOS/voting respectively. The coupling is controlled with meeting/list_of_speakers_couple_countdown
and meeting/poll_couple_countdown
.
Set running
to true and countdown_time
to countdown_time + current_timestamp
. Since countdown time holds the remaining seconds in the reset or stepped state, default_time
must not be used.
Set running
to false and countdown_time
to countdown_time - current_timestamp
.
Set running
to false and countdown_time
to default_time
.
Set running
to true (the countdown may not be started before) and set the countdown_time
to default_time + current_timestamp
.