XXX: Program is a sequence of actions duration a perior. Actions are grouped into words. A program defines the order and time of playing of words. A word defines how long to perform a set of actions. Actions in a word are performed concurrently.
Animation shapes are updated periodically. Every action are working with start, step, and stop 3 calls. start is called when start time the word, contain it, due. step is called periodically in duration of playing time start at 'start time'. When the clock run out the playing time of a word, it call stop of actions in the word.
A program is driven by a timer. Once a program is started, it registers with timer for periodic running. mb_tman_t is timer of MadButterfly. The update frequence is 10fps by default, now.
progm = mb_progm_new(10, &rdman); MB_TIMEVAL_SET(&start, 0, 0); MB_TIMEVAL_SET(&playing, 1, 0); word = mb_progm_next_word(progm, &start, &playing); act = mb_shift_new(50, 50, coord1, word); act = mb_shift_new(-50, 50, coord2, word); MB_TIMEVAL_SET(&start, 1, 0); MB_TIMEVAL_SET(&playing, 2, 0); word = mb_progm_next_word(progm, &start, &playing); act = mb_shift_new(0, 20, coord1, word); act = mb_shift_new(0, -20, coord2, word); act = mb_visibility_new(VIS_HIDDEN, coord3, word); gettimeofday(&tv, NULL); MB_TIMEVAL_SET(&mbtv, tv.tv_sec, tv.tv_usec); mb_progm_start(progm, tman, &mbtv);