ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
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
8#ifdef __cplusplus
9extern "C" {
10#endif
11
18
20
21// Instances belong to their producer thread. Pass samples by value to renderers;
22// no mutable instance is shared with the presentation thread.
31
37typedef struct {
39 double seconds;
41 bool changed;
42 uint64_t next_frame_ns; // In the supplied timestamp domain; UINT64_MAX if suspended.
46
59
60asciichat_error_t animation_init(animation_t *animation, const char *name, animation_config_t config);
61void animation_destroy(animation_t *animation);
62void animation_reset(animation_t *animation);
63void animation_set_paused(animation_t *animation, bool paused);
64void animation_set_visible(animation_t *animation, bool visible);
65asciichat_error_t animation_set_speed(animation_t *animation, double speed);
66// Update at monotonic live timestamps or explicit export/test timestamps.
67// Clock changes are applied at the most recent update; update before changing controls.
69// For callers already supplying elapsed media time. Does not allocate or register an instance.
71
72struct digital_rain;
73struct test_pattern;
75typedef struct {
77 union {
78 struct {
79 double position;
81 } color;
82 // ANSI output is allocated; caller releases it with SAFE_FREE.
83 struct {
84 const char *input;
85 char **out;
87 } ansi;
88 struct {
90 int index;
91 bool cadence;
93 };
104
105#ifdef __cplusplus
106}
107#endif
Synchronized per-thread pending error stacks and value snapshots. SET_ERRNO pushes,...
unsigned int uint32_t
unsigned long long uint64_t
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
static bool size_t gotel_query_t * out
Definition queries.h:10
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)