ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
video/anim/controller.h
Go to the documentation of this file.
1#pragma once
2
5#include <stdbool.h>
6#include <stdint.h>
7
14
16
17// Instances belong to their producer thread. Pass samples by value to renderers;
18// no mutable instance is shared with the presentation thread.
27
31typedef struct {
33 double seconds;
35 bool changed;
36 uint64_t next_frame_ns; // In the supplied timestamp domain; UINT64_MAX if suspended.
40
51
52asciichat_error_t animation_init(animation_t *animation, const char *name, animation_config_t config);
53void animation_destroy(animation_t *animation);
54void animation_reset(animation_t *animation);
55void animation_set_paused(animation_t *animation, bool paused);
56void animation_set_visible(animation_t *animation, bool visible);
57asciichat_error_t animation_set_speed(animation_t *animation, double speed);
58// Update at monotonic live timestamps or explicit export/test timestamps.
59// Clock changes are applied at the most recent update; update before changing controls.
61// For callers already supplying elapsed media time. Does not allocate or register an instance.
63
64struct digital_rain;
65struct test_pattern;
67typedef struct {
69 union {
70 struct {
71 double position;
73 } color;
74 // ANSI output is allocated; caller releases it with SAFE_FREE.
75 struct {
76 const char *input;
77 char **out;
79 } ansi;
80 struct {
82 int index;
83 bool cadence;
85 };
Synchronized per-thread pending error stacks and value snapshots. SET_ERRNO pushes,...
unsigned int uint32_t
Definition common.h:62
unsigned long long uint64_t
Definition common.h:63
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
static bool size_t gotel_query_t * out
Definition queries.h:8
animation_hidden_policy_t hidden_policy
For animation config, this is the live record that ties type, fps, speed, hidden_policy together....
animation_config_t config
struct animation_target_t::@105141136260326341273057264343342151154253073027::@021005305237221242221055207105224353364212233103 test_pattern
struct test_pattern * context
struct digital_rain * rain
animation_target_type_t type
Digital rain effect context.
test pattern is intentionally a small, concrete record. Fields such as image, rgba give callers the i...
asciichat_error_t animation_init(animation_t *animation, const char *name, animation_config_t config)
animation_hidden_policy_t
@ ANIMATION_HIDDEN_PAUSE
@ ANIMATION_HIDDEN_CONTINUE
void animation_destroy(animation_t *animation)
void animation_set_paused(animation_t *animation, bool paused)
@ ANIMATION_RAINBOW_FILTER
@ ANIMATION_DIGITAL_RAIN
@ ANIMATION_TEST_PATTERN
@ ANIMATION_SPLASH_RAINBOW
asciichat_error_t animation_apply(const animation_sample_t *sample, animation_target_t *target)
animation_target_type_t
@ ANIMATION_TARGET_COLOR
@ ANIMATION_TARGET_TEST_PATTERN
@ ANIMATION_TARGET_ANSI
void animation_reset(animation_t *animation)
asciichat_error_t animation_update(animation_t *animation, uint64_t timestamp_ns, animation_sample_t *out)
asciichat_error_t animation_sample_at(animation_config_t config, double seconds, animation_sample_t *out)
void animation_set_visible(animation_t *animation, bool visible)
asciichat_error_t animation_set_speed(animation_t *animation, double speed)