1 #include "automation.inc"
4 #include "transportque.inc"
6 PanAutos::PanAutos(EDL *edl, Track *track)
9 type = AUTOMATION_TYPE_PAN;
17 Auto* PanAutos::new_auto()
19 return new PanAuto(edl, this);
22 void PanAutos::get_handle(int &handle_x,
29 previous = (PanAuto*)get_prev_auto(position, direction, (Auto* &)previous);
30 next = (PanAuto*)get_next_auto(position, direction, (Auto* &)next);
33 if(previous->handle_x == next->handle_x &&
34 previous->handle_y == next->handle_y)
36 handle_x = previous->handle_x;
37 handle_y = previous->handle_y;
42 int64_t total = labs(next->position - previous->position);
44 if(direction == PLAY_FORWARD)
46 fraction = (double)(position - previous->position) / total;
50 fraction = (double)(previous->position - position) / total;
53 handle_x = (int)(previous->handle_x + (next->handle_x - previous->handle_x) * fraction);
54 handle_y = (int)(previous->handle_y + (next->handle_y - previous->handle_y) * fraction);
59 printf(" PanAutos::dump %p\n", this);
60 printf(" Default: position %ld\n", default_auto->position);
61 ((PanAuto*)default_auto)->dump();
62 for(Auto* current = first; current; current = NEXT)
64 printf(" position %ld\n", current->position);
65 ((PanAuto*)current)->dump();
71 // c-file-style: "linux"