rev |
line source |
nuclear@0
|
1 #ifndef DSYS2_H_
|
nuclear@0
|
2 #define DSYS2_H_
|
nuclear@0
|
3
|
nuclear@0
|
4 #include <stdio.h>
|
nuclear@0
|
5
|
nuclear@0
|
6 struct dsys_demo;
|
nuclear@0
|
7 struct dsys_event;
|
nuclear@0
|
8
|
nuclear@0
|
9 typedef float demotime_t;
|
nuclear@0
|
10
|
nuclear@0
|
11 enum dsys_evtype {
|
nuclear@0
|
12 DSYS_SINGLE,
|
nuclear@0
|
13 DSYS_PERIODIC
|
nuclear@0
|
14 };
|
nuclear@0
|
15
|
nuclear@0
|
16
|
nuclear@0
|
17 struct dsys_demo *dsys_open(const char *fname);
|
nuclear@0
|
18 struct dsys_demo *dsys_open_stream(FILE *fp);
|
nuclear@0
|
19 void dsys_close(struct dsys_demo *demo);
|
nuclear@0
|
20
|
nuclear@0
|
21 void dsys_update(struct dsys_demo *demo, demotime_t tm);
|
nuclear@0
|
22
|
nuclear@0
|
23
|
nuclear@0
|
24 void dsys_start(struct dsys_demo *demo);
|
nuclear@0
|
25 void dsys_stop(struct dsys_demo *demo);
|
nuclear@0
|
26 int dsys_is_running(struct dsys_demo *demo);
|
nuclear@0
|
27
|
nuclear@0
|
28
|
nuclear@0
|
29 demotime_t dsys_duration(struct dsys_demo *demo);
|
nuclear@0
|
30 demotime_t dsys_time(struct dsys_demo *demo);
|
nuclear@0
|
31 float dsys_progress(struct dsys_demo *demo);
|
nuclear@0
|
32
|
nuclear@0
|
33 /* seek without continuity */
|
nuclear@0
|
34 void dsys_seek(struct dsys_demo *demo, demotime_t tm);
|
nuclear@0
|
35 void dsys_seek_norm(struct dsys_demo *demo, float t);
|
nuclear@0
|
36
|
nuclear@0
|
37 /* seek by accelerating time */
|
nuclear@0
|
38 void dsys_warp(struct dsys_demo *demo, demotime_t tm);
|
nuclear@0
|
39 void dsys_warp_norm(struct dsys_demo *demo, float t);
|
nuclear@0
|
40
|
nuclear@0
|
41
|
nuclear@0
|
42 /* events */
|
nuclear@0
|
43 struct dsys_event *dsys_event(struct dsys_demo *demo, const char *name);
|
nuclear@0
|
44
|
nuclear@0
|
45 enum dsys_evtype dsys_event_type(struct dsys_event *ev);
|
nuclear@0
|
46 float dsys_event_value(struct dsys_event *ev);
|
nuclear@0
|
47
|
nuclear@6
|
48 int dsys_event_callback(struct dsys_event *ev, void (*func)(struct dsys_event*, void*), void *cls);
|
nuclear@6
|
49 int dsys_event_link(struct dsys_event *ev, float *link);
|
nuclear@0
|
50
|
nuclear@5
|
51 /* event evaluators */
|
nuclear@5
|
52 float dsys_eval_step(struct dsys_event *ev, demotime_t t);
|
nuclear@5
|
53 float dsys_eval_lerp(struct dsys_event *ev, demotime_t t);
|
nuclear@5
|
54 float dsys_eval_sigmoid(struct dsys_event *ev, demotime_t t);
|
nuclear@0
|
55
|
nuclear@0
|
56 /* time conversion */
|
nuclear@0
|
57 demotime_t dsys_sec_to_dtime(float sec);
|
nuclear@0
|
58 demotime_t dsys_msec_to_dtime(unsigned long msec);
|
nuclear@0
|
59
|
nuclear@0
|
60 float dsys_dtime_to_sec(demotime_t tm);
|
nuclear@0
|
61 unsigned long dsys_dtime_to_msec(demotime_t tm);
|
nuclear@0
|
62
|
nuclear@0
|
63
|
nuclear@0
|
64 #endif /* DSYS2_H_ */
|